Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 262281

Summary: emerge fails with IOError: [Errno 13] Permission denied
Product: Portage Development Reporter: Davide <kanta>
Component: CoreAssignee: Portage team <dev-portage>
Status: VERIFIED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: ARM   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Davide 2009-03-12 16:19:41 UTC
emerge fails with error:

emerge --pretend apache2

These are the packages that would be merged, in order:

Calculating dependencies  waiting for lock on /var/db/.pkg.portage_lockfile

Traceback (most recent call last):
  File "/usr/bin/emerge", line 40, in <module>
    retval = _emerge.emerge_main()
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 14387, in emerge_main
    myopts, myaction, myfiles, spinner)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 13304, in action_build
    mydepgraph = depgraph(settings, trees, myopts, myparams, spinner)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 4344, in __init__
    pkg_cache=self._pkg_cache)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 1041, in __init__
    vdb_lock = portage.locks.lockdir(vdb_path)
  File "/usr/lib/portage/pym/portage/locks.py", line 24, in lockdir
    return lockfile(mydir,wantnewlockfile=1)
  File "/usr/lib/portage/pym/portage/locks.py", line 107, in lockfile
    fcntl.lockf(myfd,fcntl.LOCK_EX)
IOError: [Errno 13] Permission denied
I'm using filesystem from stage3 armv5tel-softfloat-linux-gnueabi from experimental stages.

I have tried emerge --sync and I have issues related to lock

emerge --sync
waiting for lock on fd 3
emergelog(): [Errno 13] Permission denied
waiting for lock on fd 3
emergelog(): [Errno 13] Permission denied
waiting for lock on fd 3
emergelog(): [Errno 13] Permission denied
waiting for lock on fd 3
emergelog(): [Errno 13] Permission denied
>>> Starting rsync with rsync://217.19.16.188/gentoo-portage...
>>> Checking server timestamp ...
Welcome to the mirror.cambrium.nl archive.

This service is provided by:


attached my emerge info
emerge --info           
Portage 2.1.6.4 (default/linux/arm/2008.0, gcc-4.1.2, glibc-2.7-r2, 2.6.28-gentoo-r2 armv5tejl)
=================================================================
System uname: Linux-2.6.28-gentoo-r2-armv5tejl-ARM926EJ-S_rev_5_-v5l-with-glibc2.4
Timestamp of tree: Thu, 12 Mar 2009 01:45:01 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.2-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="arm"
CBUILD="armv5tel-softfloat-linux-gnueabi"
CFLAGS="-O2 -pipe"
CHOST="armv5tel-softfloat-linux-gnueabi"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe"
DISTDIR="/Gentoo/Portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.unina.it/pub/linux/distributions/gentoo http://mirror.switch.ch/ftp/mirror/gentoo/ http://gentoo.mirror.solnet.ch "
LDFLAGS="-Wl,-O1"
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"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl arm berkdb bzip2 cli cracklib crypt cups fortran gdbm gpm iconv ipv6 isdnlog midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl ssl sysfs tcpd unicode xorg zlib" 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga nv r128 radeon savage sis tdfx trident 	vga voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

 

Reproducible: Always

Steps to Reproduce:
It happens with every option and every package
Comment 1 Davide 2009-03-12 16:38:31 UTC
This is another output example

localhost procps-3.2.7 # emerge apache2
waiting for lock on fd 3
emergelog(): [Errno 13] Permission denied
waiting for lock on fd 3
emergelog(): [Errno 13] Permission denied
waiting for lock on /var/lib/gentoo/news/.news-gentoo.unread.portage_lockfile
Traceback (most recent call last):
  File "/usr/bin/emerge", line 40, in <module>
    retval = _emerge.emerge_main()
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 14385, in emerge_main
    display_news_notification(root_config, myopts)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 11391, in display_news_notification
    portdb, vardb, NEWS_PATH, UNREAD_PATH, repo, update=update)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 11576, in checkUpdatedNewsItems
    return manager.getUnreadItems( repo_id, update=update )
  File "//usr/lib/portage/pym/portage/news.py", line 153, in getUnreadItems
    self.updateItems(repoid)
  File "//usr/lib/portage/pym/portage/news.py", line 101, in updateItems
    unread_lock = lockfile(unread_filename, wantnewlockfile=1)
  File "/usr/lib/portage/pym/portage/locks.py", line 107, in lockfile
    fcntl.lockf(myfd,fcntl.LOCK_EX)
IOError: [Errno 13] Permission denied
waiting for lock on fd 4
emergelog(): [Errno 13] Permission denied
Comment 2 Zac Medico gentoo-dev 2009-03-12 17:40:02 UTC
The error looks a little different than bug 255101, but it should be fixed in 2.1.6.7. Please reopen if it's not fixed.

*** This bug has been marked as a duplicate of bug 255101 ***
Comment 3 Davide 2009-03-12 19:01:02 UTC
I have applied the patch and manually installed 2.1.6.7,
 * waiting for lock on fd 3 ...
 * [Errno 13] Permission denied
                                                                                                                   [ !! ]
emergelog(): [Errno 13] Permission denied
 * waiting for lock on fd 3 ...
 * [Errno 13] Permission denied
                                                                                                                   [ !! ]
emergelog(): [Errno 13] Permission denied
 * waiting for lock on /var/lib/gentoo/news/.news-gentoo.unread.portage_lockfile
 ...
 * [Errno 13] Permission denied
                                                                                                                   [ !! ]
Traceback (most recent call last):
  File "/usr/bin/emerge", line 40, in <module>
    retval = _emerge.emerge_main()
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 14668, in emerge_main
    display_news_notification(root_config, myopts)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 11638, in display_news_notification
    portdb, vardb, NEWS_PATH, UNREAD_PATH, repo, update=update)
  File "/usr/lib/portage/pym/_emerge/__init__.py", line 11824, in checkUpdatedNewsItems
    return manager.getUnreadItems( repo_id, update=update )
  File "/usr/lib/portage/pym/portage/news.py", line 153, in getUnreadItems
    self.updateItems(repoid)
  File "/usr/lib/portage/pym/portage/news.py", line 101, in updateItems
    unread_lock = lockfile(unread_filename, wantnewlockfile=1)
  File "/usr/lib/portage/pym/portage/locks.py", line 120, in lockfile
    fcntl.lockf(myfd, fcntl.LOCK_EX)
IOError: [Errno 13] Permission denied
 * waiting for lock on fd 4 ...
 * [Errno 13] Permission denied
                                                                                                                   [ !! ]

Different formatting some error
Comment 4 Davide 2009-03-12 19:01:53 UTC
Portage 12515-svn (default/linux/arm/2008.0, gcc-4.1.2, glibc-2.7-r2, 2.6.28-gentoo-r2 armv5tejl)
=================================================================
System uname: Linux-2.6.28-gentoo-r2-armv5tejl-ARM926EJ-S_rev_5_-v5l-with-glibc2.4
Timestamp of tree: Thu, 12 Mar 2009 13:15:01 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.2-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="arm ~arm ~x86"
CBUILD="armv5tel-softfloat-linux-gnueabi"
CFLAGS="-Os -pipe -march=armv5t -mtune=arm926ej-s -fomit-frame-pointer -I/usr/include/ -I/include/"
CHOST="armv5tel-softfloat-linux-gnueabi"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-Os -pipe -march=armv5t -mtune=arm926ej-s -fomit-frame-pointer -I/usr/include/ -I/include/"
DISTDIR="/Gentoo/Portage/distfiles"
FEATURES="buildpkg distlocks fixpackages nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.unina.it/pub/linux/distributions/gentoo http://mirror.switch.ch/ftp/mirror/gentoo/ http://gentoo.mirror.solnet.ch "
LDFLAGS="-L/usr/lib -L/lib"
MAKEOPTS="-j8"
PKGDIR="/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="/tmp/"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl arm berkdb bzip2 cli cracklib crypt cups fortran gdbm gpm iconv ipv6 isdnlog midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl ssl sysfs tcpd unicode xorg zlib" 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" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse touchscreen" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga nv r128 radeon savage sis tdfx trident 	vga voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 5 Davide 2009-03-12 19:51:35 UTC
I forgot to report that I'm root not a normal user
Comment 6 Zac Medico gentoo-dev 2009-03-12 23:57:44 UTC
It seems like all attempts to lock files inside /var are failing. What file system type are you using?
Comment 7 Davide 2009-03-13 18:58:36 UTC
I'm using ext2 and I'm on a USB pen drive.
Comment 8 Jonathan-Christofer Demay 2009-03-14 10:37:59 UTC
I see you're using a 2.6.28 linux kernel, did this bug appear after you've upgraded your kernel? If so, did you enable CONFIG_FILE_LOCKING? Linux kernel 2.6.28 adds this option which allows to remove
support for advisory locks (which disables the 'flock' system call, the F_GETLK, F_SETLK and F_SETLKW operations of 'fcntl' and NFS support).
Comment 9 Davide 2009-03-16 10:19:18 UTC
Ok, it works! The CONFIG_FILE_LOCKING=y solved the issue.

Thank you to everybody!
Comment 10 Davide 2009-03-16 10:19:40 UTC
Ok the merge works smoothly!