Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge --metadata fails with MemoryError [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
at
Apprentice
Apprentice


Joined: 20 Aug 2006
Posts: 185

PostPosted: Thu May 24, 2007 3:15 pm    Post subject: emerge --metadata fails with MemoryError [solved] Reply with quote

I have been running 'emerge --sync' on this machine successfully for almost year. But suddenly it stopped working:

Code:
localhost ~ # emerge -v --metadata

>>> Updating Portage cache:   73%Traceback (most recent call last):
  File "/usr/bin/emerge", line 5530, in ?
    retval = emerge_main()
  File "/usr/bin/emerge", line 5489, in emerge_main
    action_metadata(settings, portdb, myopts)
  File "/usr/bin/emerge", line 4300, in action_metadata
    eclass_cache=ec, verbose_instance=noise_maker)
  File "/usr/lib64/portage/pym/cache/util.py", line 41, in mirror_cache
    trg = trg_cache[x]
  File "/usr/lib64/portage/pym/cache/flat_hash.py", line 28, in __getitem__
    d = self._parse_data(myf, cpv)
  File "/usr/lib64/portage/pym/cache/flat_hash.py", line 43, in _parse_data
    d = dict(map(lambda x:x.rstrip("\n").split("=", 1), data))
MemoryError


The machine has 2 Gb of RAM and no concurrent memory or CPU-intensive processes run.

It coincided with some corruption of the filesystem (ReiserFS). I have fixed the filesystem with fsck but the problem with 'emerge --metadata' persists.

It allways breaks at the same place - at 73% completion. Unfortunately, I could not find any useful logs produced by emerge which would tell where exactly it breaks.

I followed the directions in one of the threads in this forum - do delete '/usr/portage' and do 'emerge --sync'. Didn't help - still the same 73% completion followed by MemoryError.

Would you have any suggestion?

Thank you!


Last edited by at on Fri May 25, 2007 4:03 am; edited 1 time in total
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2513
Location: Silver City, NM

PostPosted: Thu May 24, 2007 4:28 pm    Post subject: Reply with quote

Since this problem occurred around the same time you suffered some file system damage, I suspect that one of the programs or data files associated with Portage got damaged. The first thing to try is to re-emerge Portage:
Code:
# emerge portage

If this command fails, you should follow the instructions here.
Back to top
View user's profile Send private message
at
Apprentice
Apprentice


Joined: 20 Aug 2006
Posts: 185

PostPosted: Thu May 24, 2007 4:42 pm    Post subject: Reply with quote

Sorry, I forgot to mention in the original posting - I also ran:

Code:

# eclean-pkg -d
# eclean-dist -d
# emerge -v portage
# emerge -v1 dev-lang/python
# emerge -v1 dev-python/python-fchksum
# emerge -v1 app-admin/python-updater


Unfortunately, it had made no improvements.

So I did reinstall portage (sys-apps/portage-2.1.2.7) and python.

Maybe if I could somehow make portage to produce a coherent log file which showed what file breaks it, that could help. But how could I do that?
Back to top
View user's profile Send private message
at
Apprentice
Apprentice


Joined: 20 Aug 2006
Posts: 185

PostPosted: Fri May 25, 2007 4:03 am    Post subject: Reply with quote

This is how I solved it:

1. Uncommented line 29 in '/usr/lib64/portage/pym/cache/util.py' file.
2. Ran 'emerge -v --metadata'.
3. Searched for all files containing the name of the ebuild on which 'emerge --metadata' would break.
4. Deleted all found files.
5. Had to repeat iteams 2 through 5 a few times until 'emerge --metadata' ran successfully.
6. Commented line 29 in '/usr/lib64/portage/pym/cache/util.py' file.

(Apparently, some of the files in /var/cache/edb/dep/usr/portage/ directory were corrupted.)

Of course, it would be nice if one didn't have to comment/uncomment something in portage scripts, but the '-v' switch actually did something. Am I asking too much?

As a side effect, after this clean-up portage update became MUCH faster compared to how it was even before the incident.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum