Solved ezjail-admin update -u fetching files failed

Hello,

I cannot manage to update my jails with ezjail-admin -u for a few days:

This is the output I get:

Code:
# ezjail-admin update -u
Looking up update.FreeBSD.org mirrors... 5 mirrors found.
Fetching metadata signature for 10.1-RELEASE from update5.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

The following files will be added as part of updating to 10.1-RELEASE-p6:
/usr/src/crypto/openssl/util/mkbuildinf.pl
Installing updates...install: /usr/jails/basejail//usr/src/crypto/openssl/util/mkbuildinf.pl: No such file or directory
 done.
Looking up update.FreeBSD.org mirrors... 5 mirrors found.
Fetching metadata signature for 10.1-RELEASE from update4.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 370 files... gunzip: (stdin): unexpected end of file
2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac has incorrect hash.


I do not have any issue with freebsd-update on the same host...
Did I miss something or it is a bug ? (I get this error for a few days)

Thanks
 
sysutils/ezjail's script ezjail-admin calls freebsd-update(8) using the -b flag to act on the base jail's directory (looking at line 1009 in the ezjail-admin source code).

The error you're seeing is from the freebsd-update(8) script's call to gzip(1) on line 1714 of the freebsd-update source code. Looking at how the script works, it caches patch files so it doesn't have to fetch them again. I suspect what happened was that on one of your runs, fetch only grabbed part of one of the files but that partial file still exists. freebsd-update(8) is seeing that the named file already exists so isn't downloading it again. However, when it tries to decompress that file, it fails and then the hash doesn't match.

You could try to track down exactly which file is causing the issue. However, unless bandwidth is a problem for you, it will be quicker to clean out the cached files and download them again. Unless you or sysutils/ezjail set it to something different, I would expect those cached files to be in the base jail's /var/db/freebsd-update/files directory. Assuming you used ezjail's defaults, running rm /usr/jails/basejail/var/db/freebsd-update/files/* && ezjail-admin update -u should work.
 
Hello,

/usr/jails/basejail/var does not exist, but I found the suspect file:

Code:
# find / -name '2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac*'
/var/db/freebsd-update/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz
# rm /var/db/freebsd-update/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz
# ezjail-admin update -u
Looking up update.FreeBSD.org mirrors... 5 mirrors found.
Fetching metadata signature for 10.1-RELEASE from update5.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.

The following files will be added as part of updating to 10.1-RELEASE-p6:
/usr/src/crypto/openssl/util/mkbuildinf.pl
Installing updates...install: /usr/jails/basejail//usr/src/crypto/openssl/util/mkbuildinf.pl: No such file or directory
done.
Looking up update.FreeBSD.org mirrors... 5 mirrors found.
Fetching metadata signature for 10.1-RELEASE from update5.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 370 files... gunzip: (stdin): unexpected end of file
2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac has incorrect hash.

Seeing this I suppose the file is fully downloaded but it seems to be corrupted...
Thank you for your help.

Edit: I also tried rm /var/db/freebsd-update/files/* but same result except more files to fetch of course...
 
/usr/jails/basejail/var does not exist
Oops. If I had thought about it I would have realised that before I posted since ezjail has a unique /var for each jail; it's where it stashes puts the ports directory.

but I found the suspect file
[...]
I also tried rm /var/db/freebsd-update/files/* but same result except more files to fetch of course...
Great - you found the cause of the issue. :) Have you checked that you get the same error message (unexpected end of file) when trying to unzip the file by hand? You could try fetching the file yourself from another mirror (perhaps http://update4.freebsd.org/10.1-RELEASE/amd64/f/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz) to check it's not just that mirror that has a bad copy of the file.

I had a quick look at the the problem reports on FreeBSD's Bugzilla but couldn't see the same issue already reported. If it's still not working you could check yourself and then file a new problem report.
 
The following files will be added as part of updating to 10.1-RELEASE-p6: /usr/src/crypto/openssl/util/mkbuildinf.pl Installing updates...install: /usr/jails/basejail//usr/src/crypto/openssl/util/mkbuildinf.pl: No such file or directory done.
I for sure do not fully understand what is happening since I’ve never used jails, but are you using freebsd-update(8) to also update the /usr/src folder? It does not seem so. If it is the case, deleting src from the Components line in /etc/freebsd-update.conf could help (if this file ever applies to jails).
 
Thank you all,

I did not install /usr/src

The problem is still here for me, so I guess the issue is somewhere on my machine.

I tried this:

Code:
# gunzip /var/db/freebsd-update/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz
gunzip: /var/db/freebsd-update/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz: unexpected end of file
gunzip: /var/db/freebsd-update/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz: uncompress failed

Which is not surprising:

Code:
# fetch http://update2.freebsd.org/10.1-RELEASE/amd64/f/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz
2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67 99% of  300 kB  212 kBps 00m01s
fetch: http://update2.freebsd.org/10.1-RELEASE/amd64/f/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz: Connection reset by peer
# fetch http://update3.freebsd.org/10.1-RELEASE/amd64/f/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz
2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67 99% of  300 kB  419 kBps 00m01s
fetch: http://update3.freebsd.org/10.1-RELEASE/amd64/f/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz: Connection reset by peer
# fetch http://update4.freebsd.org/10.1-RELEASE/amd64/f/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz
2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67 99% of  300 kB  130 kBps 00m02s
fetch: http://update4.freebsd.org/10.1-RELEASE/amd64/f/2ba689655d33a0d7eebef5c3ddb06a52fbd56343cd9f67aa4a9f62541f7db7ac.gz: Connection reset by peer

I dont understand why the file failed to be downloaded from my host… The result is the same with pfctl -d.

I also tried to download the file from my OS X but my browser waits forever, then I tried to download another file from http://update2.freebsd.org/10.1-RELEASE/amd64/f/ and it succeeded…

I don't see any alarm on my main firewall, am I the only one that fail to download this file ?
 
I'm able to download that file just fine from all three mirrors from both my laptop over wireless and NAS (both FreeBSD). Can you download the file successfully on your firewall and are you seeing any kind of errors on your firewall? If you are seeing two clients on your network running different OS's having errors download the file then your firewall or ISP may be at fault.
 
Ok, thanks, problem solved, my firewall antivirus dislikes this particular file for some reason…
 
Back
Top