nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
106.43k stars 29.01k forks source link

Node v11.0 windows installation opting into chocolatey+boxstarter results in infinite reboots #23838

Closed roa-nyx closed 5 years ago

roa-nyx commented 5 years ago

Apologies if this is the wrong place to report this. But I just tried the windows installer for Node v11.0. There was an option to install build-tooling using chocolatey and boxstarter. It warned me that there would be reboots. After it rebooted over 20 times I kind of figured it was in a permanent reboot cycle so I stopped it. I am on an AD so I'm wondering if maybe there is some conflicting policy or antivirus at work that may be interfering with this process.

I'll try to update this task when I have time to try this on my home machine.

Not sure what more I can provide in the way of a test case..

Trott commented 5 years ago

@nodejs/platform-windows

nullivex commented 5 years ago

I stopped the startup script to prevent a loop. However, it rebooted my computer without warning. This is a bug for sure.

nullivex commented 5 years ago

Back on my computer now. I was able to work around this on Windows 10 64bit. The annoying part where it forces the computer off and looks like a Virus is definitely true and should be fixed, it also didn't give me a chance to save any programs (sort of a force restart it seems). Also, I didn't get a chance to choose about installing boxstarter is that a problem?

Anyway, in order to work around this I did the following steps.

  1. Open the start menu
  2. Type "Startup Tasks"
  3. Open "Startup Tasks"
  4. Scroll to the bottom and disable "boxstarter-post-restart.bat"

Hope this helps.

roa-nyx commented 5 years ago

For me I just needed to quickly focus on the window that was about to reboot, and hit Ctrl+C. Knocked it right out. I don't feel comfortable having done that as I don't know if it was in the middle of some sensitive work. Node appears to be working without issue for the time being, but I worried I may be in an inconsistent state.

nullivex commented 5 years ago

@klick-barakgall Yea, I ran the installer and went off to multitask and when I saw power shell pop up it was not until I saw chocolatey that I felt safe that I had not just downloaded a malicious version of the Node installer (my script was running quickly and I couldnt see that it was going to reboot before it was gone) :octocat:

Trott commented 5 years ago

Surprised no one from @nodejs/platform-windows chimed in yet. Let's try @nodejs/build.

digitalinfinity commented 5 years ago

@joaocgreis can you take a look please? infinite reboots are bad 😞

joaocgreis commented 5 years ago

@klick-barakgall can you see in the console what is being installed when it reboots? This is probably some corner case with some package, can you take a look at the log files in C:\ProgramData\chocolatey\logs or upload them here?

roa-nyx commented 5 years ago

@joaocgreis choco.summary.log chocolatey.log

redwebs commented 5 years ago

I installed Node 11 on a Dell laptop with 64 bit Windows 10 and unfortunately choose the Boxstarter install option. I thought the note just said you will have to restart your command window. I saw nothing about computer restarts. Node installed just fine but the Powershell Script rebooted 4 times before I noticed it was in a loop to install a script to keep Windows update from changing things. Since the reboot happens quickly you have to be ready to click on the Powershell window and hit Ctrl-C quickly. You are then prompted to type the text "ENTER" to exit the script.

I then got a Windows message "You must restart your computer to turn off User Account Control". I didn't want UAC turned off but restarted anyway and everything seemed to work and UAC was on.

I did have one program that syncs my Outlook address book with Google contacts that started up with a library error "Cannot open registry Interface{00063001-0000-0000-C000-000000000046}\TypeLib." After several attempts to fix this (including spelunking into the dreaded Windows Registry) I had success by running the repair option on Office installer. (Under Add or Remove Programs).

I doubt Boxstarter works and I don't even want to see that name for while.

aarsilv commented 5 years ago

This happened to me too on my Windows 10 machine. Once rebooting quickly X-out of the boxstarter script. Then press Ctrl+Shift+Esc to open up task manager and select the "Startup" tab where you can right click and disable boxstarter-post-restart.bat.

alexfung888 commented 5 years ago

Me too. Reboots forever. Created dozens of install scripts under BuildPackages, every one of them reads:

choco upgrade -y python2
choco upgrade -y visualstudio2017buildtools
choco upgrade -y visualstudio2017-workload-vctools

I guess python2 is never installed properly. When using nodejs, I get in gyp errors with pythrons all the time, but it seems ok to ignore them, except that it now keeps rebooting the machine (and needs me to type password too).

I also get a strange directory called regid.1991-06.com.microsoft with two .swidtag files inside.

To exit the loop, control break and type

cleanup-Boxstarter

to undo its other temp changes (disable UAC, disable Windows update, etc).

PS: I got the problem with LTS Node 10. I think it has nothing to do with Node version, just the way it is using boxstarter to install tools.

alexfung888 commented 5 years ago

and if I bypass install tools with Nodejs, the installer told me to follow the steps at

https://github.com/nodejs/node-gyp#on-windows

unfortunately it won't work. It seems windows-build-tools only support nodejs v4..9. maybe that's also why chocolatey failed.

error upath@1.0.4: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.12.0"
error Found incompatible module

and installing it with --ignore-engines crashed the whole Windows.

MikaelSoderstrom commented 5 years ago

I then got a Windows message "You must restart your computer to turn off User Account Control". I didn't want UAC turned off but restarted anyway and everything seemed to work and UAC was on.

I just got UAC turned off myself and had to activate it manually. This is really, really bad.

aesqe commented 5 years ago

Same here.

After the 3rd or 4th restart, the script had finally managed to install Python and Build Tools (that's just a guess at this point).

But after the next restart, it looked like it was going to begin the whole process again so I stopped the script and removed the startup task.

And I've just noticed that my UAC is off.

jmmobley commented 5 years ago

How is that no one from nodejs has weighed in on this issue. This is clearly a bug, and one that damages a person's development environment. Someone from Node should get on here and answer for this.

jasnell commented 5 years ago

Ping @nodejs/build @nodejs/platform-windows ... @joaocgreis @richardlau ... please take a look. Looks like #22645 is causing some issues for some users.

refack commented 5 years ago

Maybe to people at Microsoft can help with perspective on their end? @yodurr, @crutkas and @bitcrazed & @gep13

joaocgreis commented 5 years ago

@klick-barakgall the logs don't show anything that may be causing the reboots, only that installing Chocolatey and Boxstarter succeeded and it is probably rebooting installing our script. Can you see at what point the script reboots? What appears on the console, what is being installed? A picture or a video of your screen might help if you can't read it in time.

joaocgreis commented 5 years ago

@klick-barakgall can you also upload the log from C:\Users\YOUR_USERNAME\AppData\Local\Boxstarter?

roa-nyx commented 5 years ago

Apologies @joaocgreis this happened on installation on a work machine and it will probably be a while before I can start messing around with (jeopardizing) my NodeJS install and give myself enough time to recover from any potentially bad state. I'm sorry I just don't want to risk destabilizing my dev environment any further at this time.

That being said here is the next log you've requested: boxstarter.log

joaocgreis commented 5 years ago

For everyone having this issue, if the computer reboots more than 20 times please upload your log from C:\Users\YOUR_USERNAME\AppData\Local\Boxstarter\boxstarter.log and describe as well as possible what appears in the console before the reboot. Screenshots, photos or videos would be helpful. Please note that the script will always start from the beginning after a reboot, but it will notice previous packages are already installed and skip them. There is only an issue if the script is always rebooting at the same point, and finding out what it is doing at that point is key to solving this issue.

@klick-barakgall in the log file I see that it run for almost 50 minutes and rebooted 7 times. Then it finished successfully, looks like everything was installed in the end. So, whatever was causing the reboots happened after our script run. I understand you don't want to disturb your machine, but perhaps someone else with the same issue can help.

alexfung888 commented 5 years ago

boxstarter.zip everytime it waits for some WMI to stop, and build a new package and reboot without prompt.

All the C:\ProgramData\Boxstarter\BuildPackages*.tmp\tools directories have the same ps1 file:

choco upgrade -y python2 choco upgrade -y visualstudio2017buildtools choco upgrade -y visualstudio2017-workload-vctools

from control panel, I have python 2.7.15 and vs build tools 2017 installed on that date. I don't find anything called workload vctools.

@gep13 re the list of info you asked for:

gep13 commented 5 years ago

I am part of the Chocolatey Development Team, and I help oversee both the Chocolatey and Boxstarter projects. While it looks like there is definitely an issue in here that needs to be resolved, let me start by saying that this does work. I have just created a fresh VM with nothing on it, and performed the installation of NodeJS, including the additional components, and it worked as expected. During that process there was a single reboot.

I captured this in a video which I have uploaded here:

https://youtu.be/gwFpXXIJTvs

In order to try to figure out what is going on, it would be good to try to figure out if there is some commonality between the people that have reported problems. Things that I am thinking about are:

There was an issue which I documented here:

https://github.com/chocolatey/boxstarter/issues/357#issuecomment-431705029

Where the installation of the packages in the NodeJS installation was inadvertently causing a call to the Install-WindowsUpdate cmdlet, which if your machine wasn't up to date with Windows Update would potentially cause multiple reboots of the machine. Not from the installation of the package themselves, but rather from the Windows Updates that were being installed. This issue has been addressed and should no longer happen.

Regarding the disabling of UAC, the original author of Boxstarter added some information about why disabling of UAC is required in the context of Boxstarter here:

https://github.com/chocolatey/boxstarter/issues/358#issuecomment-434502536

At the end of the Boxstarter execution, the UAC status will be returned to what it was before it started. You can see that in the video I linked to:

image

Cancelling the Boxstarter execution obviously prevents this from being re-enabled.

As I mentioned, if we could start collating what is different/similar between the machines where there is a problem, and those where there aren't, it would help to try to get to the bottom of the problem.

Adding @pauby @flcdrg @mwallner @ferventcoder

ferventcoder commented 5 years ago

Howdy folks - I filed a PR to make folks aware of the behavior upon installation - https://github.com/nodejs/node/pull/24000

targos commented 5 years ago

There is also https://github.com/nodejs/node/pull/23987 that adds a prompt.

yodurr commented 5 years ago

I've also seen a boxstarter script getting into a state where it seems stuck in a reboot loop. My guess is this is what's happening: https://github.com/chocolatey/boxstarter/issues/193 I'll run the tests mentioned in that issue next time I encounter this.

refack commented 5 years ago

@gep13 and @yodurr, thank you very much for chiming in. @klick-barakgall and @alexfung888 thank you for following up with more information. And of course thank you @joaocgreis for working on this!

And thank you to everybody else for reporting this, and in so helping the Node.js team resolve this, and make the Node.js experience on Windows better.

Dregdael commented 5 years ago

Help me please, I don't know what to do, I was stuck on the infinite reboot I stopped the .bat and pressed control+C an the powershell terminal, I closed the terminal also, but I don't know what to do, I'm not very tech savy, I just wanted node-red, I'm freaking out did I screw over my computer? How do I remove whatever I did? Do I start the process over again?

nullivex commented 5 years ago

@Dregdael First, no you did not mess up your computer. What need to be done is when you see the command box pop up after rebooting and start executing code, close it before another reboot occurs. After that, open the Start Menu and type "Startup" you will see an entry called "Startup Tasks" open that program. Once open you will see boxstarter.bat file listed. Disable and remove that entry from startup. Now you should be able to resume normal operation.

Dregdael commented 5 years ago

@nullivex Ok, thank you, I disabled the .bat and went to the folder and deleted it, but what do you mean remove normal operation? I'd like to just get rid of the boxstarter and chocolatey stuff, do I install in program files?

nullivex commented 5 years ago

@Dregdael Sorry about the typo, I edited my original I meant to say "Now you should be able to RESUME normal operation."

According to a couple users here it may have disabled your UAC that needs turned back on. Also there is a report that it disables Windows Update that is another setting that needs reverted.

I am a little offset by how little priority is being given to this issue. Seems like the main installer should have commented out the Boxstarter chain install until this is solved and released an interstitial version.

Dregdael commented 5 years ago

@nullivex Oh ok, thank you, I got confused since I'm not a native english speaker but I get it now

Also yes, I do believe this sort of stuff should be sorted out before being released.

I do have another issue though, there's the fact that windows update doesn't actually seem to revert back to automatically downloading updates, I'll check if there's any way to get rid of everything that was installed.

UAC does work though, I'm just glad it I don't have to do something drastic like reinstalling my OS

joaocgreis commented 5 years ago

@alexfung888 thanks for uploading your log file, it does indeed show a reboot loop. It looks like Boxstarter always detects that a reboot is pending, even when it has just rebooted. Can you run this command:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperations

and paste the output here? This might be related to antivirus. Your log file does not show Python or VS getting installed, it's strange that you found them as installed. As a note, vctools is not an independent program that will appear in the Control Panel. If you open the Visual Studio installer and click on "Modify" for the Build Tools, the Visual C++ workload should be installed.

@Dregdael are you sure you were in a reboot loop? Was it always rebooting in the exact same place? Can you upload your log file from C:\Users\YOUR_USERNAME\AppData\Local\Boxstarter\boxstarter.log? (Detailed instructions: open a File Explorer window; click the box with the folders on the top to enter the location manually; type %LOCALAPPDATA%\Boxstarter and then drag and drop the file that looks like a Text Document named boxstarter to the comment here.) If you want to uninstall, there are instructions at https://github.com/chocolatey/boxstarter/issues/357#issuecomment-431705029.

Dregdael commented 5 years ago

@joaocgreis

boxstarter.log

I mean, it started to reboot and since I have a disk partition I had to manually select the windows start each time so when i saw on the console that a bunch of stuff seemed the same I panicked, now that I think about it I'm not sure I was actually stuck on a loop, I might have fallen prey to panic and actually gotten myself into a mess cause I didn't understand any of this, so I don't think it's actually the devs fault, it's more my own.

Thanks for the detailed instructions, you're a saint.

joaocgreis commented 5 years ago

@Dregdael you cancelled the installation while Visual Studio was installing the Visual C++ workload. It probably kept running in the background (because it's the Visual Studio installer), so you might just have everything installed. You can check if it is by opening the Visual Studio Installer and checking if the Visual C++ workload is installed in the Build Tools.

alexfung888 commented 5 years ago

@joaocgreis

Thanks. The reg query output: pending.txt

I'm not sure I understand what I'm doing. With Modify in VS Installer, I can see Visual C++ Build Tools listed under the Workloads tab. I guess it means it is installed correctly.

May be they are installed afterwards, because I have also tried to do a yarn global add windows-build-tools from admin cmd, and it ran for over 12 hours (it completed in 6 minutes on another machine) and was still running.

By the way, yesterday I successfully did a npm install windows-build-tools -g which completed successfully in 11 minutes. I found most build processes frightening because they can run for extended periods of time and you have little idea whether it is still running (it doesn't always have animation).

Dregdael commented 5 years ago

@joaocgreis

I checked on the Visual Studio installer and there's a new item called Visual Studio Build Tools 2017 (2) on it, next to the usual Visual Studio Community 2017, I clicked modify to check installed items and Visual C++ build tools is unchecked along with everything else, so I guess it didn't install it

joaocgreis commented 5 years ago

@alexfung888 thanks for the log files, indeed I see Avast there but I'll have to investigate more. In your case, since you have the Visual C++ workload, you should have everything you need installed.

@Dregdael you can check it and install it from there. That's exactly what the last package does. If you do that, you should get everything you need installed.

Dregdael commented 5 years ago

@joaocgreis

OK, thank you very much for your help

alexfung888 commented 5 years ago

@joaocgreis Avast? I don't have avast installed or running. I don't know how come an AVAST folder is sitting there or why Windows want to rename it.

JamesAndrewJackson13 commented 5 years ago

@joaocgreis Still need logs? If so, hope this helps. boxstarter.log

Basic info: Operating System: Windows 10 (Dell branded computer)

PowerShell Version: PowerShell 6(x64)

What, if any, .Net Frameworks are installed: I know I had some, but I'm not sure what was installed at the time. My apologies.

Any previous versions of NodeJS installed: Yes, current long term (10.13 LTS)

Are Windows updates enabled? Yes.

Are Windows Updates up to date? Yes, I'm certain of that. Last update occurred at approximately 11pm (about two hours before this happened).

Other notes:

joaocgreis commented 5 years ago

@JamesAndrewJackson13 I don't see an error in the log file. Can you let it finish?

Aprillion commented 5 years ago

FYI, I was able to get into a similar state (with Node 10, not just 11) and got a powershell prompt with Please provide your password so that Boxstarter may automatically log you on. (I had no idea what is boxstarter, it was a day later after an unfinished Node install)... That definitely looked "like a virus" as mentioned previously until I checked it wasn't (but I manually uninstalled choco and had to check my UAC status).

So I hope any future fix will make it into Node 10 as well, not just to master.

adi518 commented 5 years ago

Experienced something similar. I opt'ed in (v11.1.0). It ran the script, rebooted, ran its post-reboot script and rebooted again, this time to a black screen. I don't know if it rebooted several times because I wasn't even seeing the Windows loader and the screen remain black without flashing or anything. Hitting the reset button few times didn't help it, so I ended cold-booting and then Windows finally came up. Then, another script pop, it tried to install few redistributables, but the actual resources were missing so it failed those parts. No idea how to verify the integrity of this entire bizarre process. Plus, I have no idea if it left my OS pristine or changed things like permissions and so.

PS, At some point in the script, it logs "disabling automatic windows updates...". Wat??

Edit: It seems I had an issue with my keyboard, so the part where the screen went black seems like a local issue. Anyway, this cleared a lot of things for me: https://github.com/chocolatey/boxstarter/issues/357#issuecomment-431705029

MarioAnes commented 5 years ago

FYI, I was able to get into a similar state (with Node 10, not just 11) and got a powershell prompt with Please provide your password so that Boxstarter may automatically log you on. (I had no idea what is boxstarter, it was a day later after an unfinished Node install)... That definitely looked "like a virus" as mentioned previously until I checked it wasn't (but I manually uninstalled choco and had to check my UAC status).

So I hope any future fix will make it into Node 10 as well, not just to master.

Yup, same here. I figured since it's LTS, it was safe to install. I also had Chocolatey already installed on my machine before installing Node 10

StoilovskiMile commented 5 years ago

choco upgrade -y python2 choco upgrade -y visualstudio2017buildtools choco upgrade -y visualstudio2017-workload-vctools

Sugested by Alex888 works like a charm, I've previosly turned UAC off

Snowbell92 commented 5 years ago

ran into the same thing today using Node 10. I had everything except python (I have python 3 installed). aborted the process in the middle, uninstalled node and now I am manually installing dependencies (following the steps written in node-gyp repo).

soapnrope commented 5 years ago

I got a bit different problem regarding the installation.

I aborted the installation process because of semi unexpected reboots. UAC and Windows Update reminded disabled. Re-ran the node setup and let the boxstarter script do its thing hoping that it would re enables UAC/updates.

As you can see in the screenshot bellow, the automatic update should be re-enabled, but it actually failed(fails) to do that and now its "Managed by your organization". Group policy is looks messed up. By no means I'm in active directory, so it shouldn't be like this. image

How can I revert this? aka Make Windows Updates as they where with defaults settings.

mrkeyboard commented 5 years ago

After the first sudden restart, I found I was logged out of all websites on Chrome. Soon after the second restart came and I had to stop it. I removed everything I could find related to Chocolatey and Boxstarter. Checking that automatic installation was a mistake, it's unnecessarily aggressive and intrusive.

Edit: I used Windows Restore to make sure everything is back to normal. I suggest anyone experiencing similar issues to do the same