madiele / vod2pod-rss

Vod2Pod-RSS converts a YouTube or Twitch channel into a podcast with ease. It creates a podcast RSS that can be listened to directly inside any podcast client. VODs are transcoded to MP3 on the fly and no server storage is needed!
MIT License
230 stars 6 forks source link

Error starting docker via portainer #199

Closed hapkom2k closed 3 months ago

hapkom2k commented 3 months ago

app version: v1.2.1


issue description:
Hello Im using your docker compose file in portainer. Can't start the docker

vod2pod log:

2024-08-02T02:17:04.431Z INFO  [app] app version 1.2.1
thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/net/addr.rs:219:48:
OS can't spawn worker thread: Operation not permitted (os error 1)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Redis log:

1:C 02 Aug 2024 02:16:59.359 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 02 Aug 2024 02:16:59.359 # Redis version=6.2.14, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 02 Aug 2024 02:16:59.359 # Configuration loaded
1:M 02 Aug 2024 02:16:59.364 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 02 Aug 2024 02:16:59.364 # Server initialized
1:M 02 Aug 2024 02:16:59.364 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 02 Aug 2024 02:16:59.364 # Fatal: Can't initialize Background Jobs.

My sysctl -p:

net.core.netdev_max_backlog = 30000
net.core.somaxconn = 65535
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 720000
net.ipv4.tcp_max_tw_buckets = 720000
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_fin_timeout = 60
net.ipv4.tcp_keepalive_time = 7200
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_intvl = 75
net.core.wmem_max = 134217728
net.core.rmem_max = 134217728
net.core.rmem_default = 16777216
net.core.wmem_default = 16777216
net.ipv4.tcp_rmem = 4096 65536 33554432
net.ipv4.tcp_wmem = 4096 65536 33554432
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_no_metrics_save = 0
net.ipv4.tcp_congestion_control = htcp
net.netfilter.nf_conntrack_max = 134217728
net.nf_conntrack_max = 134217728
net.ipv4.ip_forward = 1

Docker compose :

version: "3.9"
services:
  api_keys:
    image: alpine
    environment:
    #add your api-keys here (put them after the "=" sign or use an .env file)
    #(is normal to se this conteiner as stopped soon after deploy)
      # Set your YouTube API key
      - YT_API_KEY##myAPIKEY##
      # Set your Twitch secret
    #  - TWITCH_SECRET=${TWITCH_SECRET:-}
      # Set your Twitch client ID
   #   - TWITCH_CLIENT_ID=${TWITCH_CLIENT_ID:-}

  vod2pod:
    extends: api_keys
    #change "latest" to "X.X.X" to pin a version es: "1.0.4" will force the image to use to version 1.0.4, if you do please watch the repo for updates (tutorial in README.md)
    #change "latest" to "beta" if you want to test yet unreleased fixes/features (expect bugs and broken builds from time to time)
    image: madiele/vod2pod-rss:latest 
    # uncomment to build vod2pod from scratch, only do this if your architecture is not supported
    #build: 
    #  dockerfile: ./Dockerfile
    #  context: https://github.com/madiele/vod2pod-rss.git
    depends_on:
      - redis
    restart: unless-stopped
    ports:
      - "13377:8080" #change from 80 to another port if you already use the port 80 on your host
    environment:
      - TZ=Europe/Amsterdam #set if you want the logs to have you timezone
      - MP3_BITRATE=192 #bitrate in kilobits of the mp3 transcode
      - TRANSCODE=true #put to false if you only need feed generation
      - SUBFOLDER=/ #for reverse proxies, ex: "/" -> access the app at mywebsite.com ; "vod2pod" -> access at mywebsite.com/vod2pod
      - RUST_LOG=INFO #set to DEBUG if you are having problems than open a github issue with the logs, use "sudo docker compose logs" to print them
      - REDIS_ADDRESS=redis #don't edit this
      - REDIS_PORT=6379 #don't edit this
 #   - YOUTUBE_MAX_RESULTS=500

  redis:
    image: "redis:6.2"
    command: redis-server --save 20 1 --loglevel warning
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
      interval: 10s
      timeout: 3s
      retries: 5
madiele commented 3 months ago

seems very similar to this issue

https://github.com/denoland/deno/issues/17444

try to update you docker engine installation and report back if that fixes the issue

hapkom2k commented 3 months ago

Docker version is 20.10.7, build f0df350 I believe this is the latest version

problem persists =(

madiele commented 3 months ago

from other threads it seems to be that you have problems with the privileges of the containers, check if portainer has some settings to run the containers as privileged. Either way I doubt this is a problem with vod2pod (also because it breaks both redis and vod2pod containers) it's probably the configuration of docker on you machine

hapkom2k commented 3 months ago

Thanks, the container is up and running. The only error in Redis : WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

But as I understand it, this is not critical.

I noticed another thing, direct playback (after pressing play) goes well, but the file download is painfully slow (40 minutes for 70 Mb). What could be the problem?

PS Should I start a new topic, or will you help here?

madiele commented 3 months ago

I confirm you can ignore the warning, if you want to fix it you need to follow the guide, nothing I can do about it (but since vod2pod-rss is not nothing critical IMHO you can ignore it)

As for the slowness is a know limit of youtube, you are not the first to mention it, nothing I can do about it, might go away if the manrainers of yt-dlp find a solution, basically keep vod2pod-rss updated and maybe it will improve in the future, but is out of my control