On running choco upgrade all -y (as Administrator), I always get a validation error as follows:
PS C:\WINDOWS\system32> choco upgrade all -y
Chocolatey v0.10.13
2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).
Validation Warnings:
- A pending system reboot request has been detected, however, this is
being ignored due to the current Chocolatey configuration. If you
want to halt when this occurs, then either set the global feature
using:
choco feature enable -name=exitOnRebootDetected
or pass the option --exit-when-reboot-detected.
I have rebooted multiple times but I can't get rid of this error. Chocolatey runs fine with this error, updating any applications as necessary. Does it look for a particular file or registry key for this validation, that has for some reason become locked?
I am running up-to-date Windows 10 x86_64, and v0.10.13 is the latest version of chocolatey as of this report. Please let me know if I need to provide any additional information.
Related to #1038 and #1746
Need your detailed log as indicated when you created this issue. There is info provided there we need to see
@astatine That is a warning by the way - if you flip on the feature for exiting on reboot detected, it will be an error and won't allow choco to continue. It would be helpful to see the full debug log to see what is triggering the pending reboot validation to flag.
@astatine out of curiosity - which template did you choose? I don't see any of what we normally see with an issue/bug report.
@ferventcoder I made a mistake in choosing the template; I chose Chocolatey GUI - Report Issue / Suggest Feature instead of Choco.exe - Report Issue which was all the way at the end. I snipped what I thought was extraneous text (pretty much the entire template). Sorry about that.
chocolatey.log contents from the latest run are attached.
~~~
This is the one - @pauby is that the one you were seeing as well?
@ferventcoder I was never able to reproduce this again and therefore never got the logs (was doing it on a Vagrant instance so rolled back).
However the original message seems very similar to what I was seeing (ie. pending reboot message persisted after a reboot).
@pauby lots of things can indicate a need for a reboot. If you run into it again, try to grab that first section of the logs that outputs the validation log - it drops into the log file at a debug level by default. It'll be helpful to know what's causing it for you.
I got the same bug on two machines. This is one of em
~
2019-03-21 16:39:45,405 38704 [INFO ] - Chocolatey v0.10.13
2019-03-21 16:39:45,405 38704 [DEBUG] - Chocolatey is running on Windows v 10.0.17763.0
2019-03-21 16:39:45,405 38704 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2019-03-21 16:39:45,405 38704 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2019-03-21 16:39:45,437 38704 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" outdated
2019-03-21 16:39:45,437 38704 [DEBUG] - Received arguments: outdated
2019-03-21 16:39:45,499 38704 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2019-03-21 16:39:45,515 38704 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2019-03-21 16:39:45,515 38704 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2019-03-21 16:39:46,232 38704 [DEBUG] - Performing validation checks.
2019-03-21 16:39:46,247 38704 [DEBUG] - Global Configuration Validation Checks:
2019-03-21 16:39:46,247 38704 [DEBUG] - - Package Exit Code / Exit On Reboot = Checked
2019-03-21 16:39:46,247 38704 [DEBUG] - System State Validation Checks:
2019-03-21 16:39:46,247 38704 [DEBUG] - Reboot Requirement Checks:
2019-03-21 16:39:46,247 38704 [DEBUG] - - Pending Computer Rename = Checked
2019-03-21 16:39:46,247 38704 [DEBUG] - - Pending Component Based Servicing = Checked
2019-03-21 16:39:46,247 38704 [DEBUG] - - Pending Windows Auto Update = Checked
2019-03-21 16:39:46,263 38704 [DEBUG] - - Pending File Rename Operations = Flagged
2019-03-21 16:39:46,263 38704 [INFO ] - 2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).
2019-03-21 16:39:46,263 38704 [INFO ] -
2019-03-21 16:39:46,263 38704 [WARN ] - Validation Warnings:
2019-03-21 16:39:46,263 38704 [WARN ] - - A pending system reboot request has been detected, however, this is
being ignored due to the current command being used 'outdated'.
It is recommended that you reboot at your earliest convenience.
~
Also in my case the Pending File Rename Operations is flagged
@Megasware128 That's the one I keep seeing - it's as if the reboot doesn't actually fix up the file rename. Windows can be a weird animal. This may be one we remove from the checks if it continues to come up and not go away after reboots.
May I toss in my $.02?
In my research on identifying pending reboots for another project (https://github.com/teknowledgist/TeknowTools/tree/master/AutoReboot), I found that the pending file rename possibility occurs far more often than anyone realizes. It also is not uncommon to find the pending file name does not occur or is not cleared. As such, any script that triggers on that flag may eternally report it is "pending reboot.
I removed (commented out) that check in my reboot script because of all the complaints.
I would suggest that pending file renames should be ignored as a pending reboot item. I think it is likely too difficult to identify if they are "real" and it is probably rather rare that they will get in the way. Certainly if there were some way to identify if the files that are pending are ones needed for an install, then some code should be written to handle that, but I think that would be pretty messy.
Seeing the same on my computers, Chocolatey reports a pending reboot, and the log says
2019-03-22 11:10:36,222 12204 [DEBUG] - System State Validation Checks:
2019-03-22 11:10:36,224 12204 [DEBUG] - Reboot Requirement Checks:
2019-03-22 11:10:36,226 12204 [DEBUG] - - Pending Computer Rename = Checked
2019-03-22 11:10:36,227 12204 [DEBUG] - - Pending Component Based Servicing = Checked
2019-03-22 11:10:36,228 12204 [DEBUG] - - Pending Windows Auto Update = Checked
2019-03-22 11:10:36,229 12204 [DEBUG] - - Pending File Rename Operations = Flagged
2019-03-22 11:10:36,232 12204 [INFO ] - 2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).
@teknowledgist do you know if this issue was ever reported to MS as a bug?
@bazzilic I do not.
I will say though that even on machines where the rename does complete, it was not uncommon for those machines to be in "pending reboot" status after just a few days. There are just a lot more file renames going on that folks realize.
I'm getting the same issue every time I run the choco outdated or choco upgrade commands.
2019-03-22 10:05:12,463 3212 [DEBUG] - XmlConfiguration is now operational
2019-03-22 10:05:12,497 3212 [INFO ] - ============================================================
2019-03-22 10:05:12,663 3212 [INFO ] - Chocolatey v0.10.13
2019-03-22 10:05:12,668 3212 [DEBUG] - Chocolatey is running on Windows v 10.0.16299.0
2019-03-22 10:05:12,670 3212 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2019-03-22 10:05:12,671 3212 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2019-03-22 10:05:12,680 3212 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" outdated
2019-03-22 10:05:12,681 3212 [DEBUG] - Received arguments: outdated
2019-03-22 10:05:12,717 3212 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2019-03-22 10:05:12,722 3212 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2019-03-22 10:05:12,728 3212 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2019-03-22 10:05:12,775 3212 [DEBUG] - Performing validation checks.
2019-03-22 10:05:12,779 3212 [DEBUG] - Global Configuration Validation Checks:
2019-03-22 10:05:12,780 3212 [DEBUG] - - Package Exit Code / Exit On Reboot = Checked
2019-03-22 10:05:12,782 3212 [DEBUG] - System State Validation Checks:
2019-03-22 10:05:12,783 3212 [DEBUG] - Reboot Requirement Checks:
2019-03-22 10:05:12,792 3212 [DEBUG] - - Pending Computer Rename = Checked
2019-03-22 10:05:12,793 3212 [DEBUG] - - Pending Component Based Servicing = Checked
2019-03-22 10:05:12,794 3212 [DEBUG] - - Pending Windows Auto Update = Checked
2019-03-22 10:05:12,796 3212 [DEBUG] - - Pending File Rename Operations = Flagged
2019-03-22 10:05:12,798 3212 [INFO ] - 2 validations performed. 1 success(es), 1 warning(s), and 0 error(s).
2019-03-22 10:05:12,800 3212 [INFO ] -
2019-03-22 10:05:12,802 3212 [WARN ] - Validation Warnings:
2019-03-22 10:05:12,803 3212 [WARN ] - - A pending system reboot request has been detected, however, this is
being ignored due to the current command being used 'outdated'.
It is recommended that you reboot at your earliest convenience.
It's likely we'll remove the pending file rename. Last thing we want is to be the cause of a reboot loop while someone is trying to get things happy.
In my research on identifying pending reboots for another project (https://github.com/teknowledgist/TeknowTools/tree/master/AutoReboot), I found that the pending file rename possibility occurs far more often than anyone realizes.
@teknowledgist thank you for that! We'll probably remove the pending file renames bit as well - and it may have helped us determine one of the sources of the reboot loops that occurs with Boxstarter as well (if it is using this same logic).
I've found this to be true as well; e.g. EVERY TIME I install an Exchange Cumulative Update it fails due to pending reboot file renaming even after multiple reboots. So I delete the registry key.
I got the same thing. Upon inspecting the 'PendingFileRenameOperations' registry key, it only contained references to files in chocolatey's own temp directory.
C:\Users\%username%\AppData\Local\Temp\chocolatey
Clearing the reg key and deleting the files by hand appear to have fixed it (for now).
I've seen the same behavior. For CLI weenies:
Check if you've got a pending file rename interfering with your desired operation:
REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperations
If you do, and you're _sure_ you know what you're doing:
REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperations /f
This has been committed into the stable branch, and will be released as part of 0.10.14.
~It seems there are remaining issues in 0.10.14 milestone.~ Before 0.10.14 release, executing
> Restart-Computer
in PowerShell suppresses the Validation Warning for my case.
@jihoonerd I am not sure what you are saying here. You installed the beta and it is still flagging?
@ferventcoder Ah sorry for the confusion. The 0.10.14 works well. What I meant was a workaround to suppress the reboot warning message before 0.10.14 release.
I am experiencing this issue in 0.10.13 but rebooting my computer with the PowerShell command somehow solved the flagging problem.
~It seems there are remaining issues in
0.10.14milestone.~ Before0.10.14release, executing> Restart-Computerin PowerShell suppressed the
Validation Warningfor my case.
I can confirm this. Before running the Restart-Computer command I had a lot of rename paths in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations. After the reboot that key is gone and chocolatey does not complain about a pending reboot anymore.
~It seems there are remaining issues in
0.10.14milestone.~ Before0.10.14release, executing> Restart-Computerin PowerShell suppressed the
Validation Warningfor my case.I can confirm this. Before running the
Restart-Computercommand I had a lot of rename paths inHKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations. After the reboot that key is gone and chocolatey does not complain about a pending reboot anymore.
~It seems there are remaining issues in
0.10.14milestone.~ Before0.10.14release, executing> Restart-Computerin PowerShell suppresses the
Validation Warningfor my case.
Thanks for your suggestion, but in my Windows 10 system after running Restart-Computer in powershell the pending reboot warning is still there. I decide to wait for the 0.10.14 fix.
I'm experiencing this on 0.10.15.
@awslovato are you sure that it is related to the file renaming operations?
Or is it due to windows actually needing to do a reboot?
The later would be expected.
Running Restart-Computer in PowerShell removed the warning for me. I was using version 0.10.15 so this does still seem to be an issue.
@roblapp howdy! I'm not sure how you see it in 0.10.15 - we ignore the check completely (https://github.com/chocolatey/choco/commit/ba523b40d68f5abf12c2a2ff952c5dce5625b0a2). Perhaps you are flagging on one of the other checks that are performed?
@roblapp @ferventcoder Received Pending Component Based Servicing = Flagged in 0.10.15.
Restart-Computer resolves this as well.
Most helpful comment
I've seen the same behavior. For CLI weenies:
Check if you've got a pending file rename interfering with your desired operation:
REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperationsIf you do, and you're _sure_ you know what you're doing:
REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v PendingFileRenameOperations /f