Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 336085 - sys-apps/portage-2.2_rc75 (and rc74) throws AttributeError: 'NoneType' object has no attribute 'tokens'
Summary: sys-apps/portage-2.2_rc75 (and rc74) throws AttributeError: 'NoneType' object...
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
Depends on:
Blocks: 335925
  Show dependency tree
 
Reported: 2010-09-05 13:18 UTC by Dave Harrison
Modified: 2010-09-07 00:28 UTC (History)
0 users

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


Attachments
Applies check that atom.use is not None (portage-2.2_rc75-atom.use.patch,835 bytes, patch)
2010-09-05 13:20 UTC, Dave Harrison
Details | Diff
fix invalid highlight_violations() use argument (highlight_violations.patch,1.20 KB, patch)
2010-09-05 19:02 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Harrison 2010-09-05 13:18:31 UTC
Portage crashes with AttributeError @ line 294 in highlight_violations:
    if use and atom.use.tokens:
AttributeError: 'NoneType' object has no attribute 'tokens'

No idea why this happens, although I suspect an error in a package in my list of updates. This crash is exhibited on sys-apps/portage-2.2_rc75 and sys-apps/portage-2.2_rc74 and probably exists in previous versions.

Simple fix to check that atom.use exists by amending file "/usr/lib64/portage/pym/_emerge/resolver/slot_collision.py", line 294 to read:
	if use and atom.use and atom.use.tokens:


Reproducible: Always

Steps to Reproduce:
1. Recklessly unmask some* xfce packages.
2. emerge -uDavN world
3. Kaboom.

* Unmasked packages:
=xfce-base/libxfce4util-4.7.2
=xfce-base/xfce4-panel-4.7.2
=xfce-base/exo-0.5.3
=xfce-extra/thunar-volman-0.5.1
=xfce-base/thunar-1.1.1
Actual Results:  
See additional info.

Expected Results:  
(Obtained by applying above fix)
emerge --color n -uDavN world

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

Calculating dependencies  ..... done!
[ebuild   R   ] net-misc/iputils-20100418  USE="ipv6 ssl%* -SECURITY_HAZARD -doc -idn -static" 0 kB
[ebuild     U ] net-misc/wget-1.12-r2 [1.12] USE="ipv6 nls ssl -debug -idn -ntlm -static" 0 kB
[ebuild     U ] sys-fs/mdadm-3.1.4 [3.1.3] USE="-static" 0 kB
[ebuild     U ] sys-fs/lvm2-2.02.73-r1 [2.02.73] USE="lvm1 readline static (-clvm) (-cman) (-selinux)" 0 kB
[ebuild  N    ] xfce-base/garcon-0.1.1  USE="-debug" 0 kB
[ebuild     U ] media-video/transcode-1.1.5-r2 [1.1.5-r1] USE="X a52 aac alsa dvd iconv jpeg mmx mp3 mpeg ogg sdl sse sse2 theora truetype vorbis x264 xml xvid -3dnow (-altivec) -dv -imagemagick -lzo -mjpeg -nuv -oss -postproc -quicktime -v4l2" 0 kB
[ebuild     U ] xfce-base/exo-0.5.3 [0.3.107] USE="python -debug (-hal%*) (-libnotify%*)" 0 kB
[ebuild     U ] xfce-base/xfce4-panel-4.7.2 [4.6.4] USE="-debug (-startup-notification%*)" 0 kB
[ebuild     U ] x11-wm/compiz-0.8.6-r1 [0.8.6] USE="cairo dbus gtk svg -fuse -gconf% -gnome -kde" 0 kB
[ebuild     U ] x11-libs/libcompizconfig-0.8.4-r2 [0.8.4-r1] 0 kB
[ebuild     U ] x11-plugins/compiz-plugins-main-0.8.6-r1 [0.8.6] USE="-gconf% (-gnome%)" 0 kB
[ebuild     U ] dev-python/compizconfig-python-0.8.4-r2 [0.8.4-r1] 0 kB
[ebuild     U ] x11-plugins/compiz-plugins-extra-0.8.6-r1 [0.8.6] USE="-gconf% (-gnome%)" 0 kB

Total: 13 packages (11 upgrades, 1 new, 1 reinstall), Size of downloads: 0 kB

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

xfce-base/exo:0

  (xfce-base/exo-0.3.107, installed) pulled in by
    <xfce-base/exo-0.5 required by (xfce-extra/xfce4-places-plugin-1.2.0, installed)
    =xfce-base/exo-0.3* required by (xfce-base/xfdesktop-4.6.2, installed)
    >=xfce-base/exo-0.3.8[hal] required by (xfce-extra/thunar-volman-0.3.80, installed)
    (and 4 more with the same problems)

  (xfce-base/exo-0.5.3, ebuild scheduled for merge) pulled in by
    >=xfce-base/exo-0.5.1 required by (xfce-base/xfce4-panel-4.7.2, ebuild scheduled for merge)


It may be possible to solve this problem by using package.mask to
prevent one of those packages from being selected. However, it is also
possible that conflicting dependencies exist such that they are
impossible to satisfy simultaneously.  If such a conflict exists in
the dependencies of two different packages, then those packages can
not be installed simultaneously. You may want to try a larger value of
the --backtrack option, such as --backtrack=30, in order to see if
that will solve this conflict automatically.

For more information, see MASKED PACKAGES section in the emerge man
page or refer to the Gentoo Handbook.


!!! The following installed packages are masked:
- games-emulation/xmame-0.106 (masked by: package.mask)
/usr/portage/profiles/package.mask:
# Michael Sterrett <mr_bones_@gentoo.org> (17 Aug 2010)
# Mask for removal 20100916
# Development has moved to games-emulation/sdlmame;
# use that package instead.

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.


emerge --color n -uDavN world

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

Calculating dependencies  ....... done!
[ebuild   R   ] net-misc/iputils-20100418  USE="ipv6 ssl%* -SECURITY_HAZARD -doc -idn -static" 0 kB
[ebuild     U ] net-misc/wget-1.12-r2 [1.12] USE="ipv6 nls ssl -debug -idn -ntlm -static" 0 kB
[ebuild     U ] sys-fs/mdadm-3.1.4 [3.1.3] USE="-static" 0 kB
[ebuild     U ] sys-fs/lvm2-2.02.73-r1 [2.02.73] USE="lvm1 readline static (-clvm) (-cman) (-selinux)" 0 kB
[ebuild  N    ] xfce-base/garcon-0.1.1  USE="-debug" 0 kB
[ebuild     U ] media-video/transcode-1.1.5-r2 [1.1.5-r1] USE="X a52 aac alsa dvd iconv jpeg mmx mp3 mpeg ogg sdl sse sse2 theora truetype vorbis x264 xml xvid -3dnow (-altivec) -dv -imagemagick -lzo -mjpeg -nuv -oss -postproc -quicktime -v4l2" 0 kB
[ebuild     U ] xfce-base/exo-0.5.3 [0.3.107] USE="python -debug (-hal%*) (-libnotify%*)" 0 kB
[ebuild     U ] xfce-base/xfce4-panel-4.7.2 [4.6.4] USE="-debug (-startup-notification%*)" 0 kB
[ebuild     U ] x11-wm/compiz-0.8.6-r1 [0.8.6] USE="cairo dbus gtk svg -fuse -gconf% -gnome -kde" 0 kB
[ebuild     U ] x11-libs/libcompizconfig-0.8.4-r2 [0.8.4-r1] 0 kB
[ebuild     U ] x11-plugins/compiz-plugins-main-0.8.6-r1 [0.8.6] USE="-gconf% (-gnome%)" 0 kB
[ebuild     U ] dev-python/compizconfig-python-0.8.4-r2 [0.8.4-r1] 0 kB
[ebuild     U ] x11-plugins/compiz-plugins-extra-0.8.6-r1 [0.8.6] USE="-gconf% (-gnome%)" 0 kB

Total: 13 packages (11 upgrades, 1 new, 1 reinstall), Size of downloads: 0 kB
Traceback (most recent call last):
  File "/usr/bin/emerge", line 43, in <module>
    retval = emerge_main()
  File "/usr/lib64/portage/pym/_emerge/main.py", line 1672, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib64/portage/pym/_emerge/actions.py", line 293, in action_build
    mydepgraph.display_problems()
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 5152, in display_problems
    self._display_problems()
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 5173, in _display_problems
    self._show_slot_collision_notice()
  File "/usr/lib64/portage/pym/_emerge/depgraph.py", line 474, in _show_slot_collision_notice
    self._dynamic_config._slot_conflict_handler = slot_conflict_handler(self)
  File "/usr/lib64/portage/pym/_emerge/resolver/slot_collision.py", line 121, in __init__
    self._prepare_conflict_msg_and_check_for_specificity()
  File "/usr/lib64/portage/pym/_emerge/resolver/slot_collision.py", line 332, in _prepare_conflict_msg_and_check_for_specificity
    atom_str = highlight_violations(atom.unevaluated_atom, version_violated, use)
  File "/usr/lib64/portage/pym/_emerge/resolver/slot_collision.py", line 294, in highlight_violations
    if use and atom.use.tokens:
AttributeError: 'NoneType' object has no attribute 'tokens'
Comment 1 Dave Harrison 2010-09-05 13:20:27 UTC
Created attachment 246121 [details, diff]
Applies check that atom.use is not None
Comment 2 Sebastian Luther (few) 2010-09-05 17:12:46 UTC
(In reply to comment #1)
> Created an attachment (id=246121) [details]
> Applies check that atom.use is not None
> 

This patch just hides the real problem.

Please add --debug to your options and attach the part after "Starting slot conflict handler".
Comment 3 Zac Medico gentoo-dev 2010-09-05 19:02:14 UTC
Created attachment 246181 [details, diff]
fix invalid highlight_violations() use argument

If not perfect, I suspect this may be close to the correct fix. It's in git here:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5a8a4443dcc22bf0755c031ced4cef66b2cf370
Comment 4 Dave Harrison 2010-09-05 19:27:54 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Created an attachment (id=246121) [details] [details]
> > Applies check that atom.use is not None
> > 
> 
> This patch just hides the real problem.
> 
> Please add --debug to your options and attach the part after "Starting slot
> conflict handler".
> 

With --debug I get the same output after "Starting slot conflict handler". I get a _lot_ more output before hand. I can attach if necessary.

The atoms in question are:
=xfce-base/exo-0.3.107
=xfce-base/exo-0.5.3
Comment 5 Dave Harrison 2010-09-05 19:28:59 UTC
(In reply to comment #3)
> Created an attachment (id=246181) [details]
> fix invalid highlight_violations() use argument
> 
> If not perfect, I suspect this may be close to the correct fix. It's in git
> here:
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5a8a4443dcc22bf0755c031ced4cef66b2cf370
> 

I can confirm this patch returns the correct/expected response.
Comment 6 Zac Medico gentoo-dev 2010-09-06 17:31:57 UTC
It's cleaned up here, but behaves the same as the previous patch:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5a3222ee052dd924a275c4d1c8ae3c44dc684e57
Comment 7 Sebastian Luther (few) 2010-09-06 17:36:26 UTC
(In reply to comment #6)
> It's cleaned up here, but behaves the same as the previous patch:

There was another bug. It used to compare ppkg with x, but it must compare parent with x.

Comment 8 Zac Medico gentoo-dev 2010-09-07 00:28:06 UTC
This is fixed in 2.1.9.1 and 2.2_rc76.