apm icon indicating copy to clipboard operation
apm copied to clipboard

apm hangs on Windows when attempting to install a package containing `*` characters in some of its filenames

Open Ajedi32 opened this issue 8 years ago • 6 comments

When trying to install hard-wrap v1.1.0 on Windows, the install just hangs after gyp info ok:

$ apm install [email protected] --verbose
Installing [email protected] to C:\Users\ajedi.32\.atom\packages REQUEST { url: 'https://atom.io/api/packages/hard-wrap',
  json: true,
  retries: 4,
  proxy: 'http://localhost:3128/',
  strictSSL: true,
  headers: { 'User-Agent': 'npm/3.10.5 node/v4.4.5 win32 ia32' },
  callback: [Function],
  method: 'GET' }
REQUEST make request https://atom.io/api/packages/hard-wrap
REQUEST onRequestResponse https://atom.io/api/packages/hard-wrap 200 { server: 'Cowboy',
  connection: 'close',
  date: 'Thu, 20 Oct 2016 16:46:39 GMT',
  status: '200 OK',
  'x-frame-options': 'DENY',
  'x-xss-protection': '1; mode=block',
  'x-content-type-options': 'nosniff',
  'strict-transport-security': 'max-age=631152000',
  'content-security-policy': 'default-src \'self\'; connect-src \'self\'; font-src https://github-atom-io-herokuapp-com.global.ssl.fastly.net; frame-src \'self\' https://www.youtube.com; img-src https://* \'self\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net data:; media-src \'none\'; object-src \'self\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net; script-src \'self\' \'unsafe-inline\' https://ssl.google-analytics.com https://www.google-analytics.com https://platform.twitter.com https://github-atom-io-herokuapp-com.global.ssl.fastly.net; style-src \'self\' \'unsafe-inline\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net;',
  'content-type': 'application/json; charset=utf-8',
  etag: 'W/"563a1470e95e799d0d97736d8cc7dadf"',
  'cache-control': 'max-age=0, private, must-revalidate',
  'x-request-id': '316cb4a1-402b-4daf-813e-f2640a84bb30',
  'x-runtime': '0.014922',
  'x-rack-cache': 'miss',
  vary: 'Origin',
  via: '1.1 vegur' }
REQUEST reading response's body
REQUEST finish init function https://atom.io/api/packages/hard-wrap
REQUEST response end https://atom.io/api/packages/hard-wrap 200 { server: 'Cowboy',
  connection: 'close',
  date: 'Thu, 20 Oct 2016 16:46:39 GMT',
  status: '200 OK',
  'x-frame-options': 'DENY',
  'x-xss-protection': '1; mode=block',
  'x-content-type-options': 'nosniff',
  'strict-transport-security': 'max-age=631152000',
  'content-security-policy': 'default-src \'self\'; connect-src \'self\'; font-src https://github-atom-io-herokuapp-com.global.ssl.fastly.net; frame-src \'self\' https://www.youtube.com; img-src https://* \'self\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net data:; media-src \'none\'; object-src \'self\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net; script-src \'self\' \'unsafe-inline\' https://ssl.google-analytics.com https://www.google-analytics.com https://platform.twitter.com https://github-atom-io-herokuapp-com.global.ssl.fastly.net; style-src \'self\' \'unsafe-inline\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net;',
  'content-type': 'application/json; charset=utf-8',
  etag: 'W/"563a1470e95e799d0d97736d8cc7dadf"',
  'cache-control': 'max-age=0, private, must-revalidate',
  'x-request-id': '316cb4a1-402b-4daf-813e-f2640a84bb30',
  'x-runtime': '0.014922',
  'x-rack-cache': 'miss',
  vary: 'Origin',
  via: '1.1 vegur' }
REQUEST end event https://atom.io/api/packages/hard-wrap
REQUEST has body https://atom.io/api/packages/hard-wrap 3394
REQUEST emitting complete https://atom.io/api/packages/hard-wrap
REQUEST { url: 'https://www.atom.io/api/packages/hard-wrap/versions/1.1.0/tarball',
  proxy: 'http://localhost:3128/',
  strictSSL: true,
  headers: { 'User-Agent': 'npm/3.10.5 node/v4.4.5 win32 ia32' },
  method: 'GET',
  callback: undefined }
REQUEST make request https://www.atom.io/api/packages/hard-wrap/versions/1.1.0/tarball
REQUEST onRequestResponse https://www.atom.io/api/packages/hard-wrap/versions/1.1.0/tarball 302 { server: 'Cowboy',
  connection: 'close',
  date: 'Thu, 20 Oct 2016 16:46:39 GMT',
  status: '302 Found',
  'x-frame-options': 'DENY',
  'x-xss-protection': '1; mode=block',
  'x-content-type-options': 'nosniff',
  'strict-transport-security': 'max-age=631152000',
  'content-security-policy': 'default-src \'self\'; connect-src \'self\'; font-src https://github-atom-io-herokuapp-com.global.ssl.fastly.net; frame-src \'self\' https://www.youtube.com; img-src https://* \'self\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net data:; media-src \'none\'; object-src \'self\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net; script-src \'self\' \'unsafe-inline\' https://ssl.google-analytics.com https://www.google-analytics.com https://platform.twitter.com https://github-atom-io-herokuapp-com.global.ssl.fastly.net; style-src \'self\' \'unsafe-inline\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net;',
  location: 'https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0',
  'content-type': 'text/html; charset=utf-8',
  'cache-control': 'no-cache',
  'x-request-id': '000ea7e2-c687-4588-bd4a-79169a328d44',
  'x-runtime': '0.071274',
  'x-rack-cache': 'miss',
  vary: 'Origin',
  via: '1.1 vegur' }
REQUEST redirect https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0
REQUEST redirect to https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0
REQUEST {}
REQUEST response end https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0 302 { server: 'Cowboy',
  connection: 'close',
  date: 'Thu, 20 Oct 2016 16:46:39 GMT',
  status: '302 Found',
  'x-frame-options': 'DENY',
  'x-xss-protection': '1; mode=block',
  'x-content-type-options': 'nosniff',
  'strict-transport-security': 'max-age=631152000',
  'content-security-policy': 'default-src \'self\'; connect-src \'self\'; font-src https://github-atom-io-herokuapp-com.global.ssl.fastly.net; frame-src \'self\' https://www.youtube.com; img-src https://* \'self\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net data:; media-src \'none\'; object-src \'self\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net; script-src \'self\' \'unsafe-inline\' https://ssl.google-analytics.com https://www.google-analytics.com https://platform.twitter.com https://github-atom-io-herokuapp-com.global.ssl.fastly.net; style-src \'self\' \'unsafe-inline\' https://github-atom-io-herokuapp-com.global.ssl.fastly.net;',
  location: 'https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0',
  'content-type': 'text/html; charset=utf-8',
  'cache-control': 'no-cache',
  'x-request-id': '000ea7e2-c687-4588-bd4a-79169a328d44',
  'x-runtime': '0.071274',
  'x-rack-cache': 'miss',
  vary: 'Origin',
  via: '1.1 vegur' }
REQUEST make request https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0
REQUEST onRequestResponse https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0 200 { 'content-length': '8568',
  'access-control-allow-origin': 'https://render.githubusercontent.com',
  'content-security-policy': 'default-src \'none\'; style-src \'unsafe-inline\'',
  'strict-transport-security': 'max-age=31536000',
  vary: 'Authorization,Accept-Encoding',
  'x-content-type-options': 'nosniff',
  'x-frame-options': 'deny',
  'x-xss-protection': '1; mode=block',
  etag: '"f3f5d843d718091d6c806d47950e96a89eb705b2"',
  'content-type': 'application/x-gzip',
  'content-disposition': 'attachment; filename=forivall-atom-hard-wrap-v1.1.0-0-gf3f5d84.tar.gz',
  'x-geo-block-list': '',
  date: 'Thu, 20 Oct 2016 16:46:39 GMT',
  'x-github-request-id': '6267801D:24A2:1FD926:5808F4EF',
  connection: 'close' }
REQUEST finish init function https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0
REQUEST response end https://codeload.github.com/forivall/atom-hard-wrap/legacy.tar.gz/v1.1.0 200 { 'content-length': '8568',
  'access-control-allow-origin': 'https://render.githubusercontent.com',
  'content-security-policy': 'default-src \'none\'; style-src \'unsafe-inline\'',
  'strict-transport-security': 'max-age=31536000',
  vary: 'Authorization,Accept-Encoding',
  'x-content-type-options': 'nosniff',
  'x-frame-options': 'deny',
  'x-xss-protection': '1; mode=block',
  etag: '"f3f5d843d718091d6c806d47950e96a89eb705b2"',
  'content-type': 'application/x-gzip',
  'content-disposition': 'attachment; filename=forivall-atom-hard-wrap-v1.1.0-0-gf3f5d84.tar.gz',
  'x-geo-block-list': '',
  date: 'Thu, 20 Oct 2016 16:46:39 GMT',
  'x-github-request-id': '6267801D:24A2:1FD926:5808F4EF',
  connection: 'close' }
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Users\\ajedi.32\\AppData\\Local\\atom\\app-1.11.2\\resources\\app\\apm\\bin\\node.exe',
gyp verb cli   'C:\\Users\\ajedi.32\\AppData\\Local\\atom\\app-1.11.2\\resources\\app\\apm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'install',
gyp verb cli   '--runtime=electron',
gyp verb cli   '--target=0.37.8',
gyp verb cli   '--dist-url=https://atom.io/download/atom-shell',
gyp verb cli   '--arch=ia32',
gyp verb cli   '--ensure',
gyp verb cli   '--verbose',
gyp verb cli   '--proxy=http://localhost:3128/' ]
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp verb command install []
gyp verb install input version string "0.37.8"
gyp verb install installing version: 0.37.8
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
0.37.8
gyp info ok

The node process seems to be using about 15% of my CPU (on an 8-core system) during this stage of the install, but the install never completes.

I'm able to install other packages, and even other versions of hard-wrap just fine. It's only this specific version of hard-wrap which is failing to install.

While I'm not certain of the exact cause of this issue, the only thing I can think of which seems out of the ordinary is that this specific version of hard-warp contains a directory with a rather unusual name: spec/fixtures/plain-text/properly-handles-*-prefix/

Windows doesn't allow * characters in filenames. In fact, I wasn't even able to check out the repo with git for that very reason.

While I think it's reasonable for the install to fail on Windows because of this, it definitely shouldn't just hang. Preferably the install should fail with a useful error message explaining the exact cause of the issue. (Which file in which package contains the invalid character, and why that's a problem on Windows.)

Ajedi32 avatar Oct 20 '16 16:10 Ajedi32

See also forivall/atom-hard-wrap#18

Ajedi32 avatar Oct 20 '16 16:10 Ajedi32

Has this issue been addressed? I just tried to install hard-wrap in Atom for Windows 10 x64, and the installation hangs.

drspangle avatar Aug 11 '17 20:08 drspangle

@drspangle The change was merged to the hard-wrap repo but it seems that a new release was never published. I would suggest that you open a new issue on their repository for this.

Ben3eeE avatar Aug 12 '17 13:08 Ben3eeE

@Ben3eeE FWIW, the reason I opened an issue here and not just on the hard-wrap repo is because I don't think that having the install just hang with no error message is good behavior on apm's part here.

Ideally the install should fail with an error message about files/folders containing the * character not being supported on Windows, and a list of the files in question that are causing the problem.

Is this something apm can solve? Or is this an upstream issue with npm?

Ajedi32 avatar Aug 12 '17 16:08 Ajedi32

I agree that this issue should still be open and that it belongs on this repository. Sorry if that was not clear. My comment was just to help out @drspangle because publishing a new version of hard-wrap is a much faster fix than addressing it in apm.

Ben3eeE avatar Aug 12 '17 16:08 Ben3eeE

Thanks, guess I'll have to head over there and create a new issue with a reference to this issue here.

drspangle avatar Aug 29 '17 19:08 drspangle