C
C#โ€ข2y ago
Jaex

โ” Why could NuGet restore randomly timeout inside GitHub Actions?

So frequently nuget restore timeout inside GitHub Actions for months and I can't figure out what could be the reason for this. Is it could be because multiple GitHub Actions jobs trying to restore in same time and NuGet servers thinking it is spam and blocking it? build.yml: https://github.com/ShareX/ShareX/blob/develop/.github/workflows/build.yml#L72 failed workflow: https://github.com/ShareX/ShareX/actions/runs/4933908932/jobs/8818333221 Also I'm open to advices about how to retry GitHub Actions job when it fails once.
96 Replies
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
problem is because it happens randomly, even if i enable verbose logging, unfortunately we won't be able to reproduce the error immediately
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
but i have feeling that nuget servers just don't respond at all and then it timeouts
Jaex
JaexOPโ€ข2y ago
hm which one i should select gonna try -v d
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
normally it takes around 1 minute to restore so I still have doubts about it timeouts because it takes too long to restore people restore very huge files which would take long time i still think it timeout because 5 jobs in same time trying to restore and nuget servers spam protection stops responding to one of them then it timeout after that
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
i will ofc add logs but we won't be able to get results for some time ๐Ÿ˜„ i will let you know when timeout happens again we didn't had to wait too long it happened in first commit lol
Jaex
JaexOPโ€ข2y ago
GitHub
Added -Verbosity detailed ยท ShareX/ShareX@9873022
ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of f...
Jaex
JaexOPโ€ข2y ago
NuGet.Commands.CommandException: MsBuild timeout out while trying to get project to project references.
time to Google it
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
i still cannot find solution on Google
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
weirdly it is happens so frequently
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
i think it started to happen after i added 5. job thats why i felt like it is spam protection all 5 jobs could be sharing same ip and when all do restore in same time nuget servers could be thinking it is spam
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
yea i wonder can i find someone from nuget team in this server to ask ๐Ÿ˜‚
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
i dont think so
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
i did not manually create lockfile and dunno what it is
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
btw i was thinking what if i use "powershell try catch" to try restore again, would it work?
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
doing one more restore at catch i mean
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
but i would prefer to solve the main issue because this delays builds 2 minutes+
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
-Project2ProjectTimeOut

Timeout in seconds for resolving project-to-project references.
-Project2ProjectTimeOut

Timeout in seconds for resolving project-to-project references.
I can try increasing this and see is it still timeout
nuget restore "${{ env.SOLUTION_FILE_PATH }}" -Project2ProjectTimeOut 300000 -Verbosity detailed
nuget restore "${{ env.SOLUTION_FILE_PATH }}" -Project2ProjectTimeOut 300000 -Verbosity detailed
5 mins timeout
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
waait is it seconds i used ms
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
MSBuild P2P timeout [ms]: 300000000 lol
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
yea logs mislead me
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
i dont think it can use same location on disk but how ip can be same is i dunno
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
one job currently stuck in nuget restore btw
Jaex
JaexOPโ€ข2y ago
why github actions logs don't have timestamp blobthinking had them when you hovered line number
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
jesus it took 5 minutes to complete
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
so my theory of spam protection is invalidated
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
GitHub
Added -Project2ProjectTimeOut 300000 ยท ShareX/ShareX@3b88f13
ShareX is a free and open source program that lets you capture or record any area of your screen and share it with a single press of a key. It also allows uploading images, text or other types of f...
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
you can see the full logs right? when i open the page in browser incognito mode i cant see the logs
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
but probably requires login
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
nuget docs said detailed is max for nuget restore dotnet restore had higher level but dunno would that arg work for nuget restore
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
i saw it right before see your ss ๐Ÿ˜‚ i assumed it would be available when hovered with cursor like in appveyor
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
MonkaChrist github machines rubbish
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
or nuget servers rubbish difficult to know
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
it is pretty small
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
i dont even know what that command does
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
-Verbosity [normal|quiet|detailed] are you sure thats usable in nuget cli because what you are looking at is dotnet restore cli
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
thank you
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
you helped to diagnose a lot ๐Ÿ˜‚ i was more clueless before now i'm closer
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
gerard
gerardโ€ข2y ago
Maybe the problem is signature verification? It seems like it's a Windows thing: https://github.com/NuGet/Home/issues/11548 You can disable it with a env-variable:
Important: setting NUGET_CERT_REVOCATION_MODE to offline indeed improves restore times substantially (down to 1m 22s in this case). https://github.com/StackExchange/StackExchange.Redis/pull/1973/commits/275f5756cbc526df7e3bff8a82dac6dd52f2186d
GitHub
[Bug]: Slow Restores on Windows in GitHub Actions - Signature verif...
NuGet Product Used dotnet.exe Product Version 6.0.101 Repro Steps & Context Running an identical restore in GitHub Actions, times are dramatically higher on Windows agents (2019 and 2022 tested...
gerard
gerardโ€ข2y ago
If it's still slow, maybe you can try Windows Server 2019 (windows-2019) because windows-2022 used to be much slower. I don't know if this is still the case: https://github.com/actions/runner-images/issues/5166
GitHub
Windows Server 2022 builds are taking 4x longer than on Windows Ser...
Description Over the last 2 weeks I've noticed runs on the windows-2022 image taking 4x longer, and sometimes more than that, than on the windows-2019 image. In all of these instances nothing&#...
Accord
Accordโ€ข2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Jaex
JaexOPโ€ข2y ago
https://github.com/actions/cache/blob/main/examples.md#c---nuget I'm checking this now created empty packages.lock.json files which populated on first compile i wish i could use it in parent solution folder tho instead of each project folder
Jaex
JaexOPโ€ข2y ago
https://github.com/ShareX/ShareX/actions/caches they did not put download button so can't verify cache content notlikeblob
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
am i need to use another parameter for nuget to restore from cache https://github.com/ShareX/ShareX/blob/develop/.github/workflows/build.yml#L70
- name: NuGet Restore
if: steps.cache.outputs.cache-hit != 'true'
run: nuget restore MyProject.sln
- name: NuGet Restore
if: steps.cache.outputs.cache-hit != 'true'
run: nuget restore MyProject.sln
let me try this
Jaex
JaexOPโ€ข2y ago
@TeBeClone did you cache nuget packages before?
Unknown User
Unknown Userโ€ข2y ago
Message Not Public
Sign In & Join Server To View
Jaex
JaexOPโ€ข2y ago
chatgpt couldn't help too ๐Ÿ˜‚ https://jaex.getsharex.com/2023/05/61KmjXWflu.png
Jaex
JaexOPโ€ข2y ago
it shows what i already did i wonder is this path wrong for Windows: path: ~/.nuget/packages but if it were wrong then cache would be empty https://github.com/ShareX/ShareX/actions/caches 34 MB there i have suspicion now that nuget actually using cache correctly but still "GenerateRestoreGraphFile" part takes all that time
Accord
Accordโ€ข2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server