Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 683040

Summary: sys-apps/portage-2.3.62 - traceback - python3.6/asyncio/", line 290, in create_unix_server - PermissionError: [Errno 13] Permission denied
Product: Portage Development Reporter: Fab <netbox253>
Component: UnclassifiedAssignee: Portage team <dev-portage>
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 683434    
Attachments: emerge output
emerge --info

Description Fab 2019-04-10 15:41:58 UTC

I got a portage traceback while updating a system.
The setup is particular, but it works fine like that since years.

PORTDIR is mounted readonly over NFS from local network.
DISTDIR and PKGDIR are also mounted in the same way, except that they are mounted readwrite.

/usr/src/linux is also mounted readonly from NFS.

The system where I got the traceback is using some pre-built packages, the build farm
and the target system are sharing 99.99 % of the same configuration.
Both systems also share the same pre-built kernel.

Here is the traceback :
> Traceback (most recent call last):
>   File "/usr/lib/portage/python3.6/", line 231, in <module>
>     asyncio.start_unix_server(s.handle_proxy_conn, sys.argv[1], loop=loop))
>   File "/usr/lib64/python3.6/asyncio/", line 468, in run_until_complete
>     return future.result()
>   File "/usr/lib64/python3.6/asyncio/", line 151, in start_unix_server
>     return (yield from loop.create_unix_server(factory, path, **kwds))
>   File "/usr/lib64/python3.6/asyncio/", line 212, in coro
>     res = func(*args, **kw)
>   File "/usr/lib64/python3.6/asyncio/", line 290, in create_unix_server
>     sock.bind(path)
> PermissionError: [Errno 13] Permission denied

I will attach full emerge output below.

Reproducible: Always
Comment 1 Fab 2019-04-10 15:43:21 UTC
Created attachment 572384 [details]
emerge output
Comment 2 Fab 2019-04-10 15:44:58 UTC
Created attachment 572386 [details]
emerge --info
Comment 3 Zac Medico gentoo-dev 2019-04-10 17:40:57 UTC
This traceback is in the code for FEATURES=network-sandbox-proxy (also for FEATURES=distcc). It's trying to bind a socket in ${PORTAGE_TMPDIR}. It looks like we need to move this socket into ${PORTAGE_TMPDIR}/portage since that's were all portage tempfiles are normally stored and permission problems in the parent ${PORTAGE_TMPDIR} directory are very common.
Comment 4 Zac Medico gentoo-dev 2019-04-10 18:03:43 UTC
The fix will be similar to the fix for bug 671808:
Comment 6 Larry the Git Cow gentoo-dev 2019-04-15 23:04:54 UTC
The bug has been referenced in the following commit(s):

commit 63b509e6d2c0db4343b255455fda1aa3b666bd9c
Author:     Zac Medico <>
AuthorDate: 2019-04-11 03:07:09 +0000
Commit:     Zac Medico <>
CommitDate: 2019-04-15 23:03:54 +0000

    socks5: use ${PORTAGE_TMPDIR}/portage (bug 683040)
    Write temporary socket files in ${PORTAGE_TMPDIR}/portage,
    since writing files directly in ${PORTAGE_TMPDIR} is generally
    Signed-off-by: Zac Medico <>

 lib/portage/util/ | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)