I
I´m using Gentoo for more than one year and had no problems until I emerged the latest version of portage (2.0.51.22-r1). Just before updating it I did my usual weekly sync & emerge -p world. Then, after I emerged portage, I can´t emerge anything: any try, on any ebuild starts, does the MD5 checks, then fails invariably with: /usr/lib/portage/bin/ebuild.sh: line 1686: /mnt/data/linux/gentoo/portage/xxx/yyy/zzz-0.0.ebuild: Permission denied emerge -p works. I´m always emerging as su root, the permissions to portage storage (which is on another partition than the root partition) are ok (full access for root). I restored my system from a backup copy of my root partition, did the emerge sync, tried an emerge using the installed version of portage (it works!), updated portage to the latest version and ... once again can´t emerge anything afterwards. For now I stick with the old version of portage, which works fine, but I don´t like the idea of not being able to update to the latest available version of an installed package. Any ideas? eugenu2@yahoo.com Reproducible: Always Steps to Reproduce: 1.emerge sync 2.emerge portage 3.emerge any other package Actual Results: /usr/lib/portage/bin/ebuild.sh: line 1686: /mnt/data/linux/gentoo/portage/xxx/yyy/zzz-0.0.ebuild: Permission denied Expected Results: what portage should do: emerge packages!
Does it work with FEATURES="-sandbox"? What about with FEATURES="-userpriv"?
Also, could you attach the output of emerging with the --debug parameter please?
(In reply to comment #1) > Does it work with FEATURES="-sandbox"? What about with FEATURES="-userpriv"? -sandbox was already used. It works after I added -userpriv. Does it mean that the bug is solved?
(In reply to comment #2) > Also, could you attach the output of emerging with the --debug parameter > please? Without FEATURES=-userpriv the output is as follows: --------------------------------------------------------------------------------- emerge --debug man Calculating dependencies Parent: None Depstring: sys-apps/man Candidates: ['sys-apps/man'] ebuild: sys-apps/man-1.6-r1 binpkg: None - Parent: ebuild / sys-apps/man-1.6-r1 merge Depstring: !bootstrap? ( sys-devel/patch ) !bootstrap? ( sys-devel/patch ) sys-process/cronbase >=sys-apps/groff-1.18 nls? ( sys-devel/gettext ) Exiting... None ...done! >>> emerge (1 of 1) sys-apps/man-1.6-r1 to / + dyn_clean + '[' GNU == BSD ']' + '[' GNU == Darwin ']' + rm -rf /var/tmp/portage/man-1.6-r1/image + hasq keeptemp autoaddcvs autoconfig collision-protect cvs distlocks nostrip sfperms strict userpriv + local x + local me=keeptemp + shift + for x in '"$@"' + '[' autoaddcvs == keeptemp ']' + for x in '"$@"' + '[' autoconfig == keeptemp ']' + for x in '"$@"' + '[' collision-protect == keeptemp ']' + for x in '"$@"' + '[' cvs == keeptemp ']' + for x in '"$@"' + '[' distlocks == keeptemp ']' + for x in '"$@"' + '[' nostrip == keeptemp ']' + for x in '"$@"' + '[' sfperms == keeptemp ']' + for x in '"$@"' + '[' strict == keeptemp ']' + for x in '"$@"' + '[' userpriv == keeptemp ']' + return 1 + rm -rf /var/tmp/portage/man-1.6-r1/temp + hasq keepwork autoaddcvs autoconfig collision-protect cvs distlocks nostrip sfperms strict userpriv + local x + local me=keepwork + shift + for x in '"$@"' + '[' autoaddcvs == keepwork ']' + for x in '"$@"' + '[' autoconfig == keepwork ']' + for x in '"$@"' + '[' collision-protect == keepwork ']' + for x in '"$@"' + '[' cvs == keepwork ']' + for x in '"$@"' + '[' distlocks == keepwork ']' + for x in '"$@"' + '[' nostrip == keepwork ']' + for x in '"$@"' + '[' sfperms == keepwork ']' + for x in '"$@"' + '[' strict == keepwork ']' + for x in '"$@"' + '[' userpriv == keepwork ']' + return 1 + rm -rf /var/tmp/portage/man-1.6-r1/.unpacked + rm -rf /var/tmp/portage/man-1.6-r1/.compiled + rm -rf /var/tmp/portage/man-1.6-r1/.tested + rm -rf /var/tmp/portage/man-1.6-r1/.installed + rm -rf /var/tmp/portage/man-1.6-r1/.packaged + rm -rf /var/tmp/portage/man-1.6-r1/build-info + rm -rf /var/tmp/portage/man-1.6-r1/work + '[' -f /var/tmp/portage/man-1.6-r1/.unpacked ']' ++ find /var/tmp/portage/man-1.6-r1 -mindepth 1 -maxdepth 1 + '[' -z '' ']' + rmdir /var/tmp/portage/man-1.6-r1 + true + set +x >>> md5 files ;-) man-1.6.ebuild >>> md5 files ;-) man-1.5p.ebuild >>> md5 files ;-) man-1.6-r1.ebuild >>> md5 files ;-) files/man-1.5m-groff-1.18.patch >>> md5 files ;-) files/man-1.5p-search-order.patch >>> md5 files ;-) files/man-1.5p-parallel-make.patch >>> md5 files ;-) files/man-1.5p-defmanpath-symlinks.patch >>> md5 files ;-) files/makewhatis.cron >>> md5 files ;-) files/digest-man-1.6 >>> md5 files ;-) files/man-1.6-message-order.patch >>> md5 files ;-) files/digest-man-1.5p >>> md5 files ;-) files/digest-man-1.6-r1 >>> md5 files ;-) files/man-1.6-parallel-make.patch >>> md5 src_uri ;-) man-1.6.tar.gz + dyn_setup + pkg_setup + return + set +x /usr/lib/portage/bin/ebuild.sh: line 1686: /mnt/data/linux/gentoo/portage/sys-apps/man/man-1.6-r1.ebuild: Permission denied !!! ERROR: sys-apps/man-1.6-r1 failed. ---------------------------------------------------------------------------------
Are any of the directories or the file under /mnt/data/linux/gentoo/portage/sys-apps/man/man-1.6-r1.ebuild not globally readable or executable? It would seem so. If you need them to be inaccessable to "other", make sure that they are accessible to the portage user and group.
(In reply to comment #5) > Are any of the directories or the file > under /mnt/data/linux/gentoo/portage/sys-apps/man/man-1.6-r1.ebuild not > globally readable or executable? It would seem so. If you need them to be > inaccessable to "other", make sure that they are accessible to the portage > user and group. If you can reproduce this error after setting the correct permissions on your files then please re-open. Portage needs read/execute access to all files in PORTDIR and read/write/execute access to DISTDIR if you want portage to fetch as a non root user.
Answer to comments 5 & 6: On my system the "portage" user and group own PORTDIR and DISTDIR and the permissions are according to messages 6. As long as userpriv is set in FEATURES any emerge fails with the same message (see bug description). I believe it's not a problem of file/directory permissions as long as this issue occured only after installing portage 2.0.51.22-r1. The permissions were the same before updating portage and after, and they are the same now. I gave up following this bug after I got answers about file permissions which, anyway, I kind of expected. Now I just unset userpriv and I can emerge everything. Thanks anyway!
Created attachment 65362 [details] script that prints file permissions recursively Please run this script on one of the ebuilds with permission problems (such as /mnt/data/linux/gentoo/portage/sys-apps/man/man-1.6-r1.ebuild) and post the output. (In reply to comment #7) > > I believe it's not a problem of file/directory permissions as long as this > issue occured only after installing portage 2.0.51.22-r1. The permissions > were the same before updating portage and after, and they are the same now. > It's possible that, though your permissions may be strictly correct, they cause a bug in portage to manifest itself.
userpriv was not working very well in 2.0.51.19. Portage was running as root at times when it should have been running as portage. Hence, while you're thinking it is a regression it is more likely to be incorrect file permissions.
(In reply to comment #7) > I believe it's not a problem of file/directory permissions as long as this > issue occured only after installing portage 2.0.51.22-r1. The permissions > were the same before updating portage and after, and they are the same now. If you are still experiencing this problem, please run the script from comment #8 on your ebuild and attach the output. Please reopen if you still believe the bug exists.
Bug still exists. Output of script is: drwxr-xr-x 20 root root 464 Aug 24 14:34 / drwxr-xr-x 8 root root 192 Aug 27 20:39 /mnt drwxr-xr-x 7 root root 152 Jul 10 21:02 /mnt/data drwx-w--w- 7 root root 168 Jun 18 14:27 /mnt/data/linux drwxr-xr-x 7 root root 408 Sep 2 20:46 /mnta/linux/gentoo drwxr-xr-x 149 portage portage 4424 Sep 2 18:36 /mnt/data/linux/gentoo/portage drwxr-xr-x 199 portage portage 5504 Sep 2 18:36 /mnt/data/linux/gentoo/portage/sys-apps drwxr-xr-x 3 portage portage 288 Sep 2 23:24 /mnt/data/linux/gentoo/portage/sys-apps/man -rw-r--r-- 1 portage portage 2799 Aug 22 19:40 /mnt/data/linux/gentoo/portage/sys-apps/man/man-1.6a.ebuild
drwx-w--w-
drwx-w--w- 7 root root 168 Jun 18 14:27 /mnt/data/linux The portage user doesn't have read access.
Changed permissions of upper directory to read/execute. Problem solved. drwxr-xr-x 20 root root 464 Aug 24 14:34 / drwxr-xr-x 8 root root 192 Aug 27 20:39 /mnt drwxr-xr-x 7 root root 152 Jul 10 21:02 /mnt/data drwxr-xr-x 7 root root 168 Jun 18 14:27 /mnt/data/linux drwxr-xr-x 7 root root 408 Sep 2 20:46 /mnt/data/linux/gentoo drwxr-xr-x 149 portage portage 4424 Sep 2 18:36 /mnt/data/linux/gentoo/portage drwxr-xr-x 199 portage portage 5504 Sep 2 18:36 /mnt/data/linux/gentoo/portage/sys-apps drwxr-xr-x 3 portage portage 288 Sep 2 23:55 /mnt/data/linux/gentoo/portage/sys-apps/man -rw-r--r-- 1 portage portage 2799 Aug 22 19:40 /mnt/data/linux/gentoo/portage/sys-apps/man/man-1.6a.ebuild