Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 326079 - sys-apps/portage: backtrace in portage/__init__.py", line 228 with "OSError: [Errno 22] Invalid argument" with NFSv4
Summary: sys-apps/portage: backtrace in portage/__init__.py", line 228 with "OSError: ...
Status: RESOLVED DUPLICATE of bug 318847
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on: 338547
Blocks:
  Show dependency tree
 
Reported: 2010-06-28 22:18 UTC by Jack
Modified: 2010-11-02 01:13 UTC (History)
1 user (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 Jack 2010-06-28 22:18:07 UTC
I have just done an 'emerge -auDvN world' and it took many passes of 'emerge --resume'.  All failures are of the same type, but I don't think any single package failed more than once or twice.  I originally had ccache on and -j3, but removing ccache and changing to -j1 did not seem to make any difference.

The error was always right after 
  ">>> Completed installing mpg123-1.12.1 into /home/portage/tmpdir/portage/media-sound/mpg123-1.12.1/image/"
(for whatever package) and was a traceback such as:

Traceback (most recent call last):
File "/usr/bin/emerge", line 42, in <module>
retval = emerge_main()
File "/usr/lib64/portage/pym/_emerge/main.py", line 1410, in emerge_main
myopts, myaction, myfiles, spinner)
File "/usr/lib64/portage/pym/_emerge/actions.py", line 416, in action_build
retval = mergetask.merge()
File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 914, in merge
rval = self._merge()
File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1222, in _merge
self._main_loop()
File "/usr/lib64/portage/pym/_emerge/Scheduler.py", line 1362, in _main_loop
self._poll_loop()
File "/usr/lib64/portage/pym/_emerge/PollScheduler.py", line 134, in _poll_loop
handler(f, event)
File "/usr/lib64/portage/pym/_emerge/SpawnProcess.py", line 198, in _output_handler
self._unregister_if_appropriate(event)
File "/usr/lib64/portage/pym/_emerge/AbstractPollTask.py", line 27, in _unregister_if_appropriate
self.wait()
File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 42, in wait
self._wait_hook()
File "/usr/lib64/portage/pym/_emerge/AsynchronousTask.py", line 115, in _wait_hook
self._exit_listener_stack.pop()(self)
File "/usr/lib64/portage/pym/_emerge/EbuildPhase.py", line 70, in _ebuild_exit
_post_src_install_chost_fix(settings)
File "/usr/lib64/portage/pym/portage/package/ebuild/doebuild.py", line 1520, in _post_src_install_chost_fix
'build-info', 'CHOST'), chost + '\n')
File "/usr/lib64/portage/pym/portage/util/__init__.py", line 1020, in write_atomic
f.close()
File "/usr/lib64/portage/pym/portage/util/__init__.py", line 973, in close
apply_stat_permissions(f.name, os.stat(real_name))
File "/usr/lib64/portage/pym/portage/util/__init__.py", line 819, in apply_stat_permissions
mode=newstat.st_mode, **kwargs)
File "/usr/lib64/portage/pym/portage/util/__init__.py", line 910, in apply_secpass_permissions
stat_cached=stat_cached, follow_links=follow_links)
File "/usr/lib64/portage/pym/portage/util/__init__.py", line 745, in apply_permissions
os.chown(filename, uid, gid)
File "/usr/lib64/portage/pym/portage/__init__.py", line 228, in __call__
rval = self._func(*wrapped_args, **wrapped_kwargs)
OSError: [Errno 22] Invalid argument: '/home/portage/tmpdir/portage/media-sound/mpg123-1.12.1/build-info/CHOST.28249'

I don't know if all errors were identical, but they certainly looked close.  The number in the last line did seem to change.  I also tried adding --keep-going to the emerge, but either multiple packages failed, or it didn't really keep-going.  (I suspect the latter, but did not actually catch it in the act.)


Reproducible: Sometimes

Steps to Reproduce:
1. emerge -auDvN world (or later emerge --resume)
2.
3.

Actual Results:  
sample traceback above.

Expected Results:  
successful emerge

This is a mostly amd64 system with a few select ~amd64 packages..

emerge --info:

Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.2-r0, 2.6.32-gentoo-r7-02 x86_64)
=================================================================
System uname: Linux-2.6.32-gentoo-r7-02-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4000+-with-gentoo-1.12.13
Timestamp of tree: Sun, 27 Jun 2010 17:45:03 +0000
ccache version 2.4 [disabled]
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ABI="amd64"
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 skype-eula googleearth AdobeFlash-10 AdobeFlash-10.1"
ACCEPT_PROPERTIES="*"
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 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"
ARCH="amd64"
ASFLAGS_x86="--32"
AUTOCLEAN="yes"
CAMERAS="kodak ptp2"
CBUILD="x86_64-pc-linux-gnu"
CDEFINE_amd64="__x86_64__"
CDEFINE_x86="__i386__"
CFLAGS="-O2 -pipe"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLISION_IGNORE="/lib/modules"
COLORFGBG="0;15"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CVS_RSH="ssh"
CXXFLAGS="-O2 -pipe"
DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-x2VRfgKbYy,guid=d9647fd6c6103e83478a392300000dc1"
DEFAULT_ABI="amd64"
DISPLAY=":0.0"
DISTDIR="/usr/portage/distfiles"
EDITOR="/usr/bin/emacs"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--ask --verbose"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
FETCHCOMMAND="/usr/bin/wget -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
FLTK_DOCDIR="/usr/share/doc/fltk-1.1.9-r1/html"
GCC_SPECS=""
GDK_USE_XFT="1"
GENTOO_MIRRORS="http://distro.ibiblio.org/pub/linux/distributions/gentoo/       http://www.gtlib.gatech.edu/pub/gentoo  ftp://ftp.ussg.iu.edu/pub/linux/gentoo "
GS_LIB="/home/jack/.fonts"
GTK2_RC_FILES="/etc/gtk-2.0/gtkrc:/home/jack/.gtkrc-2.0::/home/jack/.kde4/share/config/gtkrc-2.0"
GTK_RC_FILES="/etc/gtk/gtkrc:/home/jack/.gtkrc::/home/jack/.kde4/share/config/gtkrc"
HOME="/home/jack"
HUSHLOGIN="FALSE"
INFOPATH="/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.20.1/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.3/info:/usr/share/info/emacs-23"
INPUT_DEVICES="evdev"
JAVAC="/home/jack/.gentoo/java-config-2/current-user-vm/bin/javac"
JAVA_HOME="/home/jack/.gentoo/java-config-2/current-user-vm"
JDK_HOME="/home/jack/.gentoo/java-config-2/current-user-vm"
KDE_FULL_SESSION="true"
KDE_MULTIHEAD="false"
KDE_SESSION_UID="501"
KDE_SESSION_VERSION="4"
KERNEL="linux"
KONSOLE_DBUS_SERVICE=":1.43"
KONSOLE_DBUS_SESSION="/Sessions/11"
LANGUAGE=""
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LDFLAGS="-Wl,-O1"
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe.sh %s"
LIBDIR_amd64="lib64"
LIBDIR_amd64_fbsd="lib64"
LIBDIR_ppc="lib32"
LIBDIR_ppc64="lib64"
LIBDIR_sparc32="lib32"
LIBDIR_sparc64="lib64"
LIBDIR_x86="lib32"
LIBDIR_x86_fbsd="lib32"
LOGNAME="jack"
LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
MAIL="/var/mail/jack"
MAKEOPTS="-j1"
MANPATH="/home/jack/.gentoo/java-config-2/current-user-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.20.1/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.4.3/man:/etc/java-config/system-vm/man/:/usr/lib64/php5/man/:/opt/opera/share/man"
MULTILIB_ABIS="amd64 x86"
MULTILIB_STRICT_DENY="64-bit.*shared object"
MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"
MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage)"
NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
NOCOLOR="true"
OPENGL_PROFILE="nvidia"
PAGER="/usr/bin/less"
PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.3:/usr/games/bin:/usr/local/bin:/usr/local/gnome2/bin:/usr/sbin:/usr/local/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/gnome2/bin:/usr/sbin:/usr/local/sbin:/usr/X11R6/bin"
PKGDIR="/usr/portage/packages"
PORTAGE_ARCHLIST="ppc x86-openbsd ppc-openbsd ppc64 x86-winnt x86-fbsd ppc-aix alpha arm x86-freebsd s390 amd64 arm-linux x86-macos x64-openbsd ia64-hpux hppa x86-netbsd amd64-linux ia64-linux x86 sparc-solaris x64-freebsd sparc64-solaris x86-linux x64-macos sparc m68k-mint ia64 mips ppc-macos x86-interix hppa-hpux amd64-fbsd x64-solaris mips-irix m68k sh x86-solaris sparc-fbsd"
PORTAGE_BINHOST_CHUNKSIZE="3000"
PORTAGE_BIN_PATH="/usr/lib64/portage/bin"
PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
PORTAGE_CONFIGROOT="/"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="log warn error"
PORTAGE_ELOG_MAILFROM="portage@localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SYSTEM="save_summary echo"
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
PORTAGE_GID="250"
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_IONICE_COMMAND="ionice -c 3 -p ${PID}"
PORTAGE_NICENESS="19"
PORTAGE_PYM_PATH="/usr/lib64/portage/pym"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_RSYNC_RETRIES="3"
PORTAGE_SYNC_STALE="30"
PORTAGE_TMPDIR="/home/portage/tmpdir"
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/sunrise"
PROFILEHOME=""
PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"
PWD="/home/jack"
PYTHONDONTWRITEBYTECODE="1"
QT_PLUGIN_PATH="/home/jack/.kde4/lib64/kde4/plugins/:/usr/lib64/kde4/plugins/"
RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}""
ROOT="/"
ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.3"
RPMDIR="/usr/portage/rpm"
RUBY_TARGETS="ruby18"
SANE_CONFIG_DIR="/etc/sane.d"
SESSION_MANAGER="local/ffortso4:@/tmp/.ICE-unix/6167,unix/ffortso4:/tmp/.ICE-unix/6167"
SHELL="/bin/bash"
SHLVL="4"
STAGE1_USE="multilib nptl nptlonly unicode"
STRIGI_PLUGIN_PATH="/usr/lib64/strigi:"
SYMLINK_LIB="yes"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
TERM="xterm"
USB_DEVFS_PATH="/dev/bus/usb"
USE="X aac acl alsa amd64 at4 berkdb bzip2 cairo cli cracklib crypt cups cxx dbus dri dvd emacs exif ffmpeg fftw firefox foomaticdb fortran gcj gdbm gimp glut gphoto2 gpm gtk hal iconv java joystick jpeg jpeg2k kde lm mad midi mmx modules motif mp3 mpeg_mplayer mudflap multilib ncurses nptl nptlonly nsplugin nvidia ogg opengl openmp pam pcre pdf perl png ppds pppd python qt3support quicktime readline reflection scanner sdl sensors session spell spl sse sse2 ssl svg sysfs tcpd tiff timidity truetype unicode usb v4l v4l2 vorbis xcomposite xorg xulrunner xvmc 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 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" CAMERAS="kodak ptp2" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nv vesa nvidia" 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" 
USER="jack"
USERLAND="GNU"
USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CAMERAS CROSSCOMPILE_OPTS DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES NGINX_MODULES_HTTP NGINX_MODULES_MAIL QEMU_SOFTMMU_TARGETS QEMU_USER_TARGETS RUBY_TARGETS SANE_BACKENDS USERLAND VIDEO_CARDS XTABLES_ADDONS"
USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"
VIDEO_CARDS="nv vesa nvidia"
WINDOWID="25402366"
WINDOWPATH="7"
XAUTHORITY="/home/jack/.Xauthority"
XCURSOR_THEME="default"
XDG_CONFIG_DIRS="/etc/xdg"
XDG_DATA_DIRS="/usr/share:/usr/local/share:/usr/share"
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"
XZ_OPT="--memory=max"
_="/usr/bin/emerge"

I suppose this could be classed as minor, since just repeating the emerge eventually succeeds, but I'd love to figure out if there is actually something wrong - even if it is only with my own setup :-)
Comment 1 Jack 2010-06-28 23:58:18 UTC
After the latest sync, emerge was OK for dev-libs/libtasn1, app-misc/gentoo, and dev-java/java-config but failed for www-client/chromium-bin.  I'll leave the build dir around for a bit, in case there might be any evidence there that could be useful.
Comment 2 Zac Medico gentoo-dev 2010-06-29 07:24:11 UTC
It looks like a filesystem issue. What type of filesystem are you using for /home/portage/tmpdir/?
Comment 3 Zac Medico gentoo-dev 2010-06-29 07:25:35 UTC
Maybe fsck or reboot will help.
Comment 4 Jack 2010-06-29 12:13:37 UTC
ext3 over ntfs3.  The switch from ntfs2 to 3 was relatively recent, and I did have some issues when I first set it up, but I thought it was stable now.  Perhaps not quite?

I'll try fsck and reboot.
Comment 5 Jack 2010-06-29 22:57:57 UTC
Correction - it's ntfs4, not 3.  fsck on the actual volume showed no problems.  rebooted ntfs client and server machines, and the next emerge succeeded.  However, I'll avoid claiming success until I run through another lengthy set of emerges, since this is not a 100% repeatable failure.
Comment 6 Jack 2010-07-13 17:48:05 UTC
Packages are still failing (mostly just once, but up to four times) and then succeeding on emerge --resume.  I haven't identified any pattern in which packages.  Both ntfs client and server have been rebooted, and fsck has not shown any problems.  If I can get enough free space on a local partition, I'll move tmpdir locally, just in case it's some strange timing or locking issue with ntfs4.
Comment 7 Zac Medico gentoo-dev 2010-07-14 01:10:31 UTC
It's almost certainly related to ntfs4 since nobody else has ever reported this problem.
Comment 8 Jack 2010-07-14 14:15:34 UTC
OK.  At this point I'm ready to believe that ntfs4 is the culprit.  I'm actually also willing to believe that it's not an inherent problem with ntfs4, but just something specific to my configuration.  How do I troubleshoot?  Should the bug get reassigned to ntfs4?  Close it for now as invalid, follow-up in the forums, and reopen if/when I find the actual cause?
Comment 9 Zac Medico gentoo-dev 2010-07-14 15:47:07 UTC
(In reply to comment #0)
> File "/usr/lib64/portage/pym/portage/util/__init__.py", line 1020, in
> write_atomic
> f.close()
> File "/usr/lib64/portage/pym/portage/util/__init__.py", line 973, in close
> apply_stat_permissions(f.name, os.stat(real_name))
> File "/usr/lib64/portage/pym/portage/util/__init__.py", line 819, in
> apply_stat_permissions
> mode=newstat.st_mode, **kwargs)
> File "/usr/lib64/portage/pym/portage/util/__init__.py", line 910, in
> apply_secpass_permissions
> stat_cached=stat_cached, follow_links=follow_links)
> File "/usr/lib64/portage/pym/portage/util/__init__.py", line 745, in
> apply_permissions
> os.chown(filename, uid, gid)
> File "/usr/lib64/portage/pym/portage/__init__.py", line 228, in __call__
> rval = self._func(*wrapped_args, **wrapped_kwargs)
> OSError: [Errno 22] Invalid argument:
> '/home/portage/tmpdir/portage/media-sound/mpg123-1.12.1/build-info/CHOST.28249'

The traceback suggests that the error may be triggered by an issue in uid/gid mapping in the chown call. The uid and gid come from a stat call on the existing CHOST file in the same directory, so it's strange that those wouldn't work as arguments to a chown call on another file in the same directory.
Comment 10 Jack 2010-07-14 16:02:09 UTC
Thank you for (silently) correcting my repeated typo.  Yes - it's NFSv4 not ntfs any flavor.  That was really sloppy of me.

However, nfs4 requires idmap to deal with mapping uids (and also gids I presume) and if anything, that's the place where my configuration may be problematic.  However, I would expect it to behave consistently, even if not correctly due to misconfiguration, so that may be where to look, especially if root is ever involved (although I do have no_root_squash set on that file system.)

Looking into that directory from the last failed emerge CHOST and all other files are 0644 root:root.  Also -I see CHOST, not CHOST.nnnnn.  Is that just an artifact of the error message?
Comment 11 Zac Medico gentoo-dev 2010-07-14 16:29:48 UTC
(In reply to comment #10)
> Looking into that directory from the last failed emerge CHOST and all other
> files are 0644 root:root.  Also -I see CHOST, not CHOST.nnnnn.  Is that just an
> artifact of the error message?

That's expected because there's some code that automatically removes the CHOST.nnnnn file when an error occurs. It's strange that chown was invoked, because the CHOST.nnnnn file should have inherited root:root ownership from the emerge process, and the apply_permissions function skips the chown call when the uid/gid returned from stat indicate that the chown call will be unnecessary.
Comment 12 Matt Turner gentoo-dev 2010-11-02 01:00:55 UTC
The bug for you is 318847. :)

I ran into the same issue.

*** This bug has been marked as a duplicate of bug 318847 ***