Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 475496 - sys-apps/portage-2.2.0_alpha186 with FEATURES=xattr fails with system.nfs4_acl attribute
Summary: sys-apps/portage-2.2.0_alpha186 with FEATURES=xattr fails with system.nfs4_ac...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 472632
  Show dependency tree
 
Reported: 2013-07-02 12:27 UTC by Malte Starostik
Modified: 2013-07-26 07:10 UTC (History)
0 users

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


Attachments
Build log from sys-fs/lvm2-2.02.97-r1 (build.log,220.31 KB, text/plain)
2013-07-02 12:28 UTC, Malte Starostik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Malte Starostik 2013-07-02 12:27:46 UTC
When installing from a repository and thus $FILESDIR on NFS, doins fails.  $PORTAGE_TMPDIR and $ROOT do have proper xattr support and I'd prefer not to simply set FEATURES=-xattr. $FILESDIR should probably be exempted from this.

Reproducible: Always

Steps to Reproduce:
1. Setup a repository on a filesystem without xattr support
2. Try to install a package from that repo that installs a file from $FILESDIR

Actual Results:  
Portage fails here:

  File "/usr/lib64/portage/pym/portage/util/movefile.py", line 114, in _copyxattr
    raise OperationNotSupported("Filesystem containing file '%s' does not support extended attributes" % dest)


Expected Results:  
Package should be installed, ignoring the lack of xattr support for this kind of copy source.

This log entry:
 *      doins: /mnt/portage/repo/gentoo/sys-fs/lvm2/files/dmtab does not exist
is actually wrong:

# stat /mnt/portage/repo/gentoo/sys-fs/lvm2/files/dmtab
  File: ‘/mnt/portage/repo/gentoo/sys-fs/lvm2/files/dmtab’
  Size: 416             Blocks: 8          IO Block: 524288 regular file
Device: 18h/24d Inode: 13239814    Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-07-01 14:50:27.643233350 +0200
Modify: 2009-04-10 01:00:10.000000000 +0200
Change: 2012-06-07 14:47:01.490561735 +0200
 Birth: -


emerge --info:

Portage 2.2.0_alpha186 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.8.13-gentoo-jmb x86_64)
=================================================================
System uname: Linux-3.8.13-gentoo-jmb-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8300_@_2.83GHz-with-gentoo-2.2
KiB Mem:     2012484 total,   1117580 free
KiB Swap:    5242876 total,   5242876 free
Timestamp of tree: Tue, 02 Jul 2013 09:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.3-r3, 3.2.3-r2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.12.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.7 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo jmb
Installed sets: @jmb-nagios
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs --load-average=3.0"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3 -l3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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="/var/tmp"
PORTDIR="/mnt/portage/repo/gentoo"
PORTDIR_OVERLAY="/mnt/portage/repo/jmb"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="acl ads amd64 apache2 berkdb bzip2 caps cli cracklib crypt cxx dbus device-mapper dri fortran gdbm gpm iconv ipv6 jpeg kerberos ldap lzma mmx modules mudflap multilib ncurses nfs nls nptl openmp pam pam_krb5 pcre perl png readline sasl session smp snmp sse sse2 ssl tcpd threads udev unicode vim-syntax xattr xml zlib" ABI_X86="64" 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" 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" DRACUT_MODULES="lvm mdraid" ELIBC="glibc" 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 evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="x86_64" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="dummy fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident v4l vesa via vmware" 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, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Malte Starostik 2013-07-02 12:28:57 UTC
Created attachment 352450 [details]
Build log from sys-fs/lvm2-2.02.97-r1

Just as an example, problem is not specific to sys-fs/lvm2
Comment 2 Zac Medico gentoo-dev 2013-07-02 16:12:48 UTC
(In reply to Malte Starostik from comment #0)
> When installing from a repository and thus $FILESDIR on NFS, doins fails. 
> $PORTAGE_TMPDIR and $ROOT do have proper xattr support and I'd prefer not to
> simply set FEATURES=-xattr. $FILESDIR should probably be exempted from this.

The error from your build log refers to PORTAGE_TMPDIR though. I see no indication that it applies to FILESDIR.

> This log entry:
>  *      doins: /mnt/portage/repo/gentoo/sys-fs/lvm2/files/dmtab does not
> exist
> is actually wrong:

Yes, this message needs to be fixed.
Comment 3 Malte Starostik 2013-07-02 16:23:43 UTC
(In reply to Zac Medico from comment #2)
> (In reply to Malte Starostik from comment #0)
> > When installing from a repository and thus $FILESDIR on NFS, doins fails. 
> > $PORTAGE_TMPDIR and $ROOT do have proper xattr support and I'd prefer not to
> > simply set FEATURES=-xattr. $FILESDIR should probably be exempted from this.
> 
> The error from your build log refers to PORTAGE_TMPDIR though. I see no
> indication that it applies to FILESDIR.

Right, as

/usr/lib64/portage/pym/portage/util/movefile.py :114 reads:

    raise OperationNotSupported("Filesystem containing file '%s' does not support extended attributes" % dest)

So the error message complains about dest, while in fact in this case the exception seems to occur because the source doesn't allow reading EAs.
The ebuild line leading to this is:

   doins "${FILESDIR}"/dmtab

I'd *guess* xattr.get(src, attr) in line 109 of util/movefile.py errors out but the message in line 114 assumes it's the xattr.set() call:

xattr.set(dest, attr, xattr.get(src, attr))
Comment 4 Zac Medico gentoo-dev 2013-07-02 16:30:27 UTC
(In reply to Malte Starostik from comment #3)
> /usr/lib64/portage/pym/portage/util/movefile.py :114 reads:
> 
>     raise OperationNotSupported("Filesystem containing file '%s' does not
> support extended attributes" % dest)
> 
> So the error message complains about dest, while in fact in this case the
> exception seems to occur because the source doesn't allow reading EAs.
> The ebuild line leading to this is:
> 
>    doins "${FILESDIR}"/dmtab

This error in fact has nothing to do with FILESDIR. The problem is that doins copies the file to PORTAGE_TMPDIR where there is no xattr support.

> I'd *guess* xattr.get(src, attr) in line 109 of util/movefile.py errors out
> but the message in line 114 assumes it's the xattr.set() call:
> 
> xattr.set(dest, attr, xattr.get(src, attr))

The message correctly refers to line 114.
Comment 5 Malte Starostik 2013-07-02 16:48:13 UTC
(In reply to Zac Medico from comment #4)
> This error in fact has nothing to do with FILESDIR. The problem is that
> doins copies the file to PORTAGE_TMPDIR where there is no xattr support.

Well, PORTAGE_TMPDIR is /var/tmp/portage which is the same fs as / on this box.  Same thing happens when /var/tmp/portage is a tmpfs (also with xattr support).

# getfattr -d /var/tmp/portage/sys-fs/lvm2-2.02.97-r1/image/etc/dmtab                                                                                                                      
# setfattr -n user.test -v works /var/tmp/portage/sys-fs/lvm2-2.02.97-r1/image/etc/dmtab                                                                                                                             
# getfattr -d /var/tmp/portage/sys-fs/lvm2-2.02.97-r1/image/etc/dmtab                                                                                                                              
getfattr: Removing leading '/' from absolute path names
# file: var/tmp/portage/sys-fs/lvm2-2.02.97-r1/image/etc/dmtab
user.test="works"

Granted, my conclusion was wrong.  It's not because the source doesn't support xattr, it's actually because it has a particular xattr, system.nfs4_acl:
Changing the error message to

raise OperationNotSupported("Filesystem containing file '%s' does not support extended attributes (%s)" % (dest, attr))

yields

OperationNotSupported: Filesystem containing file '/var/tmp/portage/sys-fs/lvm2-2.02.97-r1/image//etc/dmtab' does not support extended attributes (system.nfs4_acl)
Comment 6 Zac Medico gentoo-dev 2013-07-02 17:01:43 UTC
As a workaround, you can set this in make.conf:

PORTAGE_XATTR_EXCLUDE="${PORTAGE_XATTR_EXCLUDE} system.*"
Comment 7 Malte Starostik 2013-07-02 17:09:05 UTC
Confirmed, Thanks!
Comment 8 Zac Medico gentoo-dev 2013-07-02 17:25:32 UTC
I've fixed the error message to include the attribute name:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c2f13f5539a08b8b4a9dc881226ed4632fbe24f8

At this point, I'm not sure whether it makes sense to exclude the entire system.* namespace. You might just want to exclude system.nfs4_* or something like that.
Comment 9 Zac Medico gentoo-dev 2013-07-07 21:02:51 UTC
(In reply to Zac Medico from comment #8)
> I've fixed the error message to include the attribute name:
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;
> h=c2f13f5539a08b8b4a9dc881226ed4632fbe24f8

This is fixed in 2.1.12.12 and 2.2.0_alpha187.

> At this point, I'm not sure whether it makes sense to exclude the entire
> system.* namespace. You might just want to exclude system.nfs4_* or
> something like that.

I'm still not sure if it makes sense to change the default PORTAGE_XATTR_EXCLUDE setting. At least the error message shows which attributes are causing problems, so people can easily adjust PORTAGE_XATTR_EXCLUDE themselves as necessary.
Comment 10 Zac Medico gentoo-dev 2013-07-12 19:53:11 UTC
I've added system.nfs4_acl to the default PORTAGE_XATTR_EXCLUDE setting:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c0645806fc61db76498c9ec8ccd4ba54d71eeb6a
Comment 11 Zac Medico gentoo-dev 2013-07-26 07:10:37 UTC
This is fixed in 2.1.13 and 2.2.0_alpha189.