X Tutup
The Wayback Machine - https://web.archive.org/web/20250505031429/https://github.com/PowerShell/PowerShell/issues/17558
Skip to content

pwsh 7.2.X is (often) stuck on launch #17558

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

Closed
5 tasks done
g-chauvel opened this issue Jun 22, 2022 · 12 comments
Closed
5 tasks done

pwsh 7.2.X is (often) stuck on launch #17558

g-chauvel opened this issue Jun 22, 2022 · 12 comments
Labels
Needs-Repro The issue author needs to provide repro steps. WG-Interactive-Console the console experience

Comments

@g-chauvel
Copy link

Prerequisites

Steps to reproduce

for ($i = 1; $i -lt 50; $i++) {
  C:\PowerShell-7.x.x-win-x64\pwsh.exe --version
}

Expected behavior

pwsh 7.1.7           is printed 50 times
pwsh 7.2.5           is printed 50 times
pwsh 7.3.0-preview.4 is printed 50 times

Actual behavior

pwsh 7.1.7           is printed 50 times
pwsh 7.2.5           is stuck after a few prints
pwsh 7.3.0-preview.4 is printed 50 times

Error details

Tests are executed on the same system, various versions are installed from "***-win-x64.zip" assests
All 7.2 releases produce this behavior: 7.2.0 to 7.2.5

executing with $env:COREHOST_TRACE=1 doesn't show any errors, only the 4 last lines are not printed.
When it works those 4 lines are:
PowerShell 7.2.5
Execute managed assembly exit code: 0x0
Waiting for breadcrumb thread to exit...
Done waiting for breadcrumb thread to exit...

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.7
PSEdition                      Core
GitCommitId                    7.1.7
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@g-chauvel g-chauvel added the Needs-Triage The issue is new and needs to be triaged by a work group. label Jun 22, 2022
@PaulHigin PaulHigin added the WG-Interactive-Console the console experience label Jun 27, 2022
@anmenaga
Copy link

I've ran 50k iterations on 7.2.5 without repro.
@g-chauvel what is the repro machine specs? Is it under high load from some other processes when the PS hang happens?

@g-chauvel
Copy link
Author

g-chauvel commented Sep 8, 2022

@anmenaga corporate managed PCs with monitoring services and antivirus. Happens at least on 2 different hardware with the same software environment, idle state.

@iSazonov
Copy link
Collaborator

iSazonov commented Sep 9, 2022

@g-chauvel Have the PCs Internet connect? If no please try to disable new PowerShell version check and telemetry.

@g-chauvel
Copy link
Author

@iSazonov
I tried with

$env:POWERSHELL_CLI_TELEMETRY_OPTOUT=1
$env:POWERSHELL_TELEMETRY_OPTOUT=1
$env:POWERSHELL_UPDATECHECK="Off"
$env:POWERSHELL_UPDATECHECK_OPTOUT=1
$env:DOTNET_CLI_TELEMETRY_OPTOUT=1
$env:DOTNET_TELEMETRY_OPTOUT=1
$env:COMPlus_EnableDiagnostics=0

same behavior

@chrisc96
Copy link

chrisc96 commented Oct 25, 2022

For anyone else out there, we experienced similar issues but on Linux instead of Windows.

We built a private docker image with pwsh 7.2.6 installed. On our nonprod servers the image worked perfectly fine. When we executed 'pwsh' it showed the version and produced a powershell prompt. On our production server when we ran 'pwsh' it just hung indefinitely.

This gave us the hint it wasn't really to do with the image itself and more to do with the software running on the servers themselves. Problem was, there was no logs to help us identify what it was.

Just for debugging purposes we tried the public powershell images too. 'mcr.microsoft.com/powershell:7.2.2-ubuntu-18.04' hung indefinitely on the production server but pwsh executed fine on nonprod server. 'mcr.microsoft.com/powershell:7.1.0-ubuntu-18.04' worked perfectly fine on both environments. The same behaviour was found on images based off of alpine too.

When trying 'mcr.microsoft.com/powershell:7.3.0-preview.3-ubuntu-18.04' we actually found our issue... We had an error relating to 'Dynatrace OneAgent' which injects itself into Docker containers as part of its monitoring. We had already thought of this and disabled the software but seemingly this wasn't enough.... when we removed that package from the production server, our image with pwsh 7.2.6 (and others) all worked in production again.

So for us, the issue was Dynatrace. The version of dynatrace we were running in prod was different to nonprod and this was causing the issues.

@TuxTom
Copy link

TuxTom commented Nov 15, 2022

I have the same problem with pwsh 7.2.x. Interestingly, it does not happen with any 7.3-preview/rc, but happens again with 7.3.0. Yet, with 7.3.0 it seems to occur less often than with older releases.

My setup is similar to the one of g-chauvel: corporate managed machine with antivirus (that I cannot disable for testing). No DynaTrace OneAgent here, but other monitoring SW.

@theJasonHelmick theJasonHelmick added Needs-Repro The issue author needs to provide repro steps. and removed Needs-Triage The issue is new and needs to be triaged by a work group. labels Jan 4, 2023
@theJasonHelmick
Copy link
Collaborator

theJasonHelmick commented Jan 4, 2023

@g-chauvel - Thank you for reporting this issue. The working group is unable to repro this problem - as @anmenaga reported. In order to progress, the Working Group needs more information about the process, you may be able to collect the needed logs using Dotnet-dump. Contact https://support.microsoft.com/en-US for more assistance.

Microsoft support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft 365, Windows, Surface, and more.

@reserschnell
Copy link

Hi, I have the same issue on a corporate managed Windows 10 machine. Powershell 7.3.8 and Powershell 7.3.7 stucks infinite on launch. But 7.3.7 was running in the past. I don't know what changed.
If I have some spare time I will contact the support. But it would be much faster if someone can shortly show how to use dotnet-dump to collect the logs...

@xiefucai
Copy link

xiefucai commented Mar 19, 2024

@theJasonHelmick
I encountered the same issue on my side, when I mount samba address to my windows as a virtual driver, the pwsh always attempt to perform the InitializeDefaultDrives operation on the 'FileSystem' provider when I launch a new pwsh tab or window, it will stuck and have nothing notice, until I stop and unmount the virtual dirvers, it will throw a Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed. failed message.

If anyone whom encounter the same issue, maybe cause by the same scene with me.

@theJasonHelmick
Copy link
Collaborator

theJasonHelmick commented Mar 27, 2024

@g-chauvel - Thank you for this issue. We ran tests on 7.2.18, 7.3.11, 7.4.1, 7.5-preview 2 and were not able to reproduce on these current versions. If you wish to troubleshoot further and provide information using botnet dump, here are the docs to help: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-dump

Learn how to install and use the dotnet-dump CLI tool to collect and analyze Windows and Linux dumps without any native debugger.

@g-chauvel
Copy link
Author

The environnement where pwsh.exe is executed has changed since 2022.
I no longer face this problem : different antivirus, some monitoring services are no longer running, not the same Windows version/build, group policies, etc...

7.2.19 is not stuck. I bet 7.2.0 to 7.2.5 also aren't.

Copy link
Contributor

microsoft-github-policy-service bot commented Apr 12, 2024

📣 Hey @g-chauvel, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Repro The issue author needs to provide repro steps. WG-Interactive-Console the console experience
Projects
None yet
Development

No branches or pull requests

9 participants
X Tutup