Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size mismatch in 1.3.4 #906

Closed
melvyn-sopacua opened this issue Aug 2, 2014 · 8 comments
Closed

Size mismatch in 1.3.4 #906

melvyn-sopacua opened this issue Aug 2, 2014 · 8 comments

Comments

@melvyn-sopacua
Copy link

Using:

diff --git a/libpkg/repo/binary/fetch.c b/libpkg/repo/binary/fetch.c
index 6555512..e2aa789 100644
--- a/libpkg/repo/binary/fetch.c
+++ b/libpkg/repo/binary/fetch.c
@@ -221,8 +221,8 @@ checksum:

            unlink(dest);
            pkg_emit_error("cached package %s-%s: "
-                   "size mismatch, fetching from remote",
-                   name, version);
+                   "size mismatch (%li != %li), fetching from remote",
+                   name, version, pkgsize,st.st_size);
            return (pkg_repo_binary_try_fetch(repo, pkg, true, mirror, destdir));
    }
    retcode = sha256_file(dest, cksum);

The output is:
pkg: cached package vim-7.4.364: size mismatch (4901580 != 4904224), fetching from remote

4904224 is the correct pkgsize. I have no idea where the 4901580 comes from. The packagesite.txz in the repo also has the correct 4904224 as pkgsize. No 4901580 in packagesite.yaml anywhere.

@melvyn-sopacua
Copy link
Author

Workaround:
delete/move /var/db/pkg/repo-yourrepo.sqlite (and I did the repo.meta also). The wrong sizes are now gone and everything works again. If you need the faulty files, I have kept them.

@vstakhov
Copy link
Member

vstakhov commented Aug 2, 2014

I think I've fixed this problem in the master branch in 74f4ebe commit.

@melvyn-sopacua
Copy link
Author

Looks solid. I wanted to make a regression test for this bug but I see that the testing framework has been not working for some time. With all the regressions, some of which caught minutes after release, it's perhaps an idea to reinstate it or go with a new framework?

@bapt
Copy link
Member

bapt commented Aug 5, 2014

All help in that area to get regression working is really welcomed :)

2014-08-05 4:04 GMT+02:00 Melvyn Sopacua notifications@github.com:

Looks solid. I wanted to make a regression test for this bug but I see
that the testing framework has been not working for some time. With all the
regressions, some of which caught minutes after release, it's perhaps an
idea to reinstate it or go with a new framework?


Reply to this email directly or view it on GitHub
#906 (comment).

@melvyn-sopacua
Copy link
Author

Ok, can you elaborate what's broken now? I see several things in there (bsd.tests.mk and configure.ac hooks) and without some architectural overview it's quite the puzzle to even figure out how to trigger the broken implementation.

@bdrewery
Copy link
Member

bdrewery commented Aug 9, 2014

This is not fixed. I ran pkg update -f on 1.3.5.1+ (git), and just ran pkg install -f git and got:

pkg: cached package git-2.0.2: size mismatch, fetching from remote
Fetching git-2.0.2.txz: 100% of 3 MB
pkg: cached package git-2.0.2: size mismatch, cannot continue

@bdrewery bdrewery added this to the 1.3 milestone Aug 9, 2014
@bdrewery
Copy link
Member

bdrewery commented Aug 9, 2014

This was the whole purpose of the cached filenames. What happened??

@bdrewery
Copy link
Member

bdrewery commented Aug 9, 2014

checksum filenames*

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants