Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 571126 - sys-apps/portage-2.2.26: "Performing Global Updates" KeyError from update_ents with FEATURES=binpkg-multi-instance
Summary: sys-apps/portage-2.2.26: "Performing Global Updates" KeyError from update_ent...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 766117
Blocks:
  Show dependency tree
 
Reported: 2016-01-06 21:46 UTC by Andreas K. Hüttel
Modified: 2023-12-09 20:28 UTC (History)
0 users

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


Attachments
emerge --info (emerge-info.txt,20.08 KB, text/plain)
2016-01-06 21:47 UTC, Andreas K. Hüttel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas K. Hüttel archtester gentoo-dev 2016-01-06 21:46:48 UTC
portage-2.2.26: a traceback during update processing occurred, see below:

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.*'
/usr/local/portage/kde/profiles/updates/4Q-2015...............................
/usr/portage/profiles/updates/4Q-2015.............................................
/usr/portage/profiles/updates/1Q-2016.
%@%%@%%@%%@%%@%%@%@%%@%%@%@%%@%%@%%@%%@%%@%%@%%@%%@%%@%%@%%@%%@%%@%%p###################################*Traceback (most 
recent call last):
  File "/usr/lib/python-exec/python3.4/emerge", line 50, in <module>
    retval = emerge_main()
  File "/usr/lib64/python3.4/site-packages/_emerge/main.py", line 1174, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib64/python3.4/site-packages/_emerge/actions.py", line 3104, in run_action
    return action_sync(emerge_config)
  File "/usr/lib64/python3.4/site-packages/_emerge/actions.py", line 1977, in action_sync
    retvals = syncer.auto_sync(options={'return-messages': False})
  File "/usr/lib64/python3.4/site-packages/portage/emaint/modules/sync/sync.py", line 98, in auto_sync
    emaint_opts=options)
  File "/usr/lib64/python3.4/site-packages/portage/emaint/modules/sync/sync.py", line 251, in _sync
    self._do_pkg_moves()
  File "/usr/lib64/python3.4/site-packages/portage/emaint/modules/sync/sync.py", line 265, in _do_pkg_moves
    quiet=("--quiet" in self.emerge_config.opts)):
  File "/usr/lib64/python3.4/site-packages/portage/_global_updates.py", line 41, in _global_updates
    quiet=quiet, if_mtime_changed=if_mtime_changed)
  File "/usr/lib64/python3.4/site-packages/portage/_global_updates.py", line 240, in _do_global_updates
    bindb.update_ents(repo_map, onUpdate=onUpdate)
  File "/usr/lib64/python3.4/site-packages/portage/dbapi/__init__.py", line 350, in update_ents
    aux_update(cpv, metadata_updates)
  File "/usr/lib64/python3.4/site-packages/portage/dbapi/bintree.py", line 203, in aux_update
    raise KeyError(cpv)
KeyError: 'kde-apps/akregator-4.4.2015.06'
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2016-01-06 21:47:39 UTC
Created attachment 422164 [details]
emerge --info
Comment 2 Zac Medico gentoo-dev 2016-01-06 21:53:06 UTC
It looks like "move kde-base/akregator kde-apps/akregator" inside profiles/updates/4Q-2015 triggered this. The bintree state probably got messed up in a move_ent call for the mentioned package move, and then that caused update_ents to fail later on.
Comment 3 Zac Medico gentoo-dev 2020-03-17 08:48:37 UTC
This was reported today:

> 
> Performing Global Updates
> (Could take a couple of minutes if you have a lot of binary packages.)
> Traceback (most recent call last):
>   File "/usr/lib/python-exec/python3.6/emerge", line 53, in <module>
>     retval = emerge_main()
>   File "/usr/lib64/python3.6/site-packages/_emerge/main.py", line 1309, in emerge_main
>     return run_action(emerge_config)
>   File "/usr/lib64/python3.6/site-packages/_emerge/actions.py", line 2891, in run_action
>     quiet=("--quiet" in emerge_config.opts)):
>   File "/usr/lib64/python3.6/site-packages/portage/_global_updates.py", line 41, in _global_updates
>     quiet=quiet, if_mtime_changed=if_mtime_changed)
>   File "/usr/lib64/python3.6/site-packages/portage/_global_updates.py", line 177, in _do_global_updates
>     moves = bindb.move_slot_ent(update_cmd, repo_match=repo_match)
>   File "/usr/lib64/python3.6/site-packages/portage/dbapi/__init__.py", line 441, in move_slot_ent
>     self.aux_update(mycpv, mydata)
>   File "/usr/lib64/python3.6/site-packages/portage/dbapi/bintree.py", line 213, in aux_update
>     raise KeyError(cpv)
> KeyError: 'media-libs/vips-8.9.0_rc2'
Comment 4 Zac Medico gentoo-dev 2021-01-18 09:19:43 UTC
(In reply to Andreas K. Hüttel from comment #0)
> 41, in _global_updates
>     quiet=quiet, if_mtime_changed=if_mtime_changed)
>   File "/usr/lib64/python3.4/site-packages/portage/_global_updates.py", line
> 240, in _do_global_updates
>     bindb.update_ents(repo_map, onUpdate=onUpdate)
>   File "/usr/lib64/python3.4/site-packages/portage/dbapi/__init__.py", line
> 350, in update_ents
>     aux_update(cpv, metadata_updates)
>   File "/usr/lib64/python3.4/site-packages/portage/dbapi/bintree.py", line
> 203, in aux_update
>     raise KeyError(cpv)
> KeyError: 'kde-apps/akregator-4.4.2015.06'

The root cause of bug 765847 was that aux_update inappropriately renamed the package file. It's probably the same thing that triggered this KeyError.
Comment 5 Zac Medico gentoo-dev 2021-01-18 09:54:57 UTC
(In reply to Zac Medico from comment #4)
> (In reply to Andreas K. Hüttel from comment #0)
> > 41, in _global_updates
> >     quiet=quiet, if_mtime_changed=if_mtime_changed)
> >   File "/usr/lib64/python3.4/site-packages/portage/_global_updates.py", line
> > 240, in _do_global_updates
> >     bindb.update_ents(repo_map, onUpdate=onUpdate)
> >   File "/usr/lib64/python3.4/site-packages/portage/dbapi/__init__.py", line
> > 350, in update_ents
> >     aux_update(cpv, metadata_updates)
> >   File "/usr/lib64/python3.4/site-packages/portage/dbapi/bintree.py", line
> > 203, in aux_update
> >     raise KeyError(cpv)
> > KeyError: 'kde-apps/akregator-4.4.2015.06'
> 
> The root cause of bug 765847 was that aux_update inappropriately renamed the
> package file. It's probably the same thing that triggered this KeyError.

Yeah, each aux_update call renamed a package file and left behind an entry for the old file name that would trigger this KeyError on a future aux_update call.
Comment 6 Larry the Git Cow gentoo-dev 2021-01-19 11:17:00 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b03adb22f0432ee992aab733ce5dfa13e9b6801a

commit b03adb22f0432ee992aab733ce5dfa13e9b6801a
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-01-19 11:07:56 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-01-19 11:16:53 +0000

    sys-apps/portage: Bump to version 3.0.14
    
     #571126 KeyError during package moves "global updates" triggered by
             FEATURES=binpkg-multi-instance (same root cause as bug 765847)
     #739004 Add @changed-subslot package set
     #765847 Spurious package file renames during application of
             package moves with FEATURES=binpkg-multi-instance
     #766012 Copy on write when applying a package move to a binary
             package, so that the old version of a binary package
             will remain available until eclean-pkg deletes it
    
    Bug: https://bugs.gentoo.org/766117
    Bug: https://bugs.gentoo.org/571126
    Bug: https://bugs.gentoo.org/739004
    Bug: https://bugs.gentoo.org/765847
    Bug: https://bugs.gentoo.org/766012
    Package-Manager: Portage-3.0.14, Repoman-3.0.2
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.14.ebuild | 268 +++++++++++++++++++++++++++++++++
 2 files changed, 269 insertions(+)