Closed sirrush7 closed 1 week ago
Have you tried changing the RIVEN_BACKEND_URL
envvar/key?
Have you tried changing the
RIVEN_BACKEND_URL
envvar/key?
Yes this was the 1st thing I tried, to no effect. It's as if that ennvar/key is ignored now. Unless it being used in combination with certain other envvar causes something to not work.
Maybe the fact I have RIVEN_BACKEND_URL enabled but the envvar RIVEN_BACKEND_ENABLED:true, commented out (By default it's enabled I believe if you enable Riven itself).
environment:
- TZ=America/Toronto
- PUID=2000
- PGID=2000
## Zurg Required Settings
- ZURG_ENABLED=true
- RD_API_KEY=REDACTED
- ZURG_ENABLED=true
## Rclone Required Settings
- RCLONE_MOUNT_NAME=DMB
- RCLONE_DIR_CACHE_TIME=10s
- RCLONE_VFS_CACHE_MODE=full
## Riven Backend Required Settings
# - RIVEN_BACKEND_ENABLED=true
## Riven Frontend Required Settings
- RIVEN_ENABLED=true
# - RIVEN_FRONTEND_ENABLED=true
- ORIGIN=http://10.0.0.52:3000 # See Riven documentation for more details
- RIVEN_BACKEND_URL=http://10.0.0.52:8080 # Default is http://127.0.0.1:8080 when not enabled
# - RIVEN_DATABASE_HOST=postgresql+psycopg2://DMB:postgres@10.0.0.52/riven
# - RIVEN_DATABASE_URL=postgres://DMB:postgres@10.0.0.52/riven
# - RIVEN_FRONTEND_DIALECT=postgres
I should mention, this was working fine for the past few weeks until the most recent update to DMB it seems. I had not changed the config, just noticed Riven stopped working and realize there was an update to DMB that I pulled.
You're absolutely right, looks like it is hardcoded in load_settings
https://github.com/I-am-PUID-0/DMB/blob/9d840690fd396b3b9ec4b491b14fef1960604768/riven_/settings.py#L156
You're absolutely right, looks like it is hardcoded in
load_settings
Looks like it may be hardcoded also at: https://github.com/I-am-PUID-0/DMB/blob/9d840690fd396b3b9ec4b491b14fef1960604768/riven_/settings.py#L180 https://github.com/I-am-PUID-0/DMB/blob/9d840690fd396b3b9ec4b491b14fef1960604768/riven_/settings.py#L181
It used to respect the envvar before, so something changed there.
It used to respect the envvar before, so something changed there.
Looks like 5.1.7 introduced the bug
Have you tried changing the
RIVEN_BACKEND_URL
envvar/key?Yes this was the 1st thing I tried, to no effect. It's as if that ennvar/key is ignored now. Unless it being used in combination with certain other envvar causes something to not work.
Maybe the fact I have RIVEN_BACKEND_URL enabled but the envvar RIVEN_BACKEND_ENABLED:true, commented out (By default it's enabled I believe if you enable Riven itself).
environment: - TZ=America/Toronto - PUID=2000 - PGID=2000 ## Zurg Required Settings - ZURG_ENABLED=true - RD_API_KEY=REDACTED - ZURG_ENABLED=true ## Rclone Required Settings - RCLONE_MOUNT_NAME=DMB - RCLONE_DIR_CACHE_TIME=10s - RCLONE_VFS_CACHE_MODE=full ## Riven Backend Required Settings # - RIVEN_BACKEND_ENABLED=true ## Riven Frontend Required Settings - RIVEN_ENABLED=true # - RIVEN_FRONTEND_ENABLED=true - ORIGIN=http://10.0.0.52:3000 # See Riven documentation for more details - RIVEN_BACKEND_URL=http://10.0.0.52:8080 # Default is http://127.0.0.1:8080 when not enabled # - RIVEN_DATABASE_HOST=postgresql+psycopg2://DMB:postgres@10.0.0.52/riven # - RIVEN_DATABASE_URL=postgres://DMB:postgres@10.0.0.52/riven # - RIVEN_FRONTEND_DIALECT=postgres
Is your intent to run the backend outside of DMB and connect to it with the frontend in DMB? If so, are you also expecting DMB to load settings for the external backend?
As a note, RIVEN_ENABLED=true
will enable both the backend and frontend within DMB.
If using an external Riven backend, try disabling -RIVEN_ENABLED=true
and set RIVEN_FRONTEND_ENABLED=true
Goal is for Riven to just work, but I think where it's getting hungup with the default ENVVARs in the example to run DMB, is that it expects the docker to answer with 127.0.0.1, but I have explicitly given the docker a dedicated MACVLAN IP and it answers on that... 10.0.0.52. So whenever I fire it up, the default for DMB is to try and connect on backend 127.0.0.1 which is hardcoded, and it does not work.
I don't know if that is supposed to work or not if I set a specific IP up for a docker (127.0.0.1) however to make the docker as robust as possible, I would think that ENVVAR should pull from whatever the docker's IP is and utilize that?
I hope that helps? I can jump on Discord at some point and clarify or send more logs etc, whatever you need.
Have you tried changing the
RIVEN_BACKEND_URL
envvar/key?Yes this was the 1st thing I tried, to no effect. It's as if that ennvar/key is ignored now. Unless it being used in combination with certain other envvar causes something to not work. Maybe the fact I have RIVEN_BACKEND_URL enabled but the envvar RIVEN_BACKEND_ENABLED:true, commented out (By default it's enabled I believe if you enable Riven itself).
environment: - TZ=America/Toronto - PUID=2000 - PGID=2000 ## Zurg Required Settings - ZURG_ENABLED=true - RD_API_KEY=REDACTED - ZURG_ENABLED=true ## Rclone Required Settings - RCLONE_MOUNT_NAME=DMB - RCLONE_DIR_CACHE_TIME=10s - RCLONE_VFS_CACHE_MODE=full ## Riven Backend Required Settings # - RIVEN_BACKEND_ENABLED=true ## Riven Frontend Required Settings - RIVEN_ENABLED=true # - RIVEN_FRONTEND_ENABLED=true - ORIGIN=http://10.0.0.52:3000 # See Riven documentation for more details - RIVEN_BACKEND_URL=http://10.0.0.52:8080 # Default is http://127.0.0.1:8080 when not enabled # - RIVEN_DATABASE_HOST=postgresql+psycopg2://DMB:postgres@10.0.0.52/riven # - RIVEN_DATABASE_URL=postgres://DMB:postgres@10.0.0.52/riven # - RIVEN_FRONTEND_DIALECT=postgres
Is your intent to run the backend outside of DMB and connect to it with the frontend in DMB? If so, are you also expecting DMB to load settings for the external backend?
As a note,
RIVEN_ENABLED=true
will enable both the backend and frontend within DMB.If using an external Riven backend, try disabling
-RIVEN_ENABLED=true
and setRIVEN_FRONTEND_ENABLED=true
Thanks for looking at this issue! I just did a fresh pull and I notice now DMB respects the RIVEN_BACKEND_URL
envvar which is great and shows in the logs, however I see PostGreSQL listening only on 127.0.0.1 and not the docker IP. Or maybe it needs to be set to listen on both if that's possible? So when my backend is set to docker IP 10.0.0.52, and PostGreSQL is listening on 127, it still errors out after 10 attempts, and DMB shuts down. So we're close to what was functioning a little while ago.
My not expert googling leads me to here about running PostgreSQL in a docker environment from: https://hub.docker.com/_/postgres/
Important note: you must set listen_addresses = '*' so that other containers will be able to access postgres.
I love this DMB docker solution and just want to help make it robust / work well! Keep up the wicked work @I-am-PUID-0!
My not expert googling leads me to here about running PostgreSQL in a docker environment from: https://hub.docker.com/_/postgres/
Important note: you must set listen_addresses = '*' so that other containers will be able to access postgres.
I love this DMB docker solution and just want to help make it robust / work well! Keep up the wicked work @I-am-PUID-0!
Let's discuss this in Discord; it will probably take some back and forth to understand all the implications and current configuration.
Describe the bug
Upon startup or restart of the DMB docker with Riven enabled, the DMB docker tries to connect to Riven backend at hardcoded setting http://127.0.0.1:8080 which fails, as my DMB has a specific IP address. It fails 10X and shuts down the DMB docker.
I get the following in the logs:
Sep 27, 2024 19:43:13 - INFO - Attempt 1/10 to fetch settings from http://127.0.0.1:8080/settings/get/all Sep 27, 2024 19:43:13 - ERROR - Error fetching settings: HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: /settings/get/all (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fa6b0f53510>: Failed to establish a new connection: [Errno 111] Connection refused'))
To Reproduce
I believe this is tied to a hardcoded setting about RIVEN_BACKEND_URL: Mine is set to a specific LAN IP like 10.0.0.X
Expected behavior
I expect the Riven portion of DMB to be able to connect to it's backend and pull previously configured settings.
Screenshots
Please complete the following information:
Additional context
Add any other context about the problem here.