Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 811930 - sys-apps/portage-9999 unable to utilise 'portage' user home directory
Summary: sys-apps/portage-9999 unable to utilise 'portage' user home directory
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-07 06:32 UTC by Joe Kappus
Modified: 2021-09-12 18:06 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,433.32 KB, text/x-log)
2021-09-07 06:32 UTC, Joe Kappus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Kappus 2021-09-07 06:32:51 UTC
Created attachment 737968 [details]
build.log

Annoying misspelled warning prints on every single package. 

/var/lib/portage/home exists on my system, it's owned by portage:portage, and I even tried to chmod 777 it. 

Caused by: https://github.com/gentoo/portage/commit/97f1f6a42796c91bf1eba628605c4ef641dcc532

Others reporting issue:

https://forums.gentoo.org/viewtopic-t-1141912.html
https://github.com/gentoo/portage/pull/736#issuecomment-913996124

Build log attached.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-07 06:41:58 UTC
…misspelled?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-09-07 06:56:37 UTC
Could you be kind enough to add some print()s to figure out which part doesn't work on your system?
Comment 3 Joe Kappus 2021-09-07 08:08:51 UTC
probably ugly way to go about it but I added this and then merged a package: 

print (os.path.expanduser("~portage"))
print (os.access(os.path.expanduser("~portage"), os.R_OK))
print (os.access(os.path.expanduser("~portage"), os.W_OK))
print (os.access(os.path.expanduser("~portage"), os.X_OK))

Results were:

/var/lib/portage/home
True
False
True

So it can't write to that directory. To verify permissions I then ran these:

stat /var/lib/portage/home/
  File: /var/lib/portage/home/
  Size: 39              Blocks: 0          IO Block: 4096   directory
Device: 10301h/66305d   Inode: 838586180   Links: 2
Access: (0777/drwxrwxrwx)  Uid: (  250/ portage)   Gid: (  250/ portage)
Access: 2020-12-27 21:32:19.462124992 -0500
Modify: 2021-05-11 05:21:51.837840580 -0400
Change: 2021-09-07 02:14:26.829968504 -0400
 Birth: 2020-12-27 21:32:19.462124992 -0500

stat /var/lib/portage/
  File: /var/lib/portage/
  Size: 94              Blocks: 0          IO Block: 4096   directory
Device: 10301h/66305d   Inode: 537354957   Links: 3
Access: (2755/drwxr-sr-x)  Uid: (  250/ portage)   Gid: (  250/ portage)
Access: 2018-01-20 16:04:43.000000000 -0500
Modify: 2021-09-07 02:38:32.083304527 -0400
Change: 2021-09-07 02:38:32.083304527 -0400
 Birth: 2020-03-06 16:16:58.644445645 -0500
Comment 4 Mike Gilbert gentoo-dev 2021-09-07 15:00:26 UTC
(In reply to Joe Kappus from comment #3)

Was the process running as the "portage" user when those tests were performed?
Comment 5 Joe Kappus 2021-09-07 16:40:36 UTC
emerge was run as root, all the processes it spawned were under portage user.
Comment 6 Mike Gilbert gentoo-dev 2021-09-07 17:06:10 UTC
Hmm... maybe interference from sys-apps/sandbox?
Comment 7 Joe Kappus 2021-09-07 17:27:06 UTC
I don't think so. With FEATURES="-sandbox" it still happens.
Comment 8 Don O 2021-09-07 17:29:57 UTC
>stat /var/lib/portage/
> ...
>Access: (2755/drwxr-sr-x)  Uid: (  250/ portage)   Gid: (  250/ portage)

/var/lib/portage on my system is owned by root:portage, 2755 perms. 


>Access: 2018-01-20 16:04:43.000000000 -0500
>Modify: 2021-09-07 02:38:32.083304527 -0400
>Change: 2021-09-07 02:38:32.083304527 -0400
> Birth: 2020-03-06 16:16:58.644445645 -0500

Stats seem a little screwy, accessed on 2018 but not birthed until 2020 ???
Comment 9 Mike Gilbert gentoo-dev 2021-09-07 17:41:38 UTC
(In reply to Joe Kappus from comment #7)
> I don't think so. With FEATURES="-sandbox" it still happens.

Try with FEATURES="-usersandbox".
Comment 10 Mike Gilbert gentoo-dev 2021-09-07 17:43:16 UTC
(In reply to Don O from comment #8)
> Stats seem a little screwy, accessed on 2018 but not birthed until 2020 ???

Probably the filesystem is mounted with the "noatime" option.
Comment 11 Joe Kappus 2021-09-07 17:52:58 UTC
Don, I mount with noatime so that's expected to see some weirdness like this. This install was copied from another drive so presumably birth time is when it was copied into the new drive, which happened after the last time I mounted with atimes.

Mike, needed both -sandbox and -usersandbox in FEATURES, but it finally merged without warning. So I guess it is sandbox related....
Comment 12 Mike Gilbert gentoo-dev 2021-09-07 18:00:59 UTC
(In reply to Joe Kappus from comment #11)
> Mike, needed both -sandbox and -usersandbox in FEATURES, but it finally
> merged without warning. So I guess it is sandbox related....

Ok, that makes sense. /var/lib/portage/home is probably not configured as a writable path in the sandbox config, so libsandbox denies any attempt to write there.

In any case, the offending commit was reverted earlier today.

https://gitweb.gentoo.org/proj/portage.git/commit/?id=3ccfd9a375d34b2c2731064ea4bc9e1a4b8946f3