linuxserver / docker-diskover

A Docker container for the Diskover space mapping application
GNU General Public License v3.0
76 stars 16 forks source link

Diskover spits out errors: ModuleNotFoundError: No module named 'six' / 'pkg_resources' #38

Closed rogue780 closed 3 years ago

rogue780 commented 4 years ago

linuxserver.io


Expected Behavior

Diskover should start up and begin indexing without errors

Current Behavior

Diskover throws constant errors about missing python libraries

Steps to Reproduce

Use the below docker-compose.yml file and run docker-compose up

Environment

OS: Debian 10 4.19.0-9-amd64 CPU architecture: x86_64 How docker service was installed: From official docker repo Docker version 19.03.11, build 42e35e61f3

Command used to create docker container (run/create/compose/screenshot)

version: '2'
services:
  diskover:
    image: linuxserver/diskover
    container_name: diskover
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - ES_HOST=elasticsearch
      - ES_PORT=9200
      - ES_USER=elastic
      - ES_PASS=password
      - RUN_ON_START=true
      - USE_CRON=true
    volumes:
      - ./config:/config
      - /mnt/btrfs:/data
    ports:
      - 8983:80
      - 9181:9181
      - 9999:9999
    mem_limit: 4096m
    restart: unless-stopped
    depends_on:
      - elasticsearch
      - redis
  elasticsearch:
    container_name: elasticsearch
    image: docker.elastic.co/elasticsearch/elasticsearch:5.6.9
    volumes:
      - ./elastic/data:/usr/share/elasticsearch/data
    environment:
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms4096m -Xmx4096m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
  redis:
    container_name: redis
    image: redis:alpine
    volumes:
      - ./redis/data:/data

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-diskover-config: executing...
Initial run of dispatcher in progress
[cont-init.d] 50-diskover-config: exited 0.
[cont-init.d] 60-diskover-web-config: executing...
[cont-init.d] 60-diskover-web-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Traceback (most recent call last):
  File "/usr/bin/rq-dashboard", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
Traceback (most recent call last):
  File "/usr/bin/rq-dashboard", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
Traceback (most recent call last):
  File "/app/diskover/diskover.py", line 29, in <module>
    import progressbar
  File "/usr/lib/python3.8/site-packages/progressbar/__init__.py", line 3, in <module>
    from .utils import (
  File "/usr/lib/python3.8/site-packages/progressbar/utils.py", line 7, in <module>
    from python_utils.time import timedelta_to_seconds, epoch, format_time
  File "/usr/lib/python3.8/site-packages/python_utils/time.py", line 1, in <module>
    import six
ModuleNotFoundError: No module named 'six'
Traceback (most recent call last):
  File "/usr/bin/rq-dashboard", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
Traceback (most recent call last):
  File "/app/diskover/diskover.py", line 29, in <module>
    import progressbar
  File "/usr/lib/python3.8/site-packages/progressbar/__init__.py", line 3, in <module>
    from .utils import (
  File "/usr/lib/python3.8/site-packages/progressbar/utils.py", line 7, in <module>
    from python_utils.time import timedelta_to_seconds, epoch, format_time
  File "/usr/lib/python3.8/site-packages/python_utils/time.py", line 1, in <module>
    import six
ModuleNotFoundError: No module named 'six'
Traceback (most recent call last):
  File "/usr/bin/rq-dashboard", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
Traceback (most recent call last):
  File "/app/diskover/diskover.py", line 29, in <module>
    import progressbar
  File "/usr/lib/python3.8/site-packages/progressbar/__init__.py", line 3, in <module>
    from .utils import (
  File "/usr/lib/python3.8/site-packages/progressbar/utils.py", line 7, in <module>
    from python_utils.time import timedelta_to_seconds, epoch, format_time
  File "/usr/lib/python3.8/site-packages/python_utils/time.py", line 1, in <module>
    import six
ModuleNotFoundError: No module named 'six'
Traceback (most recent call last):
  File "/usr/bin/rq-dashboard", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
Traceback (most recent call last):
  File "/app/diskover/diskover.py", line 29, in <module>
    import progressbar
  File "/usr/lib/python3.8/site-packages/progressbar/__init__.py", line 3, in <module>
    from .utils import (
  File "/usr/lib/python3.8/site-packages/progressbar/utils.py", line 7, in <module>
    from python_utils.time import timedelta_to_seconds, epoch, format_time
  File "/usr/lib/python3.8/site-packages/python_utils/time.py", line 1, in <module>
    import six
ModuleNotFoundError: No module named 'six'
Traceback (most recent call last):
  File "/usr/bin/rq-dashboard", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
Traceback (most recent call last):
  File "/app/diskover/diskover.py", line 29, in <module>
    import progressbar
  File "/usr/lib/python3.8/site-packages/progressbar/__init__.py", line 3, in <module>
    from .utils import (
  File "/usr/lib/python3.8/site-packages/progressbar/utils.py", line 7, in <module>
    from python_utils.time import timedelta_to_seconds, epoch, format_time
  File "/usr/lib/python3.8/site-packages/python_utils/time.py", line 1, in <module>
    import six
ModuleNotFoundError: No module named 'six'
Traceback (most recent call last):
  File "/usr/bin/rq-dashboard", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'
github-actions[bot] commented 4 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

Torqu3Wr3nch commented 4 years ago

Adding another data point. I'm seeing the same thing. Looks like someone else is seeing this too: No module names 'six' and 'pkg_resources' #88

Issue started sometime in the past two weeks (could have been up to three weeks). My last successful run was on 11/2/20.

artbird309 commented 4 years ago

I was also have this issue with a new install as I have never used this service before.

I was able to fix it by connecting to the container and installing pip and the missing/broken packages. I used the below commands then restarted and it started up:

 apk add py3-pip
 cd /app/diskover && \
 pip3 install --no-cache-dir -r requirements.txt 

Key output from this command is that it lowers the version of idna and requests to idna-2.8 and requests-2.22.0

Requirement already satisfied: six in /usr/lib/python3.8/site-packages (from progressbar2==3.42.0->-r requirements.txt (line 4)) (1.15.0)
Requirement already satisfied: click>=5.0 in /usr/lib/python3.8/site-packages (from rq==1.1.0->-r requirements.txt (line 6)) (7.1.2)
Installing collected packages: idna, requests
  Attempting uninstall: idna
    Found existing installation: idna 2.9
    Uninstalling idna-2.9:
      Successfully uninstalled idna-2.9
  Attempting uninstall: requests
    Found existing installation: requests 2.23.0
    Uninstalling requests-2.23.0:
      Successfully uninstalled requests-2.23.0
Successfully installed idna-2.8 requests-2.22.0

I built the image locally and it looks like during the apk add py3-pip installs these packages:

(27/50) Installing py3-six (1.15.0-r0)
(28/50) Installing py3-packaging (20.4-r0)
(29/50) Installing py3-setuptools (47.0.0-r0)
(30/50) Installing py3-chardet (3.0.4-r4)
(31/50) Installing py3-idna (2.9-r0)
(32/50) Installing py3-certifi (2020.4.5.1-r0)
(33/50) Installing py3-urllib3 (1.25.9-r0)
(34/50) Installing py3-requests (2.23.0-r0)

Then when it is cleaning up the image it removes py3-pip and that also removes the packages that were installed by pip too:

(24/44) Purging py3-requests (2.23.0-r0)
(25/44) Purging py3-chardet (3.0.4-r4)
(26/44) Purging py3-idna (2.9-r0)
(27/44) Purging py3-certifi (2020.4.5.1-r0)
(28/44) Purging py3-urllib3 (1.25.9-r0)
(29/44) Purging py3-retrying (1.3.3-r0)
(30/44) Purging py3-setuptools (47.0.0-r0)
(31/44) Purging py3-ordered-set (4.0.1-r0)
(32/44) Purging py3-appdirs (1.4.4-r1)
(33/44) Purging py3-packaging (20.4-r0)
(34/44) Purging py3-parsing (2.4.7-r0)
(35/44) Purging py3-six (1.15.0-r0)

I was able to fix the image by adding py3-requests to the runtime packages. My change was to line 25 and added 26:

    python3 \
    py3-requests && \