Over the last few days, I have been unable to update my jails using iocage.
I've managed to trace the problem down to a few lines of Python code in the ioc_fetch.py module:
When the above code is run more often than not, the temp file that is created does not contain the freebsd-update.sh shell script, but instead it's an HTML file that has something to do with Anubis (sample attached), which in turn crashes iocage.
It doesn't happen all the time, it's really hit and miss, but what's strange is that I can always download the file using curl.
I even wrote a Python script that uses the above code to download that shell script 100 times, and it also fails, but a similar shell script using curl to download the freebsd-update.sh file 100 times never fails.
I don't know where to report this problem.
It's definitely not a problem with iocage since I can duplicate the problem using a simple Python test script.
Is a problem with the urllib.request() method, or is it a problem with the cgit.FreeBSD.org host?
Since curl always works, it leads me to believe it's more of a problem with the urllib.request() method.
I have tested this on FreeBSD 14.4-p1 and 14.4-p4, and it occurs on both builds.
I have also tried using three different ISPs to rule out some kind of ISP caching issue.
I've managed to trace the problem down to a few lines of Python code in the ioc_fetch.py module:
Code:
f = "https://cgit.freebsd.org/src/plain" \
"/usr.sbin/freebsd-update/freebsd-update.sh"
tmp = tempfile.NamedTemporaryFile(delete=False)
with urllib.request.urlopen(f) as fbsd_update:
tmp.write(fbsd_update.read())
tmp.close()
os.chmod(tmp.name, 0o755)
fetch_name = tmp.name
When the above code is run more often than not, the temp file that is created does not contain the freebsd-update.sh shell script, but instead it's an HTML file that has something to do with Anubis (sample attached), which in turn crashes iocage.
It doesn't happen all the time, it's really hit and miss, but what's strange is that I can always download the file using curl.
I even wrote a Python script that uses the above code to download that shell script 100 times, and it also fails, but a similar shell script using curl to download the freebsd-update.sh file 100 times never fails.
I don't know where to report this problem.
It's definitely not a problem with iocage since I can duplicate the problem using a simple Python test script.
Is a problem with the urllib.request() method, or is it a problem with the cgit.FreeBSD.org host?
Since curl always works, it leads me to believe it's more of a problem with the urllib.request() method.
I have tested this on FreeBSD 14.4-p1 and 14.4-p4, and it occurs on both builds.
I have also tried using three different ISPs to rule out some kind of ISP caching issue.