You are not logged in.

#1 2014-07-28 03:55:10

jernst
Member
From: Silicon Valley
Registered: 2014-03-04
Posts: 290
Website

pacman: "failed retrieving file ... Maximum file size exceeded"

I don't seem to be the first person who has run into a variation of this.

> pacman -S xyz
...
Total Download Size:    0.10 MiB
Total Installed Size:   0.43 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages ...
error: failed retrieving file 'xyz-0.47-1-any.pkg.tar.xz' from disk : Maximum file size exceeded-------------------------------------------]   0%

Interrupt signal received

Running it with pacman -debug it appears that pacman tells curl:

debug: maxsize: 106196

while the file to be downloaded is actually 106216 bytes long. (pacman.conf points to a local directory, so I'm rather certain about that)

This would explain the strange and otherwise incomprehensible error message.

Q1: Where does pacman get the incorrect size from?

Then, after pacman has bailed out, an incomplete file

/var/cache/pacman/pkg/xyz-0.47-1-any.pkg.tar.xz.part

has appeared, which creates a secondary error. Invoking the same pacman -S command again, we get:

Total Installed Size:   0.43 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                [#######################################################] 100%
(1/1) checking package integrity                                                              [#######################################################] 100%
error: failed to commit transaction (wrong or NULL argument passed)
Errors occurred, no packages were upgraded.

which is just as incomprehensible.

Q2: why does pacman leave that partial file around? (I don't think it is useful for anything particular and it certainly gets in the way.) And is there a better error message, perhaps?

My suspicion is that this set of conditions can occur when the package database and the actual package files are out of sync. E.g. if the package was rebuilt, and re-rsync'd to a repository, but the database file was not updated. Or the other way around.

Update:  yep, the incorrect file size comes from the package database file. It has a %CSIZE% of 106196 in the 'desc' file for that package.

Which leaves me with:

Q3: Is there a way to have pacman detect inconsistency between package files and the package database, and report it before major puzzlement and downloading of source code needs to occur? :-)

Update: I created a tool called 'pacsane' to detect this, and uploaded it to AUR, in the hope that it may be useful:

https://aur.archlinux.org/packages/pacsane/

pacsane foobar.db.tar.xz

will check consistency between package database foobar.db.tar.xz and the package files in the same directory. It does this by looking into the various metadata attributes in the package database, and in the package files themselves. It reports whatever problems it finds. While it is at it, it can also print out the list of package files that are in that directory but aren't referenced by the package database.

Last edited by jernst (2014-07-28 23:02:08)

Offline

Board footer

Powered by FluxBB