permission denied calling socketpair() from kubernetes container

7/29/2021

Trying to run some Python software in a docker container, I consistently get EPERM errors when creating a (abstract) unix domain socket using socket.socketpair():

% python3 -c 'import socket; socket.socketpair()'
Traceback (most recent call last):
   File "<string>", line 1, in <module
     import socket; socket.socketpair()
   File "/usr/lib/python3.9/socket.py", line 606, in socketpair
     a, b = _socket.socketpair(family, type, proto)
PermissionError: [Errno 13] Permission denied

Some of my other containers are running fine and able to create unix domain sockets, though they're all running on different nodes.

Is there a security capability that I should be adding to create unix domain sockets?

-- jelmer
kubernetes
python
socketpair

1 Answer

7/29/2021

looks like a user permission issue. Please, check if the user to apply that have the right permissions to do that task (socket creation).

-- RCat
Source: StackOverflow