Red5d / docker-autocompose

Generate a docker-compose yaml definition from a running container
1.76k stars 197 forks source link

PermissionError: [Errno 1] Operation not permitted #26

Closed raftersvk closed 2 years ago

raftersvk commented 2 years ago

Hello,

I am trying to use your script to compose an existing ocntainer, but I get the following error : pi@raspberrypi:~ $ sudo docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose 4b3cc393a269 Fatal Python error: init_interp_main: can't initialize time Python runtime state: core initialized PermissionError: [Errno 1] Operation not permitted

Current thread 0xb6f4e390 (most recent call first):

do you have any idea what could be the issue here ?
Velkas commented 2 years ago

Getting the same error with latest image.

Running on a rpi4, raspbian 10 (buster)

sudo docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/red5d/docker-autocompose <container1> <container2> <container3> <container4> <container5>
Traceback (most recent call last):
  File "/usr/src/app/./autocompose.py", line 3, in <module>
    import sys, argparse, pyaml, docker
  File "/usr/local/lib/python3.10/site-packages/docker-5.0.3-py3.10.egg/docker/__init__.py", line 2, in <module>
    from .api import APIClient
  File "/usr/local/lib/python3.10/site-packages/docker-5.0.3-py3.10.egg/docker/api/__init__.py", line 2, in <module>
    from .client import APIClient
  File "/usr/local/lib/python3.10/site-packages/docker-5.0.3-py3.10.egg/docker/api/client.py", line 6, in <module>
    import requests
  File "/usr/local/lib/python3.10/site-packages/requests-2.26.0-py3.10.egg/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/usr/local/lib/python3.10/site-packages/urllib3-1.26.7-py3.10.egg/urllib3/__init__.py", line 7, in <module>
    import logging
  File "/usr/local/lib/python3.10/logging/__init__.py", line 57, in <module>
    _startTime = time.time()
PermissionError: [Errno 1] Operation not permitted

To expand on this, I also tried building the image instead of pulling, and that failed:

Traceback (most recent call last):
  File "/usr/src/app/./setup.py", line 1, in <module>
    from setuptools import setup, find_packages
  File "/usr/local/lib/python3.10/site-packages/setuptools/__init__.py", line 18, in <module>
    from setuptools.dist import Distribution
  File "/usr/local/lib/python3.10/site-packages/setuptools/dist.py", line 32, in <module>
    from setuptools.extern.more_itertools import unique_everseen
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "/usr/local/lib/python3.10/site-packages/setuptools/extern/__init__.py", line 52, in create_module
    return self.load_module(spec.name)
  File "/usr/local/lib/python3.10/site-packages/setuptools/extern/__init__.py", line 37, in load_module
    __import__(extant)
  File "/usr/local/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.py", line 1, in <module>
    from .more import *  # noqa
  File "/usr/local/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/more.py", line 5, in <module>
    from concurrent.futures import ThreadPoolExecutor
  File "/usr/local/lib/python3.10/concurrent/futures/__init__.py", line 8, in <module>
    from concurrent.futures._base import (FIRST_COMPLETED,
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 7, in <module>
    import logging
  File "/usr/local/lib/python3.10/logging/__init__.py", line 57, in <module>
    _startTime = time.time()
PermissionError: [Errno 1] Operation not permitted
Red5d commented 2 years ago

Looks like that could be an issue with the libseccomp2 library not being updated on the host: https://community.home-assistant.io/t/migration-to-2021-7-fails-fatal-python-error-init-interp-main-cant-initialize-time/320648

Velkas commented 2 years ago

Fantastic find! Thank you for the link-- the thread helped me resolve the issue and the container runs perfectly now.

raftersvk commented 2 years ago

after updating my distribution it all works. thanks