Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 797226 - Gracefully bailout if repo directory is not writable/immutable
Summary: Gracefully bailout if repo directory is not writable/immutable
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-20 23:08 UTC by Joshua Kinard
Modified: 2021-06-20 23:08 UTC (History)
0 users

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


Attachments
Traceback from emerge --sync when repo dir is immutable (gentoo-emerge-sync-fails-on-immutable-dir-20210620.txt,3.62 KB, text/plain)
2021-06-20 23:08 UTC, Joshua Kinard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Kinard gentoo-dev 2021-06-20 23:08:41 UTC
Created attachment 717252 [details]
Traceback from emerge --sync when repo dir is immutable

For my setup, I host the main Gentoo repo on a FreeBSD-based NAS server that my Gentoo systems all mount over NFSv4.  My fast amd64 dev box handles syncing the tree when needed, while the slower systems just read from the mount point where the repo is mounted (/usr/portage).  On my amd64 machine, the repo is not always mounted, so if I accidentally run "emerge --sync" when it is unmounted, it'll attempt to populate a new repo locally.  I fixed this by setting the mountpoint to be immutable, but emerge does not handle this terribly well, throwing out a traceback.

The core error is actually caused by rsync trying to create a hidden file at the mountpoint:
rsync: [Receiver] mkdir "/usr/portage/.tmp-unverified-download-quarantine" failed: Operation not permitted (1)
rsync error: error in file IO (code 11) at main.c(784) [Receiver=3.2.3]

emerge then bails out with a traceback at this point:
  File "/usr/lib/python3.9/site-packages/portage/util/_async/AsyncFunction.py", line 39, in _run
    result = self.target(*(self.args or []), **(self.kwargs or {}))

Followed by a longer traceback list, which is attached to this bug.

emerge should instead catch the failure from rsync and fail in a more graceful manner, perhaps by showing a friendly error message and possibly even testing for writeability or immutability and displaying an error message tailored for that case.