Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906675 - "Package basename mismatched" error breaking emerge calls
Summary: "Package basename mismatched" error breaking emerge calls
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-18 14:01 UTC by Rick Farina (Zero_Chaos)
Modified: 2023-12-10 01:28 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kwayland-5.112.0-1.gpkg.tar (kwayland-5.112.0-1.gpkg.tar,690.00 KB, application/octet-stream)
2023-11-26 20:52 UTC, Nikos Chantziaras
Details
kwayland-5.112.0-1.gpkg.tar.28812 (kwayland-5.112.0-1.gpkg.tar.28812,682.50 KB, application/octet-stream)
2023-11-26 20:52 UTC, Nikos Chantziaras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Farina (Zero_Chaos) gentoo-dev 2023-05-18 14:01:10 UTC
emerge --quiet --usepkg --buildpkg --binpkg-respect-use=y --newuse --oneshot --update --newuse sys-apps/portage

Performing Global Updates
(Could take a couple of minutes if you have a lot of binary packages.)
@Package basename mismatched, using jaraco-context-4.3.0Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.10/emerge", line 59, in <module>
    retval = emerge_main()
  File "/usr/lib/python3.10/site-packages/_emerge/main.py", line 1299, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib/python3.10/site-packages/_emerge/actions.py", line 3418, in run_action
    and _global_updates(
  File "/usr/lib/python3.10/site-packages/portage/_global_updates.py", line 41, in _global_updates
    return _do_global_updates(
  File "/usr/lib/python3.10/site-packages/portage/_global_updates.py", line 257, in _do_global_updates
    bindb.update_ents(repo_map, onUpdate=onUpdate)
  File "/usr/lib/python3.10/site-packages/portage/dbapi/__init__.py", line 413, in update_ents
    aux_update(cpv, metadata_updates)
  File "/usr/lib/python3.10/site-packages/portage/dbapi/bintree.py", line 295, in aux_update
    mybinpkg.update_metadata(mydata)
  File "/usr/lib/python3.10/site-packages/portage/gpkg.py", line 1155, in update_metadata
    raise InvalidBinaryPackageFormat(
portage.exception.InvalidBinaryPackageFormat: gpkg file structure mismatch in /var/cache/binpkgs/dev-python/jaraco-context/jaraco-context-4.3.0-2.gpkg.tar; files: ['jaraco-context-4.3.0/gpkg-1', 'jaraco-context-4.3.0-1/metadata.tar.zst', 'jaraco-context-4.3.0/image.tar.zst', 'jaraco-context-4.3.0-1/Manifest']

Reproducible: Always

Steps to Reproduce:
1. I have no idea to be honest
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2023-05-18 14:03:55 UTC
This failure looks very related to the bug in See Also, but using portage 3.0.47
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-28 15:28:32 UTC
I haven't seen this in ages.

Uploading a bad example binpkg (both sides) would help.

This might be with signing but that wasn't mentioned.
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2023-09-05 16:39:04 UTC
I haven't seen this in a while either, so I'm going to leave it closed unless that changes.
Comment 4 Nikos Chantziaras 2023-11-26 14:55:56 UTC
I just got what appear to be the same warnings:

Performing Global Updates
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
  s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
  p='update /etc/portage/package.*'
/var/db/repos/gentoo/profiles/updates/4Q-2023...................................
@%@%@%sS@%####################################################################################################################################################***************************************************************************************************************************Package basename mismatched, using kwayland-5.112.0/usr/lib/python3.11/site-packages/portage/dbapi/__init__.py:428: UserWarning: gpkg file structure mismatch in /mnt/Data/cache/gentoo/binpkgs/kde-plasma/kwayland/kwayland-5.112.0-1.gpkg.tar; files: ['kwayland-5.112.0/gpkg-1', 'kwayland-5.112.0-1/metadata.tar.zst', 'kwayland-5.112.0/image.tar.zst', 'kwayland-5.112.0-1/Manifest']
  warnings.warn(e)
********Package basename mismatched, using libplasma-5.112.0/usr/lib/python3.11/site-packages/portage/dbapi/__init__.py:428: UserWarning: gpkg file structure mismatch in /mnt/Data/cache/gentoo/binpkgs/kde-plasma/libplasma/libplasma-5.112.0-1.gpkg.tar; files: ['libplasma-5.112.0/gpkg-1', 'libplasma-5.112.0-1/metadata.tar.zst', 'libplasma-5.112.0/image.tar.zst', 'libplasma-5.112.0-1/Manifest']
  warnings.warn(e)
****Package basename mismatched, using plasma-activities-5.112.0/usr/lib/python3.11/site-packages/portage/dbapi/__init__.py:428: UserWarning: gpkg file structure mismatch in /mnt/Data/cache/gentoo/binpkgs/kde-plasma/plasma-activities/plasma-activities-5.112.0-1.gpkg.tar; files: ['plasma-activities-5.112.0/gpkg-1', 'plasma-activities-5.112.0-1/metadata.tar.zst', 'plasma-activities-5.112.0/image.tar.zst', 'plasma-activities-5.112.0-1/Manifest']
  warnings.warn(e)
*Package basename mismatched, using plasma-activities-stats-5.112.0/usr/lib/python3.11/site-packages/portage/dbapi/__init__.py:428: UserWarning: gpkg file structure mismatch in /mnt/Data/cache/gentoo/binpkgs/kde-plasma/plasma-activities-stats/plasma-activities-stats-5.112.0-1.gpkg.tar; files: ['plasma-activities-stats-5.112.0/gpkg-1', 'plasma-activities-stats-5.112.0-1/metadata.tar.zst', 'plasma-activities-stats-5.112.0/image.tar.zst', 'plasma-activities-stats-5.112.0-1/Manifest']
  warnings.warn(e)
************************
Comment 5 Nikos Chantziaras 2023-11-26 15:00:17 UTC
There's two files in /mnt/Data/cache/gentoo/binpkgs/kde-plasma/kwayland/:

kwayland-5.112.0-1.gpkg.tar
kwayland-5.112.0-1.gpkg.tar.28812

Should I upload them here?
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-26 16:58:19 UTC
Yes please. I wonder why this is coming up now when pkgmoves seem to have been fine until now.
Comment 7 Nikos Chantziaras 2023-11-26 20:52:26 UTC
Created attachment 875744 [details]
kwayland-5.112.0-1.gpkg.tar
Comment 8 Nikos Chantziaras 2023-11-26 20:52:50 UTC
Created attachment 875745 [details]
kwayland-5.112.0-1.gpkg.tar.28812
Comment 9 Nikos Chantziaras 2023-11-26 20:56:55 UTC
Note that that I have thousands of binary packages. I have FEATURES="buildpkg" in my make.conf so every single emerge I do has a binary package stored. Only those four threw this warning, but I guess they were the only ones affected by the pkgmove?
Comment 10 Zac Medico gentoo-dev 2023-12-10 00:33:19 UTC
Possibly triggered by binarytree.getname returning an existing but incorrect package path due to bug 919668.
Comment 11 Larry the Git Cow gentoo-dev 2023-12-10 01:28:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=cc372a52ee2aba153c0d7c2290306b7f623e8b7c

commit cc372a52ee2aba153c0d7c2290306b7f623e8b7c
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-12-09 23:58:07 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-12-10 01:27:43 +0000

    bindbapi: add SIZE to _pkg_str_aux_keys
    
    The _pkg_str_aux_keys are used inside dbapi.update_ents,
    and need to contain SIZE in order for the fakedbapi
    _instance_key_multi_instance method to operate correctly.
    
    Incorrect operation of _instance_key_multi_instance could
    prevent binarytree.inject from removing an old instance
    from its internal state. It could also trigger a KeyError
    in bindbapi.aux_update as in bug 918597, since it could
    cause binarytree.getname to return a non-existent path.
    It could also cause binarytree.getname to return an
    existing but incorrect path, which might trigger an
    InvalidBinaryPackageFormat exception as in bug 906675.
    
    Bug: https://bugs.gentoo.org/906675
    Bug: https://bugs.gentoo.org/918597
    Bug: https://bugs.gentoo.org/919668
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/dbapi/bintree.py | 3 +++
 1 file changed, 3 insertions(+)