socket.gaierror with python-gitlab package on some docker images

29 views
Skip to first unread message

Philipp Thuerwaechter

unread,
Jun 23, 2020, 4:24:00 AM6/23/20
to PyInstaller
Hello PyInstaller community,

We use PyInstaller with python3 to create an executable that access gitlab API with python-gitlab package.  We run this executable on several docker images.

On dockerhub python / openjdk images everything works fine, but on dockerhub node (debian based) there is a runtime error that shows up as soon as the first https request to the gitlab API is made. Looks like dns lookup is not initialised properly.

Traceback (most recent call last):
  File "site-packages/urllib3/connection.py", line 159, in _new_conn
  File "site-packages/urllib3/util/connection.py", line 61, in create_connection
  File "socket.py", line 918, in getaddrinfo
socket.gaierror: [Errno -2] Name or service not known


When running the code with python3 directly  on the node image after installing  python-gitlab package everything works fine. That fact makes me quit sure, that it is no issue with image itself but with PyInstaller

Does anyone has a clue how to solve that issue or how to dig further

Philipp Thuerwaechter

unread,
Jun 24, 2020, 7:43:40 AM6/24/20
to PyInstaller
After investigating, i guess it's an issue with different c libraries. the pure `node` image is not `debian` based, but alpine, therefore it uses muslc instead of glibc. when running on node:12-buster which is debian based, the binary runs

So in my case, i have to build and run the binary on a linux with the same c library.
Reply all
Reply to author
Forward
0 new messages