Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 305787 - AttributeError: 'module' object has no attribute 'userpriv_groups'
Summary: AttributeError: 'module' object has no attribute 'userpriv_groups'
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: Sparc Linux
: High major (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 335925
  Show dependency tree
Reported: 2010-02-18 18:03 UTC by Noah McNallie
Modified: 2010-09-22 04:37 UTC (History)
1 user (show)

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

fix the AttributeError (userpriv_groups.patch,394 bytes, patch)
2010-02-18 18:47 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Noah McNallie 2010-02-18 18:03:53 UTC
* i'm not sure if this is considered sparc or sparc64 as the kernel is sparc64 yet userland is sparc, including python.

i have a fresh install, after emerging gentoo-sources and compiling my adequate kernel i'm trying to remove gentoo-sources as this machine is an ultra 30 300MHz sparc64 2MB L2 cache with 512MB and only 4.2GB of disk (only about 3.9 usable). So any freed up room is pretty much a requirement here.

ark ~ # emerge --unmerge gentoo-sources
Traceback (most recent call last):
  File "/usr/bin/emerge", line 31, in <module>
    from _emerge.main import emerge_main
  File "/usr/lib/portage/pym/_emerge/", line 17, in <module>
    import portage
  File "/usr/lib/portage/pym/portage/", line 8758, in <module>
    from portage.dbapi.vartree import vardbapi, vartree, dblink
  File "/usr/lib/portage/pym/portage/dbapi/", line 28, in <module>
    from import portage_gid, portage_uid, secpass
  File "/usr/lib/portage/pym/portage/", line 88, in <module>
    _("portage: 'portage' user or group missing.")) + "\n", noiselevel=-1)
  File "/usr/lib/portage/pym/portage/proxy/", line 31, in __call__
    result = object.__getattribute__(self, '_get_target')()
  File "/usr/lib/portage/pym/portage/proxy/", line 110, in _get_target
  File "/usr/lib/portage/pym/portage/proxy/", line 61, in _unregister_module_proxy
    object.__getattribute__(proxy, '_get_target')()
  File "/usr/lib/portage/pym/portage/proxy/", line 106, in _get_target
    target = getattr(sys.modules[name], attr_name)
AttributeError: 'module' object has no attribute 'userpriv_groups'
ark ~ #

i'm guessing this has to do with something i've done strange, as i'm not too familiar with linux since i've been using solaris/bsd the past years, i don't know what it is. i'm thinking it has something to do with missing groups for some reason? because the only other error i'm getting with this installation is on boot, udevd spits out a bunch of 'unknown group' messages to the console about group 'tape' and 'disk' and 'cdrom' and 'video' and some more. 

please help!


Reproducible: Always

Steps to Reproduce:
1. run emerge --unmerge gentoo-sources on my installation

Actual Results:  
i get the error described above

Expected Results:  
for it to unmerge gentoo-sources

Comment 1 Zac Medico gentoo-dev 2010-02-18 18:47:50 UTC
Created attachment 220205 [details, diff]
fix the AttributeError

Save as /tmp/userpriv_groups.patch and apply as follows:

  patch /usr/lib/portage/pym/portage/ /tmp/userpriv_groups.patch
Comment 2 Noah McNallie 2010-02-18 18:54:57 UTC
(In reply to comment #1)
> Created an attachment (id=220205) [details]
> fix the AttributeError
> Save as /tmp/userpriv_groups.patch and apply as follows:
>   patch /usr/lib/portage/pym/portage/ /tmp/userpriv_groups.patch

now i get this, should i change it back and add the group or keep the patch (though the unmerge seems to be working in progress)

portage: 'portage' user or group missing.
         For the defaults, line 1 goes into passwd, and 2 into group.
*** WARNING ***  For security reasons, only system administrators should be
*** WARNING ***  allowed in the portage group.  Untrusted users or processes
*** WARNING ***  can potentially exploit the portage group for attacks such as
*** WARNING ***  local privilege escalation.

Comment 3 Noah McNallie 2010-02-18 18:55:25 UTC
why are all my groups missing?
Comment 4 Zac Medico gentoo-dev 2010-02-18 18:57:50 UTC
Maybe /etc/group got corrupted somehow?
Comment 5 Zdenek Behan 2010-02-22 03:51:21 UTC
I bumped into this installing @system on a (very) bare system, basically from scratch.

I verified that the patch indeed fixes it; Also, I'd like to note that merely remerging @system will reconstruct the most basic /etc/passwd and /etc/group contents, as part of the post-install functions of certain ebuilds (not sure which ones), in fact most of the basic /etc configs can be reconstructed this way, so it would seem to make sense to make portage immune to deficiency of those (or similar) seemingly vital files in general, setting up some sane defaults and carrying on. (which is what the patch does for /etc/group)