Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 388187 - Portage backtraces on InvalidAtom in profiles/updates/Q* files
Summary: Portage backtraces on InvalidAtom in profiles/updates/Q* files
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 388185 388191 388197 388201 (view as bug list)
Depends on:
Blocks: 381649
  Show dependency tree
 
Reported: 2011-10-23 08:54 UTC by Fabian Groffen
Modified: 2011-10-23 23:03 UTC (History)
8 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2011-10-23 08:54:35 UTC
A faulty atom was checked into Q4-2011 today, which caused Portage to prompty abort any of its actions.  I was confronted with this myself, and saw reports from others in IRC.

Because it's hard for users to work around this, I think Portage should just warn about these failures, but continue nevertheless.  It's not the user's fault someone committed a faulty atom.


% emerge -1 groff

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.*'
/net/amun/export/scratch0/gentoo/prefix-overlay-rsync/rsync1a/profiles/updates/3Q-2011..........................
/net/amun/export/scratch0/gentoo/prefix-overlay-rsync/rsync1a/profiles/updates/4Q-2011......
ERROR: Malformed update entry 'move dev-php5/dev-php5/pecl-ssh2 dev-php/dev-php5/pecl-ssh2'
Traceback (most recent call last):
  File "/Library/Gentoo/usr/bin/emerge", line 44, in <module>
    retval = emerge_main()
  File "/Library/Gentoo/usr/lib/portage/pym/_emerge/main.py", line 1617, in emerge_main
    _global_updates(trees, mtimedb["updates"], quiet=("--quiet" in myopts)):
  File "/Library/Gentoo/usr/lib/portage/pym/portage/_global_updates.py", line 160, in _global_updates
    moves = vardb.move_ent(update_cmd, repo_match=repo_match)
  File "/Library/Gentoo/usr/lib/portage/pym/portage/dbapi/vartree.py", line 314, in move_ent
    origmatches = self.match(origcp, use_cache=0)
  File "/Library/Gentoo/usr/lib/portage/pym/portage/dbapi/vartree.py", line 488, in match
    origdep, mydb=self, use_cache=use_cache, settings=self.settings)
  File "/Library/Gentoo/usr/lib/portage/pym/portage/dbapi/dep_expand.py", line 33, in dep_expand
    mydep = Atom(mydep, allow_repo=True)
  File "/Library/Gentoo/usr/lib/portage/pym/portage/dep/__init__.py", line 1103, in __init__
    raise InvalidAtom(self)
InvalidAtom: dev-php5/dev-php5/pecl-ssh2
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2011-10-23 09:10:19 UTC
*** Bug 388185 has been marked as a duplicate of this bug. ***
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2011-10-23 09:11:01 UTC
*** Bug 388191 has been marked as a duplicate of this bug. ***
Comment 3 Sebastian Luther (few) 2011-10-23 09:11:50 UTC
Continuing poses the problem that ebuilds might already depend on the moved package, which in turn results in strange failures later on.
Comment 4 Fabian Groffen gentoo-dev 2011-10-23 09:13:18 UTC
Then maybe rsync0 should refuse to update anything in this case?  (and send nasty complaints somewhere)
Comment 5 Sebastian Luther (few) 2011-10-23 09:23:13 UTC
(In reply to comment #4)
> Then maybe rsync0 should refuse to update anything in this case?  (and send
> nasty complaints somewhere)

That's one thing. 

What about teaching repoman to do commits in the profiles/ dir?
Comment 6 florian 2011-10-23 09:38:30 UTC
I just had exactly the error described above, and I don't quite know how to proceed now. It seems quite obvious that the incriminating line in /usr/portage/profiles/updates/Q4-2011:

     move dev-php5/dev-php5/pecl-ssh2 dev-php/dev-php5/pecl-ssh2

should be

     move dev-php5/pecl-ssh2 dev-php/pecl-ssh2

Hmm. Probably, that is. (I'm a bit less sure now.)

But is this any way to go, editing Q4-2011 by hand and then proceed? Or is it wiser to just wait until it has been fixed officially?

Thanks very much in advance, and best regards,

Florian
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2011-10-23 09:41:18 UTC
*** Bug 388197 has been marked as a duplicate of this bug. ***
Comment 8 Fabian Groffen gentoo-dev 2011-10-23 09:42:01 UTC
I'm not sure the "fix" is already on the rsync-slaves, but does emerge --sync still work for you?  Or does that abort as well?  If so, just remove the faulty line which you identified yourself already:

   move dev-php5/dev-php5/pecl-ssh2 dev-php/dev-php5/pecl-ssh2
Comment 9 Markos Chandras (RETIRED) gentoo-dev 2011-10-23 09:49:31 UTC
The problem is that if users have a tree with the malformed entry, they can no longer --sync. I see no reason for portage to update profiles when emerge --sync is called. Would it be possible to alter the portage behavior so it does not perform profile updates when emerge --sync it called. This should prevent similar situations in the future
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2011-10-23 09:57:59 UTC
*** Bug 388201 has been marked as a duplicate of this bug. ***
Comment 11 Sebastian Luther (few) 2011-10-23 10:08:25 UTC
For those who can't sync: emerge --sync --package-moves=n.
Comment 12 Toralf Förster gentoo-dev 2011-10-23 13:28:47 UTC
(In reply to comment #11)
> For those who can't sync: emerge --sync --package-moves=n.

as a temporary work around - yes - otherwise comment #9 points to the right direction
Comment 13 Sebastian Luther (few) 2011-10-23 13:34:07 UTC
Synced ebuilds will already have dependencies on the moved packages, which means packages should be moved right after sync. 

The solution to the problem is to prevent the distribution of broken updates.
Comment 14 Markos Chandras (RETIRED) gentoo-dev 2011-10-23 14:43:19 UTC
(In reply to comment #13)
> Synced ebuilds will already have dependencies on the moved packages, which
> means packages should be moved right after sync. 
> 
> The solution to the problem is to prevent the distribution of broken updates.

So? The profile/update will run when you call emerge without --sync. What is the problem to perform the profile update when the user tried to invokes emerge != --sync? What is the reasoning to perform profile updates after emerge --sync?
Comment 15 Zac Medico gentoo-dev 2011-10-23 18:40:01 UTC
This is fixed in git:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a3005f69ba99d0e882da44716e3743737e6e4987

(In reply to comment #14)
> So? The profile/update will run when you call emerge without --sync. What is
> the problem to perform the profile update when the user tried to invokes emerge
> != --sync?

Suppose that you sync and then try to run an emerge --pretend command as a non-root user. The dependency calculation will not behave correctly, because the installed packages have not been moved will not satisfy the dependencies that they are supposed to satisfy.

> What is the reasoning to perform profile updates after emerge
> --sync?

So that the installed package state is brought into sync with the new tree. If you don't want that for some reason, simply use emerge --sync --package-moves=n and you'll get what you want.
Comment 16 Fabian Groffen gentoo-dev 2011-10-23 18:42:25 UTC
can we prevent this from happening again somehow?
Comment 17 Zac Medico gentoo-dev 2011-10-23 18:44:47 UTC
(In reply to comment #16)
> can we prevent this from happening again somehow?

I think the patch that's in git is good enough. Adding repoman support to check the updates would be a nice enhancement, but isn't as critical as the parse_updates fix that's in git.
Comment 19 Zac Medico gentoo-dev 2011-10-23 23:03:34 UTC
This is fixed in 2.1.10.31 and 2.2.0_alpha71.