Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Portage currupted after a system crash
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
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Wed Nov 02, 2011 11:27 am    Post subject: Portage currupted after a system crash Reply with quote

Hello,

One of my system crashed during a system update and now, I'm not able to emerge :

Code:

chose laurent # emerge -uDN --rebuilt-binaries --binpkg-respect-use -vp world | more     
receiving incremental file list
Packages
      380987 100%  979.10kB/s    0:00:00 (xfer#1, to-check=0/1)

sent 55 bytes  received 381134 bytes  254126.00 bytes/sec
total size is 380987  speedup is 1.00

These are the packages that would be merged, in order:

Calculating dependencies  .... done!
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib/portage/pym/_emerge/main.py", line 1906, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib/portage/pym/_emerge/actions.py", line 292, in action_build
    settings, trees, myopts, myparams, myaction, myfiles, spinner)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6744, in backtrack_depgraph
    myaction, myfiles, spinner)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6776, in _backtrack_depgraph
    success, favorites = mydepgraph.select_files(myfiles)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 2215, in select_files
    return self._resolve(myfavorites)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 2333, in _resolve
    if not self._create_graph():
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 814, in _create_graph
    if not self._pop_disjunction(allow_unsatisfied):
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 1840, in _pop_disjunction
    pkg, dep_root, dep_priority, dep_string, allow_unsatisfied):
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 1460, in _add_pkg_dep_string
    allow_unsatisfied)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 1483, in _wrapped_add_pkg_dep_string
    strict=strict, priority=dep_priority)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 2538, in _select_atoms_highest_available
    myroot=root, trees=trees)
  File "/usr/lib/portage/pym/portage/dep/dep_check.py", line 621, in dep_check
    use_binaries=use_binaries, myroot=myroot, trees=trees)
  File "/usr/lib/portage/pym/portage/dep/dep_check.py", line 113, in _expand_new_virtuals
    matches = portdb.match_pkgs(x.without_use)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6666, in match_pkgs
    return [self._cpv_pkg_map[cpv] for cpv in self.match(atom)]
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6586, in match
    slot_atom = Atom("%s:%s" % (atom.cp, slots.pop()))
  File "/usr/lib/portage/pym/portage/dep/__init__.py", line 1097, in __init__
    raise InvalidAtom(self)
InvalidAtom: virtual/acl:


I've tried to uninstall and then re-emerge virtual/acl (as per some threads found on this site), but I got at the end :
Code:

>>> Recording virtual/acl in "world" favorites file...
>>> Auto-cleaning packages...
portage: COUNTER for sys-devel/gnuconfig-20110202 was corrupted; resetting to value of 0
portage: COUNTER for sys-devel/gnuconfig-20110202 was corrupted; resetting to value of 0
portage: COUNTER for dev-libs/gmp-5.0.2 was corrupted; resetting to value of 0
portage: COUNTER for dev-libs/gmp-5.0.2 was corrupted; resetting to value of 0


So I'm looking for some good tips.

Bye

Laurent
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Wed Nov 02, 2011 12:25 pm    Post subject: Reply with quote

You had a crash and you are getting messages about corruption. Did you run fsck?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Wed Nov 02, 2011 12:37 pm    Post subject: Reply with quote

The system hangs but after reboot, the FS was marked as clean, no fsck was issued (and I didn't tried).
On the other hand, everything is working fine but this message when I'm trying to emerge. No IO error or such.

It's why I'm thinking about a corruption of portage but I duno if there is any danger to run
Code:
emerge --metadata

and if it can solve my problem ?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Wed Nov 02, 2011 1:09 pm    Post subject: Reply with quote

The filesystem marked clean does not indicate the real condition of the filesystem, it is just a flag that can be set or not.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Wed Nov 02, 2011 2:30 pm    Post subject: Reply with quote

The errors you are getting are indicating that your vdb is corrupted. The vdb is the variable db of the installed packages at /var/db/pkg/ You will have to fix most of it manually, probably need to re-emerge the damaged pkgs, the COUNTER is for tracking the age of the install.

The pkg in question is /var/db/pkg/virtual/acl-0 <== it needs the version in the name. Not having the version in it makes it an InvalidAtom.

You should inspect the entire vdb for obvious errors.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Wed Nov 02, 2011 3:31 pm    Post subject: Reply with quote

So, first of all, I fsck all my FS and they are all clean.

Looking inside /var/db/pkg/, I got at least

  • sys-devel/gnuconfig-20110202
  • dev-libs/gmp-5.0.2
  • and virtual/acl-0
corrupted.

But it's not only COUNTER that are corrupted but also various files inside (i.e., /var/db/pkg/dev-libs/gmp-5.0.2/CONTENTS contains some piece of code ...).

I don't think I can trust in my vdb at all :?

What I'm thinking to do (probably stupide ideas) :

  1. is to copy /var/db/pkg/ from a working environment (but it doesn't have the same version of packages, and potentially not the same package), and then re-emerge the entire world.
  2. or to uninstall everything and then re-emerge world (the question is how to preserve world b/w uninstall and the re-emerge).

but I duno if one of them is possible.
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Wed Nov 02, 2011 3:41 pm    Post subject: Reply with quote

I would slowly re-emerge all affected pkgs if possible. Then once you get past those, re-emerge -e world.

I have been in a similar situation years ago when I had some faulty memory corrupting things, the more I upgraded pkgs the more things got corrupted and things not working. I re-installed, since I couldn't trust much of anything. Turned out I just had to remove and re-install the memory to fix it.

Which reminds me, perhaps you have some failing memory. Wouldn't hurt to run a check before you proceed with fixing/re-install. memtest86 is your friend there.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Wed Nov 02, 2011 4:47 pm    Post subject: Reply with quote

I'm currently running memtest (to be sure), but it's looks like a problem with X screen saver (the default one, I didn't installed anything).

It's not the 1st time this machine crashed, and everytime, X was running w/o human activity for a while.
I was on way to update my system before reporting ...
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Wed Nov 02, 2011 5:59 pm    Post subject: Reply with quote

No, no no and ... no :x :? : everytime I'm trying to emerge any package, I got
Code:
  File "/usr/lib/portage/pym/portage/dep/__init__.py", line 1097, in __init__
    raise InvalidAtom(self)
InvalidAtom: virtual/acl:


I successufull reinstalled acl itself, but ...
Code:
emerge -evd app-admin/logrotate
receiving incremental file list
Packages
      380987 100%  927.82kB/s    0:00:00 (xfer#1, to-check=0/1)

sent 55 bytes  received 381134 bytes  762378.00 bytes/sec
total size is 380987  speedup is 1.00
myaction None
myopts {'--getbinpkg': True, '--debug': True, '--verbose': True, '--emptytree': True, '--usepkg': True}

 * IMPORTANT: 4 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.



myparams {'recurse': True, 'deep': True, 'empty': True}


These are the packages that would be merged, in order:

Calculating dependencies 

      Arg: app-admin/logrotate
     Atom: app-admin/logrotate
   ebuild: app-admin/logrotate-3.8.0::gentoo
   binary: app-admin/logrotate-3.8.0::gentoo

Child:         (app-admin/logrotate-3.8.0::gentoo, binary scheduled for merge) USE="acl (-selinux)"
Parent Dep:    app-admin/logrotate

Parent:    (app-admin/logrotate-3.8.0::gentoo, binary scheduled for merge)
Depstring: >=dev-libs/popt-1.5 virtual/acl
Priority:  runtime

Parent:    (app-admin/logrotate-3.8.0::gentoo, binary scheduled for merge)
Depstring: >=dev-libs/popt-1.5
Priority:  runtime
Candidates: ['>=dev-libs/popt-1.5']
   ebuild: dev-libs/popt-1.16-r1::gentoo
   binary: dev-libs/popt-1.16-r1::gentoo

Child:         (dev-libs/popt-1.16-r1::gentoo, binary scheduled for merge) USE="nls -static-libs"
Parent Dep:    >=dev-libs/popt-1.5 required by (app-admin/logrotate-3.8.0::gentoo, binary scheduled for merge)

Exiting... (app-admin/logrotate-3.8.0::gentoo, binary scheduled for merge)

Parent:    (dev-libs/popt-1.16-r1::gentoo, binary scheduled for merge)
Depstring: virtual/libintl
Priority:  runtime

Parent:    (dev-libs/popt-1.16-r1::gentoo, binary scheduled for merge)
Depstring: virtual/libintl
Priority:  runtime
   ebuild: virtual/libintl-0::gentoo
   binary: virtual/libintl-0::gentoo
   ebuild: virtual/libintl-0::gentoo
   binary: virtual/libintl-0::gentoo
Virtual Parent:      (virtual/libintl-0::gentoo, binary scheduled for merge)
Virtual Depstring:   
Candidates: ['=virtual/libintl-0']
   ebuild: virtual/libintl-0::gentoo
   binary: virtual/libintl-0::gentoo

Child:         (virtual/libintl-0::gentoo, binary scheduled for merge) USE=""
Parent Dep:    virtual/libintl required by (dev-libs/popt-1.16-r1::gentoo, binary scheduled for merge)

Candidates: virtual/libintl-0: []

Child:         (virtual/libintl-0::gentoo, binary scheduled for merge) USE=""
Parent Dep:    =virtual/libintl-0 required by (dev-libs/popt-1.16-r1::gentoo, binary scheduled for merge)

Exiting... (dev-libs/popt-1.16-r1::gentoo, binary scheduled for merge)

Parent:    (app-admin/logrotate-3.8.0::gentoo, binary scheduled for merge)
Depstring: virtual/acl
Priority:  runtime
   ebuild: virtual/acl-0::gentoo
   ebuild: virtual/acl-0::gentoo
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib/portage/pym/_emerge/main.py", line 1906, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib/portage/pym/_emerge/actions.py", line 292, in action_build
    settings, trees, myopts, myparams, myaction, myfiles, spinner)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6744, in backtrack_depgraph
    myaction, myfiles, spinner)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6776, in _backtrack_depgraph
    success, favorites = mydepgraph.select_files(myfiles)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 2215, in select_files
    return self._resolve(myfavorites)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 2333, in _resolve
    if not self._create_graph():
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 814, in _create_graph
    if not self._pop_disjunction(allow_unsatisfied):
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 1840, in _pop_disjunction
    pkg, dep_root, dep_priority, dep_string, allow_unsatisfied):
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 1460, in _add_pkg_dep_string
    allow_unsatisfied)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 1483, in _wrapped_add_pkg_dep_string
    strict=strict, priority=dep_priority)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 2538, in _select_atoms_highest_available
    myroot=root, trees=trees)
  File "/usr/lib/portage/pym/portage/dep/dep_check.py", line 621, in dep_check
    use_binaries=use_binaries, myroot=myroot, trees=trees)
  File "/usr/lib/portage/pym/portage/dep/dep_check.py", line 113, in _expand_new_virtuals
    matches = portdb.match_pkgs(x.without_use)
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6666, in match_pkgs
    return [self._cpv_pkg_map[cpv] for cpv in self.match(atom)]
  File "/usr/lib/portage/pym/_emerge/depgraph.py", line 6586, in match
    slot_atom = Atom("%s:%s" % (atom.cp, slots.pop()))
  File "/usr/lib/portage/pym/portage/dep/__init__.py", line 1097, in __init__
    raise InvalidAtom(self)
InvalidAtom: virtual/acl:

Any comment about /var/db/pkg/ from a working environment ?
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Wed Nov 02, 2011 7:32 pm    Post subject: Reply with quote

Well, I give up : I'll reinstall from scratch :(
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23327

PostPosted: Thu Nov 03, 2011 1:59 am    Post subject: Reply with quote

destroyedlolo wrote:
I'm currently running memtest (to be sure), but it's looks like a problem with X screen saver (the default one, I didn't installed anything).
Could you explain? Blanking and optionally locking the screen should be a very simple and reliable action.
Back to top
View user's profile Send private message
phajdan.jr
Retired Dev
Retired Dev


Joined: 23 Mar 2006
Posts: 1777
Location: Poland

PostPosted: Thu Nov 03, 2011 11:09 am    Post subject: Reply with quote

Please consider filing a bug about recovery from corrupted vdb. Either there should be a doc explaining how to do that or we should make it possible.
_________________
http://phajdan-jr.blogspot.com/
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Thu Nov 03, 2011 11:12 am    Post subject: Reply with quote

Hu wrote:
Could you explain? Blanking and optionally locking the screen should be a very simple and reliable action.

It's not fully reproducible but it happen several time that after long time without human interaction (so I think the screensaver was activated), the machine totally hangs :
  • the screen wasn't blanck
  • no mouse/keyboard action
  • remote ssh session frozen
  • distcc compilation not responding
    ...


It's an Athlon 1.1 Ghz machine, a matrox card (dual head G???) with OpenBox on it.
This machine is stable under Ubuntu (but single head).

Only a reset wakes the machine back.

As I said, I'm upgrading and will investigate afterward if the problem is raising again (and I hope not :D ).
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Thu Nov 03, 2011 11:17 am    Post subject: Reply with quote

phajdan.jr wrote:
Please consider filing a bug about recovery from corrupted vdb. Either there should be a doc explaining how to do that or we should make it possible.

The problem is this environment is gone as I did a re-install last night (it wasn't a problem as I was installing it). I did some search on this forum for similar errors but remedy I found didn't worked for me.
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Thu Nov 03, 2011 2:14 pm    Post subject: Reply with quote

If x is the cause. I would look at memory consumption. You could have something leaking memory, eventually using everything, causing the lockup. Make sure you have lots of swap. Check it with ever increasing amounts of time to see if that is the case.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Thu Nov 03, 2011 2:20 pm    Post subject: Reply with quote

Also, if you haven't wiped out your vdb yet, please consider making a bz2 image of it and attach it to the bug. We can then use it to see if it would be possible to fix/recover from it.

Also, have you tried doing a binary install of python, and portage in case there was corruption in them preventing you from merging anything else.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
destroyedlolo
l33t
l33t


Joined: 17 Jun 2011
Posts: 846
Location: Close to Annecy (France)

PostPosted: Thu Nov 03, 2011 3:32 pm    Post subject: Reply with quote

dol-sen wrote:
If x is the cause. I would look at memory consumption. You could have something leaking memory, eventually using everything, causing the lockup. Make sure you have lots of swap. Check it with ever increasing amounts of time to see if that is the case.

This machine has 1.5Go and as per conky output at hanging, only few of it was used.

dol-sen wrote:
Also, if you haven't wiped out your vdb yet, please consider making a bz2 image of it and attach it to the bug. We can then use it to see if it would be possible to fix/recover from it.

Wiped, I did a full reinstall (I was a bit tired with that yesterday :? ).
And as this machine has no valuable information (as in installation phase), I restarted from scratch to speed up.

dol-sen wrote:
Also, have you tried doing a binary install of python, and portage in case there was corruption in them preventing you from merging anything else.


I've tried with binary package (I have a local binhost). I've tried with a local forced emerge ... but I always got the same problem.

This evening, I'll check as the reinstall completed (thanks to binhost :D ).
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