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

Install-BoxstarterPackage gives incorrect result when host-reboot is pending and Wait-ForSessionToClose times out #583

Open
6 tasks done
mwallner opened this issue Nov 26, 2024 · 2 comments
Assignees
Labels
Bug Issues where something has happened which was not expected or intended
Milestone

Comments

@mwallner
Copy link
Member

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When installing a package remotely via Boxstarter and a reboot is triggered,- it will not wait for the reboot if the target host doesn't reboot within 2 minutes.
After the timeout of 120 seconds (see

function Wait-ForSessionToClose($session) {
) it will silently assume that the host has disconnect and try to reconnect.
The reconnect will succeed to a host that is still waiting for the reboot to happen. (i.e. when the reboot is being delayed by a locked file, windows update, volume defrag etc.)
Boxstarter will start the installation which will most likely fail due to the host rebooting at some point.

What is Expected?

When hitting a timeout during installation, the process should not continue without error/corresponding logging.
=> the timeout for reconnecting to a host should be a configurable setting (when dealing with certain environments where we cannot guarantee a reboot will be carried out in timely manner)

How Did You Get This To Happen?

Install any Boxstarter package on a target host that has a CBS reboot pending and won't restart within 2 minutes. (i.e. because a volume-defrag is running)

System Details

  • Operating System: Windows
  • Windows PowerShell version: 5
  • Chocolatey CLI Version: 2.2.2
  • Chocolatey Licensed Extension version: -
  • Chocolatey License type: -
  • Terminal/Emulator: remote / PowerShell ion conhost

Installed Packages

-

Output Log

-

Additional Context

No response

@mwallner mwallner added the Bug Issues where something has happened which was not expected or intended label Nov 26, 2024
@mwallner mwallner added this to the 3.1.0 milestone Nov 26, 2024
@mwallner mwallner self-assigned this Nov 26, 2024
@mwallner
Copy link
Member Author

Def. need to look at https://learn.microsoft.com/de-de/powershell/module/microsoft.powershell.core/about/about_remote_disconnected_sessions?view=powershell-5.1
=> check if SessionState / "opened" will be updated on every possible disconnect

@mwallner
Copy link
Member Author

might relate to #487

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues where something has happened which was not expected or intended
Projects
None yet
Development

No branches or pull requests

1 participant