Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 416147 - eix-0.25.4 fails to install with chown: invalid user: ‘portage:portage’
Summary: eix-0.25.4 fails to install with chown: invalid user: ‘portage:portage’
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 OS X
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-15 20:48 UTC by Jinn Koriech
Modified: 2017-11-17 14:23 UTC (History)
0 users

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


Attachments
Build log during failed build (build.log,17.51 KB, text/plain)
2012-05-22 14:18 UTC, Jinn Koriech
Details
build log (build.log,58.15 KB, application/octet-stream)
2013-07-22 05:17 UTC, Andrew Udvare
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jinn Koriech 2012-05-15 20:48:07 UTC
Upgrading eix-0.25.4 on the OSX prefix fails with "chown: invalid user: ‘portage:portage’".

The core system doesn't have the portage user or group and the eix installation script doesn't handle this correctly.

OSX doesn't use /etc/passwd or /etc/group normally so adding the porage user & group there doesn't help.

First a suitable UID should be identified:
  dscl . -list /Users UniqueID | sort -k2 -n

From the previous command I note on my system that UID 250 is available, so issuing the following command creates the user.
  sudo dscl . -create /Users/portage UniqueID:250 

Finally eix-0.25.4 can be installed.
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-15 20:58:59 UTC
Please post your emerge --info
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-20 19:59:12 UTC
I wanted to see your emerge --info because the ebuild already protects against running chown in the prefix env. Need more info.
Comment 3 Jinn Koriech 2012-05-22 12:55:37 UTC
Let me know if you need further information from what's below.

$ sudo emerge --info
Password:
Portage 2.2.01.20430-prefix (prefix/darwin/macos/10.6/x64, gcc-4.2.1, unavailable, 11.4.0 x86_64)
=================================================================
System uname: Darwin-11.4.0-x86_64-i386-64bit
Timestamp of tree: Tue, 15 May 2012 15:51:44 +0000
app-shells/bash:      4.2_p20::gentoo_prefix
dev-lang/python:      2.7.1-r1::gentoo_prefix
dev-util/pkgconfig:   0.25-r2::gentoo_prefix
sys-devel/autoconf:   2.68::gentoo_prefix
sys-devel/automake:   1.11.5::gentoo_prefix
sys-devel/gcc-config: 1.5-r2::gentoo_prefix
sys-devel/libtool:    2.4.2::gentoo_prefix
sys-devel/make:       3.82::gentoo_prefix
Repositories: gentoo_prefix
Installed sets: 
ACCEPT_KEYWORDS="~x64-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-apple-darwin10"
CFLAGS="-O2 -pipe -march=nocona"
CHOST="x86_64-apple-darwin10"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/portage /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=nocona"
DISTDIR="/opt/gentoo/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles force-prefix news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-dead_strip_dylibs"
PKGDIR="/opt/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/opt/gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/opt/gentoo/var/tmp"
PORTDIR="/opt/gentoo/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="aqua bzip2 coreaudio cracklib cxx ipv6 mmx mmxext modules ncurses objc objc++ perl prefix readline sse sse2 ssl subversion x64-macos zlib" 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" 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, INSTALL_MASK, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-22 13:21:40 UTC
I wanted to see your emerge --info to ensure that you had USE=prefix (forced on for prefix profiles). As I indicated in comment #2, the ebuild has this code: "use prefix || chown portage:portage "${EROOT}var/cache/${PN}"" - so it should be no problem for you! (and it is no problem here)

Do you have the build.log to see what line failed?
Comment 5 Jinn Koriech 2012-05-22 14:18:23 UTC
Created attachment 312691 [details]
Build log during failed build
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-22 14:20:47 UTC
(In reply to comment #5)
> Created attachment 312691 [details]
> Build log during failed build

Ah, "fowners failed" is a different line. I wonder why it fails for you and not others.
Comment 7 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-22 14:24:05 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Created attachment 312691 [details]
> > Build log during failed build
> 
> Ah, "fowners failed" is a different line. I wonder why it fails for you and
> not others.

The portage fowners() code does this:

if [[ ${ret} != 0 && -n ${EPREFIX} && ${EUID} != 0 ]] ; then
    ewarn "fowners failure ignored in Prefix with non-privileged user"
    exit 0
fi

So, the big question, are you installing packages as root??!
Comment 8 Benda Xu gentoo-dev 2012-05-22 14:25:00 UTC
(In reply to comment #3)
> Let me know if you need further information from what's below.
> 
> $ sudo emerge --info

Hi, maybe it is because you are using Prefix with root priviledge.

Some part of portage (not tracked down though) uses portage uid to conclude if it is a Prefix. 

And as you said normal portage cannot behave well on MacOSX for it depends on /etc/passwd and /etc/group.
Comment 9 Benda Xu gentoo-dev 2012-05-22 14:26:04 UTC
Oh great, darkside has already tracked it down ;)
Comment 10 Jinn Koriech 2012-05-22 14:27:00 UTC
(In reply to comment #7)
> So, the big question, are you installing packages as root??!

Yes:
$ sudo emerge -v eix
Comment 11 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-22 14:32:16 UTC
(In reply to comment #10)
> (In reply to comment #7)
> > So, the big question, are you installing packages as root??!
> 
> Yes:
> $ sudo emerge -v eix

That is bad and not well tested/supported. You are on your own here.
Comment 12 Jinn Koriech 2012-05-22 15:08:24 UTC
(In reply to comment #11)
> That is bad and not well tested/supported. You are on your own here.

Okay - my mistake.  I see the install docs have no reference to sudo or root so it was my assumption that portage is a root level tool.

Will reset my env and be aware of this.

Thanks.
Comment 13 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-05-22 15:36:50 UTC
It is in the usecases doc, somethign like "a good use case is where you don't have root access"

Question: would a note on the install doc that said "remember, you don't need root access to use Gentoo Prefix" be helpful?
Comment 14 Jinn Koriech 2012-05-22 16:31:08 UTC
Yes - notes in the docs would make this clearer.

I'm looking at http://www.gentoo.org/proj/en/gentoo-alt/prefix/bootstrap-macos.xml, and I recall seeing in other docs some different types of NOTICE style boxes.

A notice would be very useful at the beginning of each of the prefix installation docs, so currently OSX, Solaris 10, FreeBSD, as linked from http://www.gentoo.org/proj/en/gentoo-alt/prefix/
Comment 15 Andrew Udvare 2013-07-22 05:16:26 UTC
Having this same issue with version 0.29.1.

emerge --info
Portage 2.2.01.22124-prefix (prefix/darwin/macos/10.8/x64, gcc-4.2.1, unavailable, 12.4.0 x86_64)
=================================================================
System uname: Darwin-12.4.0-x86_64-i386-64bit
Timestamp of tree: Sun, 21 Jul 2013 21:36:09 +0000
app-shells/bash:      4.2_p39-r1
dev-lang/python:      2.7.5, 3.3.2
dev-util/cmake:       2.8.11.1
dev-util/pkgconfig:   0.28
sys-devel/autoconf:   2.69
sys-devel/automake:   1.12.4
sys-devel/gcc-config: 1.8-r00.1
sys-devel/libtool:    2.4.2
sys-devel/make:       3.82-r4
Repositories: gentoo_prefix
ACCEPT_KEYWORDS="~x64-macos"
ACCEPT_LICENSE="*"
CBUILD="x86_64-apple-darwin12"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-apple-darwin12"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/Users/tatsh/gentoo/usr/portage/distfiles"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-dead_strip_dylibs"
MAKEOPTS="-j4"
PKGDIR="/Users/tatsh/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/Users/tatsh/gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/Users/tatsh/gentoo/var/tmp"
PORTDIR="/Users/tatsh/gentoo/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="aqua bash-completion cjk consolekit coreaudio cracklib cxx ipv6 mmx mmxext modules ncurses nls objc objc++ policykit prefix readline semantic-desktop sse sse2 ssl unicode vim-syntax x64-macos zlib" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi gzip headers limit_req limit_zone memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi flv gzip_static stub_status headers_more sub dav map perl mp4 fancyindex upload upload_progress push_stream" NGINX_MODULES_MAIL="smtp imap" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19" USERLAND="GNU" 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, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

Will attach build log.
Comment 16 Andrew Udvare 2013-07-22 05:17:03 UTC
Created attachment 353822 [details]
build log
Comment 17 Fabian Groffen gentoo-dev 2017-11-15 17:39:42 UTC
This is basically not really supported, sorry.
Comment 18 Benda Xu gentoo-dev 2017-11-17 14:23:23 UTC
The bug has actually been fixed.