Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 330645 - sys-apps/portage-2.1.8.3 - AttributeError: 'module' object has no attribute 'autouse'
Summary: sys-apps/portage-2.1.8.3 - AttributeError: 'module' object has no attribute '...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: AMD64 Linux
: High normal with 1 vote (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 335925
  Show dependency tree
 
Reported: 2010-07-31 18:24 UTC by Ricardo I. Vieitez
Modified: 2010-09-04 08:07 UTC (History)
2 users (show)

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


Attachments
What happens when building dev-lang/php (php.log,10.14 KB, text/plain)
2010-07-31 18:29 UTC, Ricardo I. Vieitez
Details
What happens building dev-lang/python-2.6.5-r3 (python.log,5.13 KB, text/plain)
2010-07-31 18:29 UTC, Ricardo I. Vieitez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo I. Vieitez 2010-07-31 18:24:35 UTC
When I try to build some applications, something similar to the following happens, and the error I get in such cases is
* The specific snippet of code:
*           [[ ${WANT_AUTOMAKE} == "latest" ]] && die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE}";


Reproducible: Didn't try

Steps to Reproduce:

Actual Results:  
The package isn't built.

Expected Results:  
The package in question should be built.

britannia portage-2.1.8 # emerge --info automake
Portage 15709-svn (hardened/linux/amd64/10.0, gcc-4.3.5, glibc-2.11.2-r0, 2.6.33-hardened x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.33-hardened-x86_64-Intel-R-_Xeon-R-_CPU_L5520_@_2.27GHz-with-gentoo-2.0.1
Timestamp of tree: Thu, 29 Jul 2010 02:30:01 +0000
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.4
dev-util/cmake:      2.8.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.9.6-r2, 1.10.2, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.3.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
virtual/os-headers:  2.6.34
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/qmail/alias /var/qmail/control /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php4/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php4/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php4/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict stricter unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_US es es_AR es_ES fr fr_FR de de_DE"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/hardened-development"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X509 acl amd64 apache2 branding bzip2 cgi cjk cleartype cli cracklib crypt cxx dri fastcgi ftp gd gdbm geoip gif gmp gpm gzip hardened hash iconv idn imagemagick imap inifile ipv6 ithreads javascript jpeg json justify ldap lzma maildir mbox memlimit mime mmx mng modules mono mudflap multilib mysql mysqli ncurses nls nptl nptlonly nptls ntlm openmp openssl pam pcre perl pg-intdatetime php pic png posix postgres pppd python qmail-spp readline reflection savedconfig session sharedmem smp spl sse sse2 ssl ssp svg sysfs syslog tcpd threads tidy tiff truetype unicode urandom vhosts vpopmail xattr xinetd xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest log_forensic" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US es es_AR es_ES fr fr_FR de de_DE" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

sys-devel/automake-1.9.6-r2 was built with the following:
USE="(multilib)" 
CFLAGS="-O2 -pipe -march=nocona -fomit-frame-pointer"
CXXFLAGS="-O2 -pipe -march=nocona -fomit-frame-pointer"
LDFLAGS="-Wl,-O1"


sys-devel/automake-1.10.2 was built with the following:
USE="(multilib)" 
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1"


sys-devel/automake-1.11.1 was built with the following:
USE="(multilib)" 
CFLAGS="-O2 -pipe -march=nocona -fomit-frame-pointer"
CXXFLAGS="-O2 -pipe -march=nocona -fomit-frame-pointer"
LDFLAGS="-Wl,-O1"
Comment 1 Ricardo I. Vieitez 2010-07-31 18:29:04 UTC
Created attachment 240863 [details]
What happens when building dev-lang/php
Comment 2 Ricardo I. Vieitez 2010-07-31 18:29:40 UTC
Created attachment 240865 [details]
What happens building dev-lang/python-2.6.5-r3
Comment 3 Sebastian Luther (few) 2010-08-03 15:42:20 UTC
What's your active python version and why are you running an old portage svn version? Try installing a recent portage version using the ebuilds.

How are the backtraces in the logs related to the error message in your initial comment?
Comment 4 Zac Medico gentoo-dev 2010-08-03 18:56:55 UTC
Maybe this helps:

http://www.gentoo.org/proj/en/portage/doc/manually-fixing-portage.xml
Comment 5 Ricardo I. Vieitez 2010-08-03 22:19:54 UTC
No, it doesn't help.

Anyway, I can re-emerge portage successfully.

It's very strange what has happened there. Maybe I should reinstall it completely?
Comment 6 Zac Medico gentoo-dev 2010-08-04 01:31:48 UTC
Maybe its a permissions issue in /usr/lib64/portage/pym or a subdirectory. If you remove 'userpriv' from FEATURES then it might make the problem go away.
Comment 7 Brian Harring (RETIRED) gentoo-dev 2010-08-04 02:21:40 UTC
Look in the tracebacks- note that w/in portage.ebuild.config, it's attempting a from portage.data import portage_gid... works it way down to an accessing of portage.ebuild.config.autouse; however, since portage.ebuild.config isn't fully imported yet (meaning attributes aren't there in full yet), this goes boom.

It's a cyclical import; remove the cycle and you'll see what the actual complaint is.

That's bug #1.  Bug #2 is addressed via telling us what your PORTAGE_USERNAME and PORTAGE_GROUPNAME env vars are, and checking

python -c 'import pwd;print pwd.getpwnam(the-username)'
and
python -c 'import grp;print grp.getgname(the-groupname)'
Comment 8 Zac Medico gentoo-dev 2010-08-04 02:38:33 UTC
(In reply to comment #7)
The cyclical import is fixed here:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d2026628046cf3849fce81f58567e27788450d6
Comment 9 Ricardo I. Vieitez 2010-08-04 02:40:04 UTC
Thanks. "find /usr/lib64/portage/pym -perm -o+r | xargs chmod o+r" did the
trick.

However, note that files under /usr/lib64/portage/pym should be world (or at
least) portage readable, so that userpriv feature works out-of-the-box.
Comment 10 Brian Harring (RETIRED) gentoo-dev 2010-08-04 02:48:20 UTC
(In reply to comment #9)
> Thanks. "find /usr/lib64/portage/pym -perm -o+r | xargs chmod o+r" did the
> trick.

I very strongly doubt this fixed it- it's a no-op; you're searching for files that have o+r, than chmod o+r them.  Basically, you're chmod'ing everything that already has those perms.

Only theory I can come up with is that the chmod'ing of everything somehow triggered recompilation of the bytecode, but that's... not how it should work (it's mtime based, not ctime).
Comment 11 Ricardo I. Vieitez 2010-08-04 03:32:30 UTC
Oops, sorry, it was -type -o-r

That is the problem of remembering the actual command
Comment 12 Ricardo I. Vieitez 2010-08-04 13:13:01 UTC
Well, apart from the suggestion below I think it is fixed.

For people coming here, the (correct) commands to issue, as root, are:

find /usr/lib64/portage/pym -perm -o-r | xargs chmod o+r
find /usr/lib64/portage/pym -type d -perm -o-x | xargs chmod o+x
Comment 13 Zac Medico gentoo-dev 2010-08-04 17:44:31 UTC
I'll re-open this until the fix is released, since it affects portage-2.1.8.3 which is the latest stable. I'll paste the traceback here so it's easier for people to compare:

  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 38, in __getitem__
    return object.__getattribute__(self, '_get_target')()[key]
  File "/usr/lib64/portage/pym/portage/__init__.py", line 568, in _get_target
    return _get_legacy_global(name)
  File "/usr/lib64/portage/pym/portage/_legacy_globals.py", line 35, in _get_legacy_global
    portage.db = portage.create_trees(**kwargs)
  File "/usr/lib64/portage/pym/portage/__init__.py", line 527, in create_trees
    config_incrementals=portage.const.INCREMENTALS)
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 31, in __call__
    result = object.__getattribute__(self, '_get_target')()
  File "/usr/lib64/portage/pym/portage/proxy/lazyimport.py", line 105, in _get_target
    __import__(name)
  File "/usr/lib64/portage/pym/portage/package/ebuild/config.py", line 29, in <module>
    from portage.data import portage_gid
  File "/usr/lib64/portage/pym/portage/data.py", line 89, in <module>
    _("portage: 'portage' user or group missing.")) + "\n", noiselevel=-1)
  File "/usr/lib64/portage/pym/portage/proxy/objectproxy.py", line 31, in __call__
    result = object.__getattribute__(self, '_get_target')()
  File "/usr/lib64/portage/pym/portage/proxy/lazyimport.py", line 110, in _get_target
    _unregister_module_proxy(name)
  File "/usr/lib64/portage/pym/portage/proxy/lazyimport.py", line 61, in _unregister_module_proxy
    object.__getattribute__(proxy, '_get_target')()
  File "/usr/lib64/portage/pym/portage/proxy/lazyimport.py", line 106, in _get_target
    target = getattr(sys.modules[name], attr_name)
AttributeError: 'module' object has no attribute 'autouse'
Comment 14 Zac Medico gentoo-dev 2010-08-23 06:32:11 UTC
This is in 2.2_rc68, but I'll leave this bug open until it's in an unmasked version.
Comment 15 Zac Medico gentoo-dev 2010-09-04 08:07:27 UTC
This is fixed in 2.1.9.