Containers in a fresh install of LibreTime 4.2.0 use API v1

Describe the problem
Hello, I have recently been trying to install LibreTime 4.2.0 on a server using Docker. I am pretty sure I did all the steps described here correctly, however some containers aren’t able to communicate properly… More specifically, the problem is that Liquidsoap and the playout container are trying to perform requests that clearly belong to the API v1, such as:

| ERROR    | libretime_api_client._client:_request:93 - 404 Client Error: Not Found for url: http://nginx:8080/api/update-liquidsoap-status?format=json&stream_id=1&boot_time=<timestamp>

And, well it does make sense since NGINX is only configure to proxy requests to the API v2. I have tried changing the configuration to proxy everything in /api/, but then the API container responds with a 404.

Could it be that I have done something wrong? I did check the configuration but there doesn’t seem to be a way to force the containers to use the API v2…

Also, the NGINX yields a 404 when making requests on /, but I assume this is because the previous issue is blocking the generation of the web pages in the libretime_assets volume (unless I have to fetch them from somewhere else?).

To reproduce

  1. Follow the steps in the installation guide with LIBRETIME_VERSION="4.2.0"
  2. Check the logs of liquidsoap, playout or worker
  3. See error

Expected behavior
These containers should be using the API v2 URLs to contact the api container.

Relevant log output or error messages

From liquidsoap:

2024-09-21 17:03:52,294 | ERROR    | libretime_api_client._client:_request:93 - 404 Client Error: Not Found for url: http://nginx:8080/api/update-liquidsoap-status?format=json&stream_id=1&boot_time=1726938231.24

From playout:

2024-09-21 17:06:55,583 | ERROR    | libretime_api_client._client:_request:93 - 404 Client Error: Not Found for url: http://nginx:8080/api/version?format=json

From worker:

[2024-09-21 17:05:00,111: ERROR/ForkPoolWorker-2] Task libretime_worker.tasks.legacy_trigger_task_manager[ecfcf3ca-8b39-4de2-a906-fbf187ca6c2c] raised unexpected: HTTPError('404 Client Error: Not Found for url: http://nginx:8080/api/version?format=json')
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File "/src/libretime_worker/tasks.py", line 60, in legacy_trigger_task_manager
    legacy_client.trigger_task_manager()
  File "/usr/local/lib/python3.10/site-packages/libretime_api_client/v1.py", line 219, in trigger_task_manager
    self._base_client.version()
  File "/usr/local/lib/python3.10/site-packages/libretime_api_client/v1.py", line 44, in version
    return self._request(
  File "/usr/local/lib/python3.10/site-packages/libretime_api_client/_client.py", line 94, in _request
    raise exception
  File "/usr/local/lib/python3.10/site-packages/libretime_api_client/_client.py", line 89, in _request
    response.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://nginx:8080/api/version?format=json

From NGINX:

172.16.1.120 - - [21/Sep/2024:17:08:05 +0000] "GET /api/version?format=json HTTP/1.1" 404 153 "-" "python-requests/2.32.3" "-"

LibreTime version

LibreTime version: 4.2.0

Installation method and OS / Environment

Operating system: Debian Bullseye
Method: Docker compose

Hello,

Seems to have same problem, except I have a 500 error instead 404.
My error in different logs :

syslog

Oct 21 07:48:37 ns379487 libretime-playout[24369]: 2024-10-21 07:48:37,254 | ERROR | libretime_api_client._client:_request:93 - 500 Server Error: Internal Server Error for url: https://radio.foujair.fr/api/version?format=json

playout.log

ERROR    | libretime_api_client._client:_request:93 - 500 Server Error: Internal Server Error for url: https://radio.*****.fr/api/version?format=json

worker.log

[2024-10-21 07:40:00,265: ERROR/ForkPoolWorker-2] Task libretime_worker.tasks.legacy_trigger_task_manager[3d6770a6-87a8-4a03-985a-9a59460e3f28] raised unexpected: HTTPError('500 Server Error: Internal Server Error for url: https://radio.****.fr/api/version?format=json')
Traceback (most recent call last):
  File "/opt/libretime/lib/python3.9/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/libretime/lib/python3.9/site-packages/celery/app/trace.py", line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/libretime/lib/python3.9/site-packages/libretime_worker/tasks.py", line 60, in legacy_trigger_task_manager
    legacy_client.trigger_task_manager()
  File "/opt/libretime/lib/python3.9/site-packages/libretime_api_client/v1.py", line 219, in trigger_task_manager
    self._base_client.version()
  File "/opt/libretime/lib/python3.9/site-packages/libretime_api_client/v1.py", line 44, in version
    return self._request(
  File "/opt/libretime/lib/python3.9/site-packages/libretime_api_client/_client.py", line 94, in _request
    raise exception
  File "/opt/libretime/lib/python3.9/site-packages/libretime_api_client/_client.py", line 89, in _request
    response.raise_for_status()
  File "/opt/libretime/lib/python3.9/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://radio.****.fr/api/version?format=json

liquisoap :

WARNING  | libretime_api_client.v1:wrapper:22 - 500 Server Error: Internal Server Error for url: https://radio.*****.fr/api/update-liquidsoap-status?format=json&stream_id=1&boot_time=1729448437.8

My https://radio.***.fr/api/v2/version?format=json return :

api_version	"2.0.0"

And My https://radio.***.fr/api/v2/version?format=json return :

Found solution ! :slight_smile:
My path storage file wasn’t /srv/libretime in /etc/libretime/config.yml, so I config it to default and it solved my problem.