munki / macadmin-scripts

Scripts of possible interest to macOS admins
Other
2.33k stars 523 forks source link

Error on download #124

Open Tb3986 opened 11 months ago

Tb3986 commented 11 months ago

Hello, when i'm trying to download a OS, the script stop to works at all with this error: Could not replicate https://swcdn.apple.com/content/downloads/24/37/052-09398-A_DIKZGBNOM0/y4rz9dued01dtyl65nxqgd08wj2ar5cr6v/InstallAssistant.pkg: Command '['/usr/bin/curl', '-fL', '--create-dirs', '-o', './content/downloads/24/37/052-09398-A_DIKZGBNOM0/y4rz9dued01dtyl65nxqgd08wj2ar5cr6v/InstallAssistant.pkg', '-w', '%{http_code}', '--compressed', 'https://swcdn.apple.com/content/downloads/24/37/052-09398-A_DIKZGBNOM0/y4rz9dued01dtyl65nxqgd08wj2ar5cr6v/InstallAssistant.pkg']' returned non-zero exit status 18.

Error

I tried on 2 mac, same issue even with another OS like ventura ecc ecc.

Thanks

gregneagle commented 11 months ago

This is almost certainly a local issue. Something is interrupting the transfer of "InstallAssistant.pkg", which is a very very large file. You may be able to replicate it outside of this tool with curl (and the error message shows you how):

/usr/bin/curl -fL --create-dirs \
-o './content/downloads/24/37/052-09398-A_DIKZGBNOM0/y4rz9dued01dtyl65nxqgd08wj2ar5cr6v/InstallAssistant.pkg' \
-w '%{http_code}' --compressed \
'https://swcdn.apple.com/content/downloads/24/37/052-09398-A_DIKZGBNOM0/y4rz9dued01dtyl65nxqgd08wj2ar5cr6v/InstallAssistant.pkg'
gregneagle commented 11 months ago

I think this is a bigger issue than I first thought, but I still don't think it's has anything to do with the code in installinstallmacos.py.

I tried the above curl download command seven times in a row. The fourth attempt was successful, the other six timed out with various amounts left to read. This feels like an Apple change or Apple issue.

gregneagle commented 11 months ago

On the #mist channel on MacAdmins Slack, there are reports of similar issues.

jeremy0519 commented 1 month ago

You can add the following args to curl command: '-k','--http1.1','--tlsv1.2' It works for me.