YoutubeDL-Material: ERROR: connect ECONNREFUSED 127.0.0.1:27017
Hello,
I try to run image from docker hub and i got this error .ERROR: connect ECONNREFUSED 127.0.0.1:27017
my docker-compose.yml
version: 3.7
services:
ytdl_material:
image: tzahi12345/youtubedl-material:nightly
container_name: youtubedl-material
restart: unless-stopped
volumes:
- ./data/appdata:/app/appdata
- ./data/audio:/app/audio
- ./data/video:/app/video
- ./data/subscriptions:/app/subscriptions
- ./data/users:/app/users
environment:
UID: 1006
GID: 1006
ALLOW_CONFIG_MUTATIONS: 'true'
ports:
- 17442:17442
networks:
- youtubedl-material
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (2 by maintainers)
I had the same problem and turned on logging for the mongodb container. Turns out that in my case mongodb was throwing an error and refusing to start. This is because on the newer versions of mongo (v5+) they have a requirement for ARM builds where the host CPU must meet the ARM spec ARMv8.2-A. I guess raspberry pi 4 doesn’t meet that or it can’t detect that it can when in docker. Either way I just set the image to an older version:
TL;DR mongodb version 5+ doesn’t work on raspberry pi 4 in docker, so I set the mongodb image to v4.4.6
Thanks for reply.
@GlassedSilver I was debugging and found that by default tries to connect to mongodb and when its not found after few retries it uses json.
So basically default image is working fine just need to wait few minutes.
Comfirmed! I patched my local app.js file and it started up instantly, zero delay. Fantastic!
How do I get it to stop trying to connect to mongodb on startup and always just use the local json file? I have tried setting: ytdl_use_local_db: true and use_local_db: true but neither one made it skip the mongodb check on start that makes it start up so slow.
In fact, the docs say that use_local_db defaults to true… so this shouldn’t even need to be set. It shouldn’t be trying to connect to mongodb unless specifically told to, no?
Found the issue.
Change MongoDB’s container name to
ytdl-mongo-db
so it matches the URL passed to YTDL-M container configs, so that it looks like this:I will make a PR to fix this inconsistency.
Sometimes it takes a while and some distance to spot these sorts of issues. (I personally deployed differently, so my working setup never challenged this docker-compose.yml.
Hello, I was having the same problem so I checked the docker-compose.yml from the repo here and noticed that the mongodb instance was moved to another container.
I guess you can try to play with the env
ytdl_mongodb_connection_string
orytdl_use_local_db
, but I didn’t test it. In my case I just recreated both containers using the updateddocker-compose.yml
from the repo.Cheers