Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js 14 - sporadic npm failures on x86 #3407

Open
kewde opened this issue Apr 28, 2020 · 23 comments
Open

Node.js 14 - sporadic npm failures on x86 #3407

kewde opened this issue Apr 28, 2020 · 23 comments

Comments

@kewde
Copy link

kewde commented Apr 28, 2020

@FeodorFitsner

I've been having a consistent failure specifically with Node v14 on x86. (note x64 works fine!)
TryGhost/node-sqlite3#1318

npm is acting up a lot, the failure is consistent but the locus of the failure is very inconsistent.
Sometimes even calling npm -v will return error -1073741819, next run of the CI is returns fine but fails a bit later at another call of npm..

It's as if the setting of the permissions on npm happens async and decides to lock out it out at some point.

@kewde
Copy link
Author

kewde commented Apr 28, 2020

I found the culprit I think.

powershell Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
IF %ERRORLEVEL% NEQ 0 GOTO ERROR

@kewde kewde closed this as completed Apr 28, 2020
@kewde kewde reopened this Apr 28, 2020
@kewde
Copy link
Author

kewde commented Apr 28, 2020

After further inspection, it does remain unstable.
One time the CI worked fine: https://ci.appveyor.com/project/Mapbox/node-sqlite3/builds/32511420

One commit later, which re-enabled some of the informational npm requests seems to have undone the change. Perhaps npm root -g sporadically triggers some access control mechanism due to the fact that it's global? It wouldn't explain the failures on npm -v though..

One theory is that commands like npm root, npm bin etc take up time, removing them from the execution perhaps delayed the occurrence of the error.

It's a very strange bug.

@FeodorFitsner
Copy link
Member

So, you mean calling npm -v in a loop would be a repro for this issue?

@kewde
Copy link
Author

kewde commented Apr 29, 2020

@FeodorFitsner
I've made a repro for you (loop npm -v).

os: Visual Studio 2015
The AppVeyor config
https://github.com/kewde/node-sqlite3/blob/kewde/repro-appveyor-ci/appveyor.yml
The script it launches with the simple loop (500 iterations of npm -v).
https://github.com/kewde/node-sqlite3/blob/kewde/repro-appveyor-ci/scripts/build-appveyor.bat
The results of the CI
https://ci.appveyor.com/project/Mapbox/node-sqlite3/builds/32527631
Pull request that triggered the CI (kinda hard to see the changes but included for informational purpose):
TryGhost/node-sqlite3#1321

@kewde
Copy link
Author

kewde commented Apr 29, 2020

It's not a bug in solely npm because I don't experience these failures using the same version (6.14.4) on Node v13. I suspect that Node v14 has a permission issue which I assume underlies the execution of npm.

@kewde
Copy link
Author

kewde commented Apr 30, 2020

It's definitely a bug that's caused by the combined use of Node v14 & npm on x86.
I've attempted to replicate the permission issue using just a loop of node -v which didn't seem to cause any trouble.

@FeodorFitsner
Copy link
Member

Maybe it's better to submit an issue upstream (Node/NPM)?

@kewde
Copy link
Author

kewde commented Apr 30, 2020

@FeodorFitsner I have come to the same conclusion, I was hoping perhaps that this might just have been a permission issue on AppVeyors end.

@kewde kewde closed this as completed Apr 30, 2020
@FeodorFitsner
Copy link
Member

Funny enough the problem doesn't exist anymore in Node 14.1.0: https://ci.appveyor.com/project/FeodorFitsner/node-14-x86-issue/build/job/5dvx1arrlya8eh27

@kewde
Copy link
Author

kewde commented May 1, 2020

I'm glad to hear that, that should resolve my issue as the ABI remains the same over minor versions.

@vweevers
Copy link

FYI, this also happens on 14.3.0, but not 14.2.0.

Appears to be a bug in node, an access violation in V8. If I'm able to confirm (AppVeyor's RDP helped but I'm hoping to replicate locally) then I'll open an issue there.

@FeodorFitsner
Copy link
Member

@vweevers, @kewde have you ever submitted a bug to Node regarding that (or would you able to help us to file/describe the issue enough for Node team to consider it)? Looks like it's back again in 14.4.0 - we've got some new reports. Thank you!

@vweevers
Copy link

vweevers commented Jul 2, 2020

@FeodorFitsner I was unable to reproduce locally. Here's how far I got on an appveyor machine within the RDP session's time limit, with node 14.3.0 x86. If I remember correctly I ran (the equivalent of) npm -v.

appveyor access violation 2

@FeodorFitsner
Copy link
Member

We can enable a longer timeout for you if you are willing to help further and possibly file an issue?

@erossignon
Copy link

erossignon commented Aug 12, 2020

This is happening in https://ci.appveyor.com/project/erossignon/node-opcua-crypto and https://ci.appveyor.com/project/erossignon/node-opcua-pki too node-js with nodejs 14.2.0 x86.

@FeodorFitsner
Copy link
Member

Use x64 version of Node which doesn't have the issue.

@sidneys
Copy link

sidneys commented Aug 20, 2020

Encountered this issue with nodejs v14.8.0 as well:
When it is installed via Update-NodeJsInstallation without supplying the CPU architecture, the automatic attempt to install the x86 version fails:

Installing Node.js v14.8.0 (x86)...
Command exited with code -1073741819

However, when directly installing the x64 version (as per the recommendation of @FeodorFitsner), the issue is solved:

install:
  - cmd: echo 🔧 Installing nodejs
  - ps: Update-NodeJsInstallation 14.8.0 x64

Cheers
S

@erossignon
Copy link

Use x64 version of Node which doesn't have the issue.

Yes I am using x64 , but I also need x32. The purpose of using AppVeyor in my case it to test that the software is working on a wide variety of architecture, and nodejs version ...

@FeodorFitsner
Copy link
Member

Could you guys do a simplest repro for this issue please?

@FeodorFitsner
Copy link
Member

It looks like node/npm bug. We've been able to reproduce the issue on various platforms and bare-metal PC with Windows 10: nodejs/node#34927

@FeodorFitsner FeodorFitsner reopened this Aug 25, 2020
@bitjson
Copy link

bitjson commented Sep 2, 2020

If it's helpful, this issue is reliably affecting typescript-starter AppVeyor builds, e.g.
build 710.

@FeodorFitsner
Copy link
Member

Use x64 version of Node.

@bitjson
Copy link

bitjson commented Sep 2, 2020

Use x64 version of Node.

Ah, I hadn't looked at the AppVeyor configuration in a while, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants