Paket 'hangs' without any output for several minutes
Description
Started a build in VS 2017 (net sdk integration):
1>Build started 2018-11-08 10:47:19.
1>Target PaketRestore:
1> Paket version 5.181.1
// after some minutes
1> Starting full restore process.
1> Performance:
1> - Disk IO: 191 milliseconds
1> - Runtime: 3 minutes, 17 second
Repro steps
Not clear but there shouldn't be too many places in the code which can be responsible before Starting full restore process and after printing the version.
This seems to happen when VSCode + Visual Studio 2017 is open and I add a new package with paket install and "rightclick -> build" in Visual Studio (I guess VSCode or VS is doing some paket commands behind the scenes)
Expected behavior
I feel like paket is waiting for another process to exit and should tell me that. Even better would be to just work faster ;)
Actual behavior
Nothing
Known workarounds
Wait
@matthid any chance you could have a look at it with Process Explorer, and see if any dotnet processes hangs with "dotnet paket --version"? I've seen that quite a few times. Anyways, was just if it could narrow it down.
I see this a few times a day. Just looking at one now that has been running for 12minutes at 2.5% (on an 8 core machine). I fired up procmon, but there is no visible activity for the hanging process. I then looked at the threads in process explorer, there was only one, and it immediately woke up (which boggles my mind somewhat, correlation not causation (?)). I'm also seeing the createAppHost issue, which I can normally work my way thru by multiple incremental build swapping between Visual Studio and the command line (using dotnet build)
We have somewhat same problem here. All stuff is done and paket.exe simply not returns. But there seems to be no activity.
I attached 2 screenshots here:
- Console output of our
build.cmdscript (a simple batch file startingpaket.exe restore) --> Screenshot1: ConsoleOutput.png - Sysinternals Process Monitor Screenshot of
paket.exeprocess --> Screenshot2: ProcessMonitor.png
After the CloseFile() (Screenshot2) nothing happens, but paket.exe in our script not returns (Screenshot1).
Additional informations:
- It doesn´t matter if
paket.exeis started fromcmd.exe,PowerShell, or the newWindows Terminal. - It doesn´t matter if
paket.exe restoreneeds to restore or not (in Screenshot1 all packages were up2date).
Used environment:
- Output of
paket.exe --version: Paket version 7.2.1+8e4eb74b42fbd45f39f7afce9184c16ebb65f16c - Windows 11 Pro Version 22H2 Build 22621.1848
- Visual Studio 2022 Version 17.6.3 (but doesn´t matter here)
We are a big company (but using my personal GitHub account here), developing and maintaining 1 giant .NET enterprise software product and we use paket.exe since years now. And this is a non-critical (but annoying) problem we have, since quite a while. The paket.exe does what it should (restore packages) and all is fine. The paket.exe simply not returns. We "fixed"it, by using a self-written tool, that scans for a paket.exe process and, if found, kills the process, so our script can continue then. But that´s more of a band aid patch than a solution. 😉
Any help is very appreciated!
Best regards
Nothing? Not some tip or any comment? 😞 Maybe it´s better when i open a new issue?
🤖 This is an automated response from Repo Assist.
I looked into this thread and the code paths around process exit / restore completion (Program.fs, ProcessHelper.fs). I don't see an obvious root cause in current code — no lingering timers, unclosed file handles, or blocking waits after the final logged "CloseFile()" step described by reporters, and paket.exe's own main() does not spawn background threads or async work that could keep the process alive after handleCommand returns.
Given:
- Reports span many years (2018–2023) and multiple unrelated environments (VS2017, VS2022, plain CLI), suggesting this is likely an OS/antivirus/file-handle-release quirk external to Paket itself (similar root cause pattern to the McAfee
.lockedfile issue fixed in #3535/commit c0bcc69f1), rather than a single reproducible Paket bug. - No maintainer or reporter has isolated a specific stack/handle keeping the process alive.
- The issue lacks a minimal, deterministic repro that a fix could target.
I don't have enough to implement a confident fix. If anyone can capture a stack trace/dump of a hung paket.exe process (e.g., via dotnet-dump or WinDbg) while it's stuck, that would let us pinpoint the blocking call. Otherwise, given the age and diffuse nature of these reports, this may be best tracked as needs investigation (already applied) pending a concrete repro.
Generated by 🌈 Repo Assist, see workflow run. Learn more. Comment /repo-assist to run again
Add this agentic workflow to your repo
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38