Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 236021 - --sync --> KeyError: 'porttree'
Summary: --sync --> KeyError: 'porttree'
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
: 236024 (view as bug list)
Depends on:
Blocks: 210077
  Show dependency tree
 
Reported: 2008-08-28 12:20 UTC by selckin
Modified: 2008-09-21 23:48 UTC (History)
11 users (show)

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


Attachments
fix the KeyError (sync_keyerror.patch,522 bytes, patch)
2008-08-28 14:19 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description selckin 2008-08-28 12:20:44 UTC
sent 71516 bytes  received 4241037 bytes  67914.22 bytes/sec
total size is 162923187  speedup is 37.78


Performing Global Updates: /usr/portage/tree/profiles/updates/3Q-2008
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  @='/var/db move'
  s='/var/db SLOT move' S='binary SLOT move' p='update /etc/portage/package.*'
..............


Traceback (most recent call last):
  File "/usr/bin/emerge", line 18, in <module>
    retval = _emerge.emerge_main()
  File "/usr/lib64/portage/pym/_emerge/__init__.py", line 13618, in emerge_main
    action_sync(settings, trees, mtimedb, myopts, myaction)
  File "/usr/lib64/portage/pym/_emerge/__init__.py", line 11399, in action_sync
    display_news_notification(root_config, myopts)
  File "/usr/lib64/portage/pym/_emerge/__init__.py", line 10711, in display_news_notification
    portdb = trees["porttree"].dbapi
  File "/usr/lib64/portage/pym/portage/util.py", line 1082, in __getitem__
    return dict.__getitem__(self, item_key)
KeyError: 'porttree'
========================
Portage 2.2_rc8
Comment 1 Zac Medico gentoo-dev 2008-08-28 14:19:37 UTC
Created attachment 163998 [details, diff]
fix the KeyError

If this patch is saved as /tmp/sync_keyerror.patch, then it can be applied as follows:

  patch /usr/lib/portage/pym/_emerge/__init__.py /tmp/sync_keyerror.patch

Note that the KeyError after sync is relatively harmless since the only things that remain to do before emerge exits there are the news and the optional post_sync hook that may be located in /etc/portage/bin/.
Comment 2 Paul Varner (RETIRED) gentoo-dev 2008-08-28 18:13:13 UTC
*** Bug 236024 has been marked as a duplicate of this bug. ***
Comment 3 Martin Mokrejš 2008-09-21 19:43:14 UTC
q: Updating ebuild cache ... 
q: Finished 25242 entries in 0.425519 seconds
Traceback (most recent call last):
  File "/usr/bin/emerge", line 18, in <module>
    retval = _emerge.emerge_main()
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 13618, in emerge_main
    action_sync(settings, trees, mtimedb, myopts, myaction)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 11399, in action_sync
    display_news_notification(root_config, myopts)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 10711, in display_news_notification
    portdb = trees["porttree"].dbapi
  File "/usr/lib/portage/pym/portage/util.py", line 1082, in __getitem__
    return dict.__getitem__(self, item_key)
KeyError: 'porttree'
# patch /usr/lib/portage/pym/_emerge/__init__.py /tmp/sync_keyerror.patch 
patching file /usr/lib/portage/pym/_emerge/__init__.py
Hunk #1 succeeded at 11373 (offset -130 lines).
#

Seems to fix the issue so that the next "emerge --sync" finished.
Comment 4 Zac Medico gentoo-dev 2008-09-21 23:48:55 UTC
This is fixed in 2.2_rc9.