Libretime does not go ON_AIR

Installed libretime (github stable date 20 mar 2023) (on ubuntu 20.04 server) and it worked, scheduled a show, it went on-air, and also streamed into it via mixxx.

But after a few day, i am not able to get any show ‘on-air’.

The status in the GUI report that every ‘service’ is okay.

Any idea?

the liquidsoap.log:

2023-03-23 15:17:47.773 | ERROR    | libretime_api_client._client:_request:78 - HTTPConnectionPool(host='192.168.178.32', port=80): Max retries exceeded with url: /api/v2/stream/preferences (Caused by ResponseError('too many 500 error responses'))

the playout log:

2023-03-23 15:19:29.599 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused

the api,log:

2023-03-23 14:31:29,733 log ERROR Internal Server Error: /api/v2/stream/preferences
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/asgiref/sync.py", line 486, in thread_handler
    raise exc_info[1]
  File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/exception.py", line 38, in inner
    response = await get_response(request)
  File "/usr/local/lib/python3.8/dist-packages/django/core/handlers/base.py", line 233, in _get_response_async
    response = await wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.8/dist-packages/asgiref/sync.py", line 448, in __call__
    ret = await asyncio.wait_for(future, timeout=None)
  File "/usr/lib/python3.8/asyncio/tasks.py", line 455, in wait_for
    return await fut
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/dist-packages/asgiref/sync.py", line 490, in thread_handler
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/libretime_api/core/views/stream.py", line 15, in get
    data = Preference.get_stream_preferences()
  File "/usr/local/lib/python3.8/dist-packages/libretime_api/core/models/preference.py", line 81, in get_stream_preferences
    message_format=MessageFormatKind(entries.get("stream_label_format") or 0),
  File "/usr/lib/python3.8/enum.py", line 339, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.8/enum.py", line 663, in __new__
    raise ve_exc
ValueError: '0' is not a valid MessageFormatKind

nginx:

root@hp2:/etc/libretime# systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-03-23 14:40:50 CET; 43min ago
       Docs: man:nginx(8)
    Process: 8557 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 8558 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 8559 (nginx)
      Tasks: 5 (limit: 9334)
     Memory: 6.2M
     CGroup: /system.slice/nginx.service
             ├─8559 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
             ├─8560 nginx: worker process
             ├─8561 nginx: worker process
             ├─8562 nginx: worker process
             └─8563 nginx: worker process

Mar 23 14:40:50 hp2 systemd[1]: Starting A high performance web server and a reverse proxy server...
Mar 23 14:40:50 hp2 systemd[1]: Started A high performance web server and a reverse proxy server.
root@hp2:/etc/libretime# systemctl status libretime.target
● libretime.target - LibreTime Services
     Loaded: loaded (/lib/systemd/system/libretime.target; enabled; vendor preset: enabled)
     Active: active since Thu 2023-03-23 14:42:13 CET; 42min ago

Mar 23 14:42:13 hp2 systemd[1]: Reached target LibreTime Services.
root@hp2:/etc/libretime# systemctl status libretime-playout.service
● libretime-playout.service - LibreTime Playout Service
     Loaded: loaded (/lib/systemd/system/libretime-playout.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-03-23 15:25:46 CET; 19s ago
   Main PID: 15153 (libretime-playo)
      Tasks: 2 (limit: 9334)
     Memory: 27.2M
     CGroup: /system.slice/libretime-playout.service
             └─15153 /usr/bin/python3 /usr/local/bin/libretime-playout

Mar 23 15:25:56 hp2 libretime-playout[15153]: 2023-03-23 15:25:56.310 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:25:57 hp2 libretime-playout[15153]: 2023-03-23 15:25:57.312 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:25:58 hp2 libretime-playout[15153]: 2023-03-23 15:25:58.315 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:25:59 hp2 libretime-playout[15153]: 2023-03-23 15:25:59.318 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:26:00 hp2 libretime-playout[15153]: 2023-03-23 15:26:00.320 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:26:01 hp2 libretime-playout[15153]: 2023-03-23 15:26:01.323 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:26:02 hp2 libretime-playout[15153]: 2023-03-23 15:26:02.326 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:26:03 hp2 libretime-playout[15153]: 2023-03-23 15:26:03.328 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:26:04 hp2 libretime-playout[15153]: 2023-03-23 15:26:04.331 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
Mar 23 15:26:05 hp2 libretime-playout[15153]: 2023-03-23 15:26:05.334 | WARNING  | libretime_playout.liquidsoap.client._client:wait_for_version:56 - could not get version: [Errno 111] Connection refused
root@hp2:/etc/libretime# systemctl status libretime-liquidsoap.service
● libretime-liquidsoap.service - LibreTime Liquidsoap Service
     Loaded: loaded (/lib/systemd/system/libretime-liquidsoap.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-03-23 15:25:56 CET; 44s ago
   Main PID: 15185 (libretime-liqui)
      Tasks: 2 (limit: 9334)
     Memory: 24.1M
     CGroup: /system.slice/libretime-liquidsoap.service
             └─15185 /usr/bin/python3 /usr/local/bin/libretime-liquidsoap

Mar 23 15:25:56 hp2 systemd[1]: Started LibreTime Liquidsoap Service
oot@hp2:/var/log/libretime# systemctl status libretime-api.service
● libretime-api.service - LibreTime API Service
     Loaded: loaded (/lib/systemd/system/libretime-api.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-03-23 14:42:13 CET; 51min ago
TriggeredBy: ● libretime-api.socket
   Main PID: 8885 (gunicorn)
     Status: "Gunicorn arbiter booted"
      Tasks: 13 (limit: 9334)
     Memory: 205.4M
     CGroup: /system.slice/libretime-api.service
             ├─8885 /usr/bin/python3 /usr/bin/gunicorn --workers 4 --worker-class uvicorn.workers.UvicornWorker --log-file - --bind unix:/run/libretime-api.sock libretime_api.asgi
             ├─8910 /usr/bin/python3 /usr/bin/gunicorn --workers 4 --worker-class uvicorn.workers.UvicornWorker --log-file - --bind unix:/run/libretime-api.sock libretime_api.asgi
             ├─8913 /usr/bin/python3 /usr/bin/gunicorn --workers 4 --worker-class uvicorn.workers.UvicornWorker --log-file - --bind unix:/run/libretime-api.sock libretime_api.asgi
             ├─8914 /usr/bin/python3 /usr/bin/gunicorn --workers 4 --worker-class uvicorn.workers.UvicornWorker --log-file - --bind unix:/run/libretime-api.sock libretime_api.asgi
             └─8916 /usr/bin/python3 /usr/bin/gunicorn --workers 4 --worker-class uvicorn.workers.UvicornWorker --log-file - --bind unix:/run/libretime-api.sock libretime_api.asgi

Mar 23 15:33:15 hp2 gunicorn[8914]:     response = handler(request, *args, **kwargs)
Mar 23 15:33:15 hp2 gunicorn[8914]:   File "/usr/local/lib/python3.8/dist-packages/libretime_api/core/views/stream.py", line 15, in get
Mar 23 15:33:15 hp2 gunicorn[8914]:     data = Preference.get_stream_preferences()
Mar 23 15:33:15 hp2 gunicorn[8914]:   File "/usr/local/lib/python3.8/dist-packages/libretime_api/core/models/preference.py", line 81, in get_stream_preferences
Mar 23 15:33:15 hp2 gunicorn[8914]:     message_format=MessageFormatKind(entries.get("stream_label_format") or 0),
Mar 23 15:33:15 hp2 gunicorn[8914]:   File "/usr/lib/python3.8/enum.py", line 339, in __call__
Mar 23 15:33:15 hp2 gunicorn[8914]:     return cls.__new__(cls, value)
Mar 23 15:33:15 hp2 gunicorn[8914]:   File "/usr/lib/python3.8/enum.py", line 663, in __new__
Mar 23 15:33:15 hp2 gunicorn[8914]:     raise ve_exc
Mar 23 15:33:15 hp2 gunicorn[8914]: ValueError: '0' is not a valid MessageFormatKind

/etc/libretime/config.yml:

# See https://libretime.org/docs/admin-manual/setup/configuration/

general:
  # The public url.
  # > this field is REQUIRED
  public_url: http://192.168.178.32:80
  # The internal API authentication key.
  # > this field is REQUIRED
  api_key: HwYuhcR0Zq0GExPAMYrDEMa05MHj77Lu

  # List of origins allowed to access resources on the server, the public url
  # origin is automatically included.
  # > default is []
  allowed_cors_origins: []

  # The server timezone, should be a lookup key in the IANA time zone database,
  # for example Europe/Berlin.
  # > default is UTC
  timezone: Europe/Amsterdam

  # How many hours ahead Playout should cache scheduled media files.
  # > default is 1
  cache_ahead_hours: 1

  # Authentication adaptor to use for the legacy service, specify a class like
  # LibreTime_Auth_Adaptor_FreeIpa to replace the built-in adaptor.
  # > default is local
  auth: local

storage:
  # Path of the storage directory.
  # > default is /srv/libretime
  path: /srv/libretime

database:
  # The hostname of the PostgreSQL server.
  # > default is localhost
  host: localhost
  # The port of the PostgreSQL server.
  # > default is 5432
  port: 5432
  # The name of the PostgreSQL database.
  # > default is libretime
  name: libretime
  # The username of the PostgreSQL user.
  # > default is libretime
  user: libretime
  # The password of the PostgreSQL user.
  # > default is libretime
  password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

rabbitmq:
  # The hostname of the RabbitMQ server.
  # > default is localhost
  host: localhost
  # The port of the RabbitMQ server.
  # > default is 5672
  port: 5672
  # The virtual host of RabbitMQ server.
  # > default is /libretime
  vhost: /libretime
  # The username of the RabbitMQ user.
  # > default is libretime
  user: libretime
  # The password of the RabbitMQ user.
  # > default is libretime
  password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

playout:
  # Liquidsoap connection host.
  # > default is localhost
  liquidsoap_host: localhost
  # Liquidsoap connection port.
  # > default is 1234
  liquidsoap_port: 1234

  # The format for recordings.
  # > must be one of (ogg, mp3)
  # > default is ogg
  record_file_format: ogg
  # The bitrate for recordings.
  # > default is 256
  record_bitrate: 256
  # The samplerate for recordings.
  # > default is 44100
  record_samplerate: 44100
  # The number of channels for recordings.
  # > default is 2
  record_channels: 2
  # The sample size for recordings.
  # > default is 16
  record_sample_size: 16

liquidsoap:
  # Liquidsoap server listen address.
  # > default is 127.0.0.1
  server_listen_address: "127.0.0.1"
  # Liquidsoap server listen port.
  # > default is 1234
  server_listen_port: 1234

  # Input harbor listen address.
  # > default is ["0.0.0.0"]
  harbor_listen_address: ["0.0.0.0"]

stream:
  # Inputs sources.
  inputs:
    # Main harbor input.
    main:
      # Harbor input public url. If not defined, the value will be generated from
      # the [general.public_url] hostname, the input port and mount.
      public_url:
      # Mount point for the main harbor input.
      # > default is main
      mount: main
      # Listen port for the main harbor input.
      # > default is 8001
      port: 8001

    # Show harbor input.
    show:
      # Harbor input public url. If not defined, the value will be generated from
      # the [general.public_url] hostname, the input port and mount.
      public_url:
      # Mount point for the show harbor input.
      # > default is show
      mount: show
      # Listen port for the show harbor input.
      # > default is 8002
      port: 8002

 # Output streams.
  outputs:
    # Default icecast output
    # This can be reused to define multiple outputs without duplicating data
    .default_icecast_output: &default_icecast_output
      host: localhost
      port: 8000
      source_password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      admin_password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      name: LibreTime!
      description: LibreTime Radio!
      website: https://libretime.org
      genre: various

    # Icecast output streams.
    # > max items is 3
    icecast:
      # The default Icecast output stream
      - <<: *default_icecast_output
        enabled: true
        public_url:
        mount: main
        audio:
          format: ogg
          bitrate: 256

      # You can define extra outputs by reusing the default output using a yaml anchor
      - <<: *default_icecast_output
        enabled: false
        mount: main-low
        audio:
          format: ogg
          bitrate: 128

      - # Whether the output is enabled.
        # > default is false
        enabled: false
        # Output public url, If not defined, the value will be generated from
        # the [general.public_url] hostname, the output port and mount.
        public_url:
        # Icecast server host.
        # > default is localhost
        host: localhost
        # Icecast server port.
        # > default is 8000
        port: 8000
        # Icecast server mount point.
        # > this field is REQUIRED
        mount: main
        # Icecast source user.
        # > default is source
        source_user: source
        # Icecast source password.
        # > this field is REQUIRED
        source_password: hackme
        # Icecast admin user.
        # > default is admin
        admin_user: admin
        # Icecast admin password. If not defined, statistics will not be collected.
        admin_password: hackme

   # Icecast output audio.
        audio:
          # Icecast output audio format.
          # > must be one of (aac, mp3, ogg, opus)
          # > this field is REQUIRED
          format: ogg
          # Icecast output audio bitrate.
          # > must be one of (32, 48, 64, 96, 128, 160, 192, 224, 256, 320)
          # > this field is REQUIRED
          bitrate: 256

          # format=ogg only field: Embed metadata (track title, artist, and show name)
          # in the output stream. Some bugged players will disconnect from the stream
          # after every songs when playing ogg streams that have metadata information
          # enabled.
          # > default is false
          enable_metadata: false

        # Icecast stream name.
        name: LibreTime!
        # Icecast stream description.
        description: LibreTime Radio!
        # Icecast stream website.
        website: https://libretime.org
        # Icecast stream genre.
        genre: various

    # Shoutcast output streams.
    # > max items is 1
    shoutcast:
      - # Whether the output is enabled.
        # > default is false
        enabled: false
        # Output public url. If not defined, the value will be generated from
        # the [general.public_url] hostname and the output port.
        public_url:
        # Shoutcast server host.
        # > default is localhost
        host: localhost
        # Shoutcast server port.
        # > default is 8000
        port: 8000
        # Shoutcast source user.
        # > default is source
        source_user: source
        # Shoutcast source password.
        # > this field is REQUIRED
        source_password: hackme
        # Shoutcast admin user.
        # > default is admin
        admin_user: admin
        # Shoutcast admin password. If not defined, statistics will not be collected.
        admin_password: hackme

    # Shoutcast output audio.
        audio:
          # Shoutcast output audio format.
          # > must be one of (aac, mp3)
          # > this field is REQUIRED
          format: mp3
          # Shoutcast output audio bitrate.
          # > must be one of (32, 48, 64, 96, 128, 160, 192, 224, 256, 320)
          # > this field is REQUIRED
          bitrate: 256

        # Shoutcast stream name.
        name: LibreTime!
        # Shoutcast stream website.
        website: https://libretime.org
        # Shoutcast stream genre.
        genre: various

    # System outputs.
    # > max items is 1
    system:
      - # Whether the output is enabled.
        # > default is false
        enabled: false
        # System output kind.
        # > must be one of (alsa, ao, oss, portaudio, pulseaudio)
        # > default is alsa
        kind: alsa

The bug has been fixed already.

But if you are not sure of what you are doing, please do not run LibreTime from the main branch, as it might break. Checkout a tagged version.

EDIT: Oh my bad, the patch was only merged in the main branch, not the stable branch.

Thank you,

i have updated via the stable branch,
and libretime is back on-air again.
Problem is gone.