Fails to download package in Mageia 2

Bug #1036679 reported by fraterlinux
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Smart Package Manager
New
Undecided
Unassigned

Bug Description

I have compiled Smart 1.4.1 from source for Mandriva smart-1.4.1-3.src.rpm in Mageia Linux 2, kernel 3.4.6, Python 2.7.3, and fails to download package. The same error appears if you try to install new package with the command line or GUI. It is downloading the same file to install all available mirrors in a loop and does not install. When I delete the mirrors it presents the following error:
Failed to download packages: ftp://ftp.blogdrake.net/mageia/mageia2/free/x86_64/pdfchain-0.123-1bdk.mga2.x86_64.rpm: unexpected Size (expected 197795, got 197811)
Any new package that try to install displays this error: unexpected Size!!!

Revision history for this message
Malo Deniélou (malo) wrote :

I can confirm the same bug on Mageia. There is a problem with the way size is computed. How can we help debug that problem?
Thanks.

Revision history for this message
fraterlinux (frateraec) wrote :

I tested from source: smart-1.4.1.tar.bz2, smart-1.4.tar.bz2 and smart-1.3.1.tar.bz2. Only version 1.3.1 worked. This (unexpected Size) error with URPMI repository came from version 1.4!
Thanks.

Revision history for this message
Pascal Terjan (pterjan42) wrote :

The synthesis lists a filesize of 197795 which is incorrect.
Probably the code is now checking it...

Revision history for this message
Pascal Terjan (pterjan42) wrote :

For reference, the fix in genhdlist2 is http://svnweb.mageia.org/soft?view=revision&revision=3111

Revision history for this message
fraterlinux (frateraec) wrote :

If Smart code now checks the size of the file and compares it with the downloaded must be added an option to not be checked the size of the file.

Revision history for this message
Anders F Björklund (afb) wrote :

197811 looks like the correct size, seems like the synthesis has the wrong @filesize@ markup.

Probably due to a previous get_filesize bug introduced in perl-URPM not being properly fixed.

Revision history for this message
fraterlinux (frateraec) wrote :

Already exists option to not give the size of the downloaded file and I can upgrade to version 1.4.1?

Revision history for this message
Anders F Björklund (afb) wrote :

You can remove the implementation of the size in the code, but there is no way to disable it through configuration.

    def getSize(self, url):
        return self._info.get("filesize")

Seems like perl-URPM is still using "RPMTAG_SIGSIZE + 440" as the .rpm size, which doesn't return the right answer.

Revision history for this message
Anders F Björklund (afb) wrote :

Attaching a small program to display the difference in rpm size: file/urpm.
Whether or not they differ, depends on the .rpm (number of headers, etc)

Revision history for this message
fraterlinux (frateraec) wrote :

I commented the lines below to test. works, but doesn't show the size to be downloaded :-(

 def getSize(self, url):
        return self._info.get("filesize")

It would be better to remove the checking between the file size and the size reported.

Revision history for this message
Anders F Björklund (afb) wrote :

Or fix the generation of the synthesis metadata, so that it actually matches the rpm packages ?

Fedora had a similar issue with yum generating the wrong data, that lasted for a few releases...

Revision history for this message
fraterlinux (frateraec) wrote :

This is the correct and Mageia will fix this problem . For now you could collaborate with a hint of change in the code for the divergence of size does not block the installation?

Revision history for this message
Anders F Björklund (afb) wrote :

You could remove all file size checks in the the fetcher, but it would be better to fix the metadata...
The real fix seems to be in r3019 rather than r3111, but perl-URPM still has the buggy get_filesize.

Another approach would be to stop using synthesis, and provide repodata for the packages instead.
https://bugs.mageia.org/show_bug.cgi?id=2157

Revision history for this message
fraterlinux (frateraec) wrote :

I looked at the file fetcher.py in these lines:

            size = item.getInfo(uncompprefix+"size")
            if size:
                lsize = os.path.getsize(localpath)
                if lsize != (size):
                    raise Error, _("Unexpected size (expected %d, got %d)") % \
                                 (size, lsize)

I tried to remove that part, but still showing the same error message: Unexpected size !!!
Where are all file size checks?

Revision history for this message
Anders F Björklund (afb) wrote :

Hmm, there might be another validate in cache.py - probably easier to disable size for synthesis, then to remove the size validation.

Revision history for this message
fraterlinux (frateraec) wrote :

Yes, this is the correct file: cache.py It is not necessary to change any other file. I just commented the lines below and everything worked as expected!

205 if lsize != size:
206 raise Error, _("Unexpected size (expected %d, got %d)") % \
207 (size, lsize)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.