Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 574130 - Misleading error message "Repoman: Need user access"
Summary: Misleading error message "Repoman: Need user access"
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-07 20:19 UTC by Thomas Deutschmann (RETIRED)
Modified: 2022-07-12 03:18 UTC (History)
5 users (show)

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 Thomas Deutschmann (RETIRED) gentoo-dev 2016-02-07 20:19:21 UTC
1) Login as user

2) mkdir ~/repos && cd ~/repos

3) git clone https://github.com/gentoo/gentoo.git

4) cd net-misc/wget

5) repoman -d full

You will get the error message:

> RepoMan scours the neighborhood...
> 
> *** the local copy of metadata.dtd needs to be refetched, doing that now
> 
> 
> Repoman: Need user access

The problem is that repoman wants to use a current metadata.dtd from system's portage tree... but the user running repoman isn't allowed to update /usr/portage/distfiles/metadata.dtd...

An error message telling you need _user_ access doesn't make sense for me.
Comment 1 Austin English (RETIRED) gentoo-dev 2017-02-16 17:34:29 UTC
I just hit this today as well. I had blown away my distfiles directory to free up some space, then got a traceback:

*** the local copy of metadata.xsd needs to be refetched, doing that now

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/repoman", line 44, in <module>
    repoman_main(sys.argv[1:])
  File "/usr/lib64/python3.4/site-packages/repoman/main.py", line 117, in repoman_main
    vcs_settings, mydir, env)
  File "/usr/lib64/python3.4/site-packages/repoman/scanner.py", line 191, in __init__
    "metadata_xsd": get_metadata_xsd(self.repo_settings),
  File "/usr/lib64/python3.4/site-packages/repoman/metadata.py", line 127, in get_metadata_xsd
    fetch_metadata_xsd(metadata_xsd, repo_settings.repoman_settings)
  File "/usr/lib64/python3.4/site-packages/repoman/metadata.py", line 78, in fetch_metadata_xsd
    prefix='metadata.xsd.', dir=destdir)
  File "/usr/lib64/python3.4/tempfile.py", line 278, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags)
  File "/usr/lib64/python3.4/tempfile.py", line 207, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/var/portage/distfiles/metadata.xsd.sk5yg0dc'

after sudo mkdir /var/portage/distfiles/ && sudo chown -R portage:portage /var/portage/distfiles/, I reran it, and now get:
Repoman: Need user access
Comment 2 Austin English (RETIRED) gentoo-dev 2017-02-16 17:38:18 UTC
(In reply to Austin English from comment #1)
> after sudo mkdir /var/portage/distfiles/ && sudo chown -R portage:portage
> /var/portage/distfiles/, I reran it, and now get:
> Repoman: Need user access

Ah, permissions were 755, changed to 775 so portage group had write access, now it's working.

The error message could still be more helpful, though.
Comment 3 orionbelt2 2020-02-13 03:18:16 UTC
Does this mean that the solution to this error is to add user to the portage group? Wouldn't this be somewhat unsafe?

In https://wiki.gentoo.org/wiki/Repoman#.22Need_user_access.22 it is said that another option is to adjust filesystem permissions. Does this mean making the metadata.dtd file writeable by user? But if so, on my system the file is located in /usr/portage/metadata/dtd/metadata.dtd and is owned by root:

% ls -ld /usr/portage/metadata/dtd/metadata.dtd
-rw-r--r-- 1 root root 4421 Jan  9 12:09 /usr/portage/metadata/dtd/metadata.dtd

% ls -ld /usr/portage/metadata/dtd/
drwxr-xr-x 2 root root 4096 Feb 12 15:55 /usr/portage/metadata/dtd/

% ls -ld /usr/portage/metadata/
drwxr-xr-x 9 root root 4096 Feb 12 15:55 /usr/portage/metadata/

So adding user to portage would be of no help!

My distfiles are in /usr/portage/distfiles and portage has group ownership there:

% ls -ld /usr/portage/distfiles
drwxrwxr-x 3 root portage 217088 Feb 13 03:40 /usr/portage/distfiles

But, unlike comment 0, there is no metadata.dtd file in there:

% ls -l /usr/portage/distfiles/metadata.dtd 
ls: cannot access '/usr/portage/distfiles/metadata.dtd': No such file or directory
Comment 4 Alexander Tsoy 2020-02-13 10:08:23 UTC
(In reply to orionbelt2 from comment #3)
You can set DISTDIR variable to something writable by user:
DISTDIR=/tmp repoman ...
Comment 5 orionbelt2 2020-02-16 20:39:30 UTC
(In reply to Alexander Tsoy from comment #4)
> (In reply to orionbelt2 from comment #3)
> You can set DISTDIR variable to something writable by user:
> DISTDIR=/tmp repoman ...

Thanks, that worked!
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:18:41 UTC
repoman support has been removed per bug 835013.

Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.