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

Reboot - Pending File Rename Operations check returns true, even after reboot #1768

Closed
astatine opened this issue Mar 17, 2019 · 32 comments
Closed

Comments

@astatine
Copy link

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.

@ferventcoder
Copy link
Member

ferventcoder commented Mar 17, 2019

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

@ferventcoder
Copy link
Member

@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.

@ferventcoder
Copy link
Member

@astatine out of curiosity - which template did you choose? I don't see any of what we normally see with an issue/bug report.

@astatine
Copy link
Author

@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.

@ferventcoder
Copy link
Member

- Pending File Rename Operations = Flagged

This is the one - @pauby is that the one you were seeing as well?

@pauby
Copy link
Member

pauby commented Mar 17, 2019

@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).

@ferventcoder
Copy link
Member

@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.

@Megasware128
Copy link

Megasware128 commented Mar 21, 2019

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.`

@Megasware128
Copy link

Also in my case the Pending File Rename Operations is flagged

@ferventcoder
Copy link
Member

@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.

@ferventcoder ferventcoder added this to the 0.10.14 milestone Mar 22, 2019
@teknowledgist
Copy link

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.

@bazzilic
Copy link

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?

@teknowledgist
Copy link

@bazzilic I do not.

@teknowledgist
Copy link

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.

@stevehipwell
Copy link

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.

@ferventcoder ferventcoder changed the title Persistent 'pending system reboot request has been detected' even after reboots Persistent 'pending system reboot request has been detected' even after reboots on "Pending File Rename Operations = Flagged" Mar 22, 2019
@ferventcoder
Copy link
Member

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.

@ferventcoder
Copy link
Member

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).

@bcurran3
Copy link

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.

@pHr34kY
Copy link

pHr34kY commented Mar 25, 2019

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).

@capsalad
Copy link

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

@ferventcoder ferventcoder changed the title Persistent 'pending system reboot request has been detected' even after reboots on "Pending File Rename Operations = Flagged" reboot - Persistent 'pending system reboot request has been detected' even after reboots on "Pending File Rename Operations = Flagged" Mar 27, 2019
@ferventcoder ferventcoder changed the title reboot - Persistent 'pending system reboot request has been detected' even after reboots on "Pending File Rename Operations = Flagged" Reboot - Persistent 'pending system reboot request has been detected' even after reboots on "Pending File Rename Operations = Flagged" Mar 27, 2019
gep13 added a commit that referenced this issue Mar 27, 2019
In some scenarios, this check was causing Chocolatey to always report
that the system was in a pending reboot state. Even after a reboot
Chocolatey would still report that it was still pending a reboot.  After
discussion, it was determined that this check has a history of causing
problems, and as a result, the decision was made to remove it.  It will
still do the check, which will now only show up in the debug log, but
this check will no longer go into the overall pending reboot check.
gep13 added a commit that referenced this issue Mar 27, 2019
* issue-1768:
  (GH-1768) Ignore file rename operations check
gep13 added a commit that referenced this issue Mar 27, 2019
* stable:
  (GH-1768) Ignore file rename operations check
@gep13
Copy link
Member

gep13 commented Mar 27, 2019

This has been committed into the stable branch, and will be released as part of 0.10.14.

@gep13 gep13 closed this as completed Mar 27, 2019
@gep13 gep13 changed the title Reboot - Persistent 'pending system reboot request has been detected' even after reboots on "Pending File Rename Operations = Flagged" Reboot - Pending File Rename Operations check always present, even after reboot Mar 27, 2019
@gep13 gep13 changed the title Reboot - Pending File Rename Operations check always present, even after reboot Reboot - Pending File Rename Operations check returns true, even after reboot Mar 27, 2019
@jihoonerd
Copy link

jihoonerd commented May 2, 2019

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.

@ferventcoder
Copy link
Member

@jihoonerd I am not sure what you are saying here. You installed the beta and it is still flagging?

@jihoonerd
Copy link

jihoonerd commented May 3, 2019

@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.

@jansohn
Copy link

jansohn commented May 4, 2019

It seems there are remaining issues in 0.10.14 milestone. Before 0.10.14 release, executing

> Restart-Computer

in PowerShell suppressed the Validation Warning for 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.

@neolee
Copy link

neolee commented May 13, 2019

It seems there are remaining issues in 0.10.14 milestone. Before 0.10.14 release, executing

> Restart-Computer

in PowerShell suppressed the Validation Warning for 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.14 milestone. Before 0.10.14 release, executing

> Restart-Computer

in PowerShell suppresses the Validation Warning for 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.

@ghost
Copy link

ghost commented Aug 28, 2019

I'm experiencing this on 0.10.15.

@AdmiringWorm
Copy link
Member

@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.

@roblapp
Copy link

roblapp commented Oct 7, 2020

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.

@ferventcoder
Copy link
Member

@roblapp howdy! I'm not sure how you see it in 0.10.15 - we ignore the check completely (ba523b4). Perhaps you are flagging on one of the other checks that are performed?

@ESimmonds
Copy link

@roblapp @ferventcoder Received Pending Component Based Servicing = Flagged in 0.10.15.

Restart-Computer resolves this as well.

@ssg-randy-knight
Copy link

I'm seeing this in 0.10.15 as well. About to try the Restart-Computer solution but if that works I am wondring if this could be Fast Startup related? Where a restart is not really a restart? FYI I have no PendingFileRenames when I see the issue.

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

No branches or pull requests