wiserain / docker-flexget

Docker image for running Flexget
https://hub.docker.com/r/wiserain/flexget
68 stars 40 forks source link

latest image continually restarts #55

Closed markolonius closed 1 year ago

markolonius commented 2 years ago

using latest image it keeps restarting and is non-functioning. any direction to mend this issue is helpful. logs below:

[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] 02-tamper-check: executing...
[cont-init.d] 02-tamper-check: exited 0.
[cont-init.d] 10-adduser: executing...

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

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...
*** Using existing config.yml
*** Flexget v3.3.8 ready!
[cont-init.d] 20-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: 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] executing => flexget -c /config/config.yml --loglevel debug --logfile flexget.log daemon start --autoreload-config
[services.d] done.
2022-04-14 20:43:05 DEBUG    manager                       Config file /config/config.yml selected
2022-04-14 20:43:05 DEBUG    manager                       sys.defaultencoding: utf-8
2022-04-14 20:43:05 DEBUG    manager                       sys.getfilesystemencoding: utf-8
2022-04-14 20:43:05 DEBUG    manager                       flexget detected io encoding: utf-8
2022-04-14 20:43:05 DEBUG    manager                       os.path.supports_unicode_filenames: False
2022-04-14 20:43:06 DEBUG    plugin                        Trying to load plugins from: ['/config/plugins', '/usr/lib/python3.9/site-packages/flexget/plugins']
2022-04-14 20:43:23 DEBUG    plugin                        Plugin `memusage` requires plugin `ext lib `guppy`` to load.
2022-04-14 20:43:23 DEBUG    plugin                        Trying to load components from: ['/config/components', '/usr/lib/python3.9/site-packages/flexget/components']
2022-04-14 20:43:43 DEBUG    plugin                        Plugins took 36.81 seconds to load. 317 plugins in registry.
2022-04-14 20:43:43 DEBUG    manager                       Connecting to: sqlite:////config/db-config.sqlite
[services.d] executing => flexget -c /config/config.yml --loglevel debug --logfile flexget.log daemon start --autoreload-config
2022-04-14 20:43:54 DEBUG    manager                       Config file /config/config.yml selected
2022-04-14 20:43:54 DEBUG    manager                       sys.defaultencoding: utf-8
2022-04-14 20:43:54 DEBUG    manager                       sys.getfilesystemencoding: utf-8
2022-04-14 20:43:54 DEBUG    manager                       flexget detected io encoding: utf-8
2022-04-14 20:43:54 DEBUG    manager                       os.path.supports_unicode_filenames: False
2022-04-14 20:43:54 DEBUG    plugin                        Trying to load plugins from: ['/config/plugins', '/usr/lib/python3.9/site-packages/flexget/plugins']
2022-04-14 20:44:05 DEBUG    plugin                        Plugin `memusage` requires plugin `ext lib `guppy`` to load.
2022-04-14 20:44:05 DEBUG    plugin                        Trying to load components from: ['/config/components', '/usr/lib/python3.9/site-packages/flexget/components']
2022-04-14 20:44:15 DEBUG    plugin                        Plugins took 20.97 seconds to load. 317 plugins in registry.
2022-04-14 20:44:15 DEBUG    manager                       Connecting to: sqlite:////config/db-config.sqlite
[services.d] executing => flexget -c /config/config.yml --loglevel debug --logfile flexget.log daemon start --autoreload-config
2022-04-14 20:44:24 DEBUG    manager                       Config file /config/config.yml selected
2022-04-14 20:44:24 DEBUG    manager                       sys.defaultencoding: utf-8
2022-04-14 20:44:24 DEBUG    manager                       sys.getfilesystemencoding: utf-8
2022-04-14 20:44:24 DEBUG    manager                       flexget detected io encoding: utf-8
2022-04-14 20:44:24 DEBUG    manager                       os.path.supports_unicode_filenames: False
2022-04-14 20:44:24 DEBUG    plugin                        Trying to load plugins from: ['/config/plugins', '/usr/lib/python3.9/site-packages/flexget/plugins']
2022-04-14 20:44:35 DEBUG    plugin                        Plugin `memusage` requires plugin `ext lib `guppy`` to load.
2022-04-14 20:44:35 DEBUG    plugin                        Trying to load components from: ['/config/components', '/usr/lib/python3.9/site-packages/flexget/components']
2022-04-14 20:44:46 DEBUG    plugin                        Plugins took 21.61 seconds to load. 317 plugins in registry.
2022-04-14 20:44:46 DEBUG    manager                       Connecting to: sqlite:////config/db-config.sqlite
[services.d] executing => flexget -c /config/config.yml --loglevel debug --logfile flexget.log daemon start --autoreload-config
wiserain commented 2 years ago

Might be a dependency problem?

2022-04-14 20:44:05 DEBUG    plugin                        Plugin `memusage` requires plugin `ext lib `guppy`` to load.
markolonius commented 2 years ago

Not sure why this would happen? I don't load any extra plugins. I'll try loading a default config for a blank slate and see if still occurs and get back to you tonight.

crkinard commented 2 years ago

I am having this issue as well. It just seems to try and start over and over again. No plugins. Clean install.

Linux rbpi-00 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux Docker version 20.10.14, build a224086

sudo docker service create \ --constraint node.hostname==rbpi-03 \ --name flexget \ --hostname flexget \ --env TZ=America/New_York \ --publish 5050:5050 \ --mount 'type=bind,source=/mnt/docker/flexget/config,destination=/config' \ --mount 'type=bind,source=/mnt/docker/flexget/data,destination=/data' \ wiserain/flexget

EDIT: Plugins or guppy is not the issue.

Installed guppy3 inside the container and the error went away but it is still rebooting.

$ cat /mnt/docker/flexget/config/custom-cont-init.d/00-guppy.sh

!/usr/bin/with-contenv bash

apk add -q --no-cache gcc apk add -q --no-cache g++ apk add -q --no-cache python3-dev pip install guppy3

flexget.1.pxngf1cyhmfd@rbpi-03 | [services.d] executing => flexget -c /config/config.yml --loglevel debug --logfile flexget.log daemon start --autoreload-config flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:16 DEBUG manager Config file /config/config.yml selected flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:16 DEBUG manager sys.defaultencoding: utf-8 flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:16 DEBUG manager sys.getfilesystemencoding: utf-8 flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:16 DEBUG manager flexget detected io encoding: utf-8 flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:16 DEBUG manager os.path.supports_unicode_filenames: False flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:16 DEBUG plugin Trying to load plugins from: ['/config/plugins', '/usr/lib/python3.9/site-packages/flexget/plugins'] flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:23 DEBUG plugin Trying to load components from: ['/config/components', '/usr/lib/python3.9/site-packages/flexget/components'] flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:29 DEBUG plugin Plugins took 12.75 seconds to load. 317 plugins in registry. flexget.1.pxngf1cyhmfd@rbpi-03 | 2022-04-20 00:03:29 DEBUG manager Connecting to: sqlite:////config/db-config.sqlite

wiserain commented 2 years ago

Yes, guppy is not the issue, but I couldn't reproduce this.

Recently flexget has committed massive dependency upgrades when they go from v3.3.5 to v3.3.6, causing this issue. Just guessing... It would be really helpful to dissecting the problem if you're experiencing the same issue in the previous release.

crkinard commented 2 years ago

Testing 3.3.4 now. EDIT: 3.3.4 doing the same thing. EDIT EDIT: Tried a handful of random old versions and they all do the same thing. Got to be something with my environment then.

crkinard commented 2 years ago

Well confirmed the issue has to do with the sqlite database in some way.

Installed flexget (non docker) to create the database file in the docker directory then ran the docker flexget. Took 2 cycles but it eventually started with fine.

Don't know why though.

crkinard commented 2 years ago

No idea why but cpoppema/docker-flexget works.

Just takes forever to start cause it builds all the python plugins on first run.

crkinard commented 2 years ago

Built my own docker container with the following dockerfile and everything seems to work as intended. The external files copied in are exactly the same as yours.

The biggest difference is I let pip sort out the dependencies instead of loading a 'requirements' file.

I did add 7zip and logrotate to my build.

EDIT: Figured out how to publish the sucker. (Yeah, I am REALLY new at this). https://hub.docker.com/repository/docker/crkinard/flexget

FROM ghcr.io/linuxserver/baseimage-alpine:3.15-version-5b84806a

RUN apk add \
  python3 && \
  if [ ! -e /usr/bin/python ]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
  python -m ensurepip && \
  if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip; fi && \
  pip install --upgrade pip

RUN pip install \
  setuptools \  
  wheel

RUN apk add \
  tzdata \
  findutils \
  bash \
  bash-completion \
  p7zip \
  logrotate

RUN apk add \
  build-base \
  linux-headers \
  python3-dev

RUN pip install \
  guppy3 \
  transmission-rpc \
  flexget

RUN rm -rf \
  /tmp/* \
  /root/.cache \
  /var/cache/apk/*

ENV \
    S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
    PYTHONUNBUFFERED=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1 \
    PIP_NO_CACHE_DIR=1 \
    FIX_DIR_OWNERSHIP_CONFIG=1 \
    FIX_DIR_OWNERSHIP_DATA=1

COPY root/ /

VOLUME /config /data
WORKDIR /config

EXPOSE 5050/tcp
wiserain commented 2 years ago

@crkinard Couldn't understand how you reproduce the issue. Btw, can you please try with ghcr.io/wiserain/flexget:testing?

crkinard commented 2 years ago
  flexget:
    image: wiserain/flexget:testing
    container_name: flexget
    hostname: flexget
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
      - FG_WEBUI_PASSWD=BUHHAHAHAHAH!!!!
    dns: 192.168.50.1
    networks:
      lan:
        ipv4_address: 192.168.50.77
    volumes:
      - /mnt/docker/flexget/config:/config
      - /mnt/docker/flexget/data:/data
    restart: unless-stopped
-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

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] 15-install-pkg: executing...
[cont-init.d] 15-install-pkg: exited 0.
[cont-init.d] 20-config: executing...
*** New config.yml from template
*** Setting flexget web password
Updated password
*** Flexget v3.3.8 ready!
[cont-init.d] 20-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: 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.
[services.d] executing => flexget -c /config/config.yml --loglevel info --logfile flexget.log daemon start --autoreload-config
2022-05-11 00:34:21 INFO     web_server_daemon                 Running web server at IP 0.0.0.0:5050
2022-05-11 00:34:21 INFO     web_server_daemon                 Initiating API
2022-05-11 00:34:21 INFO     web_server_daemon                 Registering WebUI v2
/usr/lib/python3.9/site-packages/flexget/components/scheduler/scheduler.py:129: PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  if timezone.zone == 'local':
2022-05-11 00:34:21 INFO     web_server                    Web server started at http://192.168.50.77:5050
2022-05-11 00:34:21 INFO     web_server                    API available at http://192.168.50.77:5050/api
2022-05-11 00:34:21 INFO     web_server                    WebUI (v2) available at http://192.168.50.77:5050/

Seems to be running ok other than that one error.

Latest is running the same.