autopkg / n8felton-recipes

Recipes for Autopkg
28 stars 35 forks source link

Download URL uses ftp:// schema, which fails on connect attempt #176

Closed mtconleyuk closed 1 year ago

mtconleyuk commented 1 year ago

The current download recipe uses the URL

ftp://ftp.hp.com/pub/softlib/software12/HP_Quick_Start/osx/Installations/Essentials/hp-printer-essentials-S-5_15_5_12.pkg

but this fails with the following error:-

URLDownloader: ERROR: (56) response reading failed

Traceback (most recent call last):
  File "/Library/AutoPkg/autopkglib/URLGetter.py", line 172, in execute_curl
    result = subprocess.run(
  File "/Library/AutoPkg/Python3/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/curl', '--silent', '--show-error', '--no-buffer', '--dump-header', '-', '--speed-time', '30', '--location', '--url', 'ftp://ftp.hp.com/pub/softlib/software12/HP_Quick_Start/osx/Installations/Essentials/hp-printer-essentials-S-5_15_5_12.pkg', '--fail', '--output', '/Users/admin/Library/AutoPkg/Cache/local.override.munki.HPPrinterDrivers/downloads/tmpfunljob0']' returned non-zero exit status 56.

Playing with the URL, I find that using http:// in place of ftp://, leaving everything else the same (including the ftp.hp.com address) results in a download. Suggest replacing schemas in the download recipe.

mtconleyuk commented 1 year ago

I notice that the download recipe calls a shared processor, HPSoftwareInfoProvider, which appears to send a query to HP's server to get the URL for the download. So probably HP's server is returning the wrong schema, which would not surprise me. But maybe the downloader could try http:// (and https:// ?) if ftp:// fails. Not sure what the best solution is here.

n8felton commented 1 year ago

This is likely fixed by #175, which I have to spend some time to review. I'll try and get to this soon.

mtconleyuk commented 1 year ago

Ah. Cool.

MLBZ521 commented 1 year ago

@n8felton I can confirm #175 works. I just left a comment in the PR with my results.

n8felton commented 1 year ago

This should be fixed in #175 but feel free to re-open if you're still experiencing issues.