Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485100 - sys-apps/portage-2.2.1 fails to fetch with automounted DISTDIR
Summary: sys-apps/portage-2.2.1 fails to fetch with automounted DISTDIR
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 907949
Blocks: 377365
  Show dependency tree
 
Reported: 2013-09-16 13:20 UTC by Josh Parsons
Modified: 2023-06-21 19:13 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Parsons 2013-09-16 13:20:30 UTC
I have my portage DISTDIR automounted from an nfs server at /misc/distfiles; /usr/portage/distfiles is a symlink, and DISTDIR is not explicitly set. This configuration worked fine on all versions of portage I have used for some years, and worked with 2.1.12.2. Since upgrading to 2.2.1, portage will not use the automounted DISTDIR.

Reproducible: Always

Steps to Reproduce:
1. Configure portage as described
2. emerge gimp
Actual Results:  
>>> Emerging (1 of 1) media-gfx/gimp-2.8.6
!!! makedirs('/misc/distfiles/')
!!! Directory Not Found: DISTDIR='/misc/distfiles'
!!! Fetching will fail!
!!! No write access to '/misc/distfiles'
!!! statvfs('/misc/distfiles'): [Errno 2] No such file or directory: '/misc/distfiles'
!!! File gimp-2.8.6.tar.bz2 isn't fetched but unable to get it.
 * Fetch failed for 'media-gfx/gimp-2.8.6', Log file:
 *  '/var/tmp/portage/media-gfx/gimp-2.8.6/temp/build.log'


Expected Results:  
normal emerge output

I suspect that what's going on is that portage is using stat() to test whether /misc/distfiles exists, and then using mkdir() to open it if not. That's incorrect, as you shouldn't be mkdir()ing in a directory that is mounted with -t autofs (like /misc).

Here is the /proc/mounts line for /misc on my system:

/etc/autofs/auto.misc /misc autofs rw,relatime,fd=6,pgrp=28483,timeout=300,minproto=5,maxproto=5,indirect 0 0
Comment 1 Stefan Schmid 2023-06-06 05:46:58 UTC
I have the same or at least a very similar error.

If the TMPDIR is in a directory that is mounted on demand (in my case via automount of systemd, which is nothing else than autofs), then it comes to the following message:
> /var/tmp/portage is not writable.
> Likely cause is that you've mounted it as readonly.

"sys-apps/portage" still has a problem with version "3.0.45.3-r2::gentoo" when directories are included via "Autofs" only on demand.
Comment 2 Mike Gilbert gentoo-dev 2023-06-06 17:45:15 UTC
(In reply to Stefan Schmid from comment #1)

That's bug 890812.
Comment 3 Larry the Git Cow gentoo-dev 2023-06-14 19:23:26 UTC
The bug has been referenced in the following commit(s):

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

commit f5ae3c4b198f0d5543afbdd36d923422cd451272
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2023-06-06 18:15:36 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2023-06-14 19:21:55 +0000

    fetch: do not rely on os.stat() for DISTDIR write test
    
    If DISTDIR is an automount, os.stat() will not trigger it.
    Just try to create a file instead.
    
    Bug: https://bugs.gentoo.org/485100
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 lib/portage/package/ebuild/fetch.py | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
Comment 4 Larry the Git Cow gentoo-dev 2023-06-21 19:13:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9502761c5bef818dbec90f062909d46dc22289df

commit 9502761c5bef818dbec90f062909d46dc22289df
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-06-21 19:09:31 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-06-21 19:11:05 +0000

    sys-apps/portage: add 3.0.49
    
    Closes: https://bugs.gentoo.org/485100
    Cloess: https://bugs.gentoo.org/592880
    Closes: https://bugs.gentoo.org/596664
    Closes: https://bugs.gentoo.org/631490
    Closes: https://bugs.gentoo.org/764365
    Closes: https://bugs.gentoo.org/793992
    Closes: https://bugs.gentoo.org/890812
    Closes: https://bugs.gentoo.org/905660
    Closes: https://bugs.gentoo.org/907949
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.49.ebuild | 296 +++++++++++++++++++++++++++++++++
 2 files changed, 297 insertions(+)