AdrienPoupa / docker-compose-nas

Simple Docker Compose NAS featuring Sonarr, Radarr, Prowlarr, Jellyfin, qBittorrent, PIA VPN and Traefik with SSL support
1.06k stars 145 forks source link

bazarr API Error on homepage #86

Closed ogamingSCV closed 1 month ago

ogamingSCV commented 2 months ago

I am absolutely enjoying what has been done with this project and love the simplicity!

The only issue I can't get fixed is the bazarr integration for the homepage. I am routing bazarr through my VPN and the service itself work perfectly.

I double checked the arguments and API all well as if homepage can correctly access bazarr. It all checks out. Even a local access to the API URL from the homepage container verifies the correct URL.

I am not really sure what to do with You need to enable JavaScript to run this app.

Shown Error on homepage:

API Error: Invalid data
URL: http://vpn:6767/api/movies/wanted?apikey=***
Response Data:

<!doctype html>
<html lang="en">
  <head>
    <title>Bazarr</title>
    <base href="/bazarr/" />
    <meta charset="utf-8" />
    <link rel="icon" type="image/x-icon" href="./images/favicon.ico" />
    <link rel="manifest" href="manifest.json" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"
    />
    <meta
      name="description"
      content="Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you."
    />
    <script type="module" crossorigin src="./assets/index-BOZBF11l.js"></script>
    <link rel="modulepreload" crossorigin href="./assets/vendors-Deid0LPK.js">
    <link rel="modulepreload" crossorigin href="./assets/@mantine/hooks-B3VSvHta.js">
    <link rel="modulepreload" crossorigin href="./assets/@mantine/core-DdgHVuNw.js">
    <link rel="modulepreload" crossorigin href="./assets/@mantine/notifications-oSIUIS4m.js">
    <link rel="modulepreload" crossorigin href="./assets/@mantine/dropzone-B0e7lNxB.js">
    <link rel="modulepreload" crossorigin href="./assets/@mantine/form-CLts4vqA.js">
    <link rel="modulepreload" crossorigin href="./assets/@mantine/modals-BzYtGiXQ.js">
    <link rel="stylesheet" crossorigin href="./assets/index-DBZ-RhFu.css">
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
    <script>
      try {
        window.Bazarr = JSON.parse(`{"apiKey": "**********", "baseUrl": "/bazarr", "canUpdate": false, "hasUpdate": false}`);
      } catch (error) {}
    </script>
  </body>
</html>

Docker Compose part for bazarr:

  bazarr:
    image: lscr.io/linuxserver/bazarr
    container_name: bazarr
    environment:
      - PUID=${USER_ID}
      - PGID=${GROUP_ID}
      - TZ=${TIMEZONE}
    volumes:
      - ${CONFIG_ROOT:-.}/bazarr/config:/config
      - ${DATA_ROOT}:/data
    restart: always
    healthcheck:
      test: [ "CMD", "curl", "--fail", "http://127.0.0.1:6767/bazarr/ping" ]
      interval: 5s
      retries: 10
    labels:
      - traefik.enable=true
      - traefik.http.routers.bazarr.rule=(Host(`${HOSTNAME}`) && PathPrefix(`/bazarr`))
      - traefik.http.routers.bazarr.tls=true
      - traefik.http.routers.bazarr.tls.certresolver=myresolver
      - traefik.http.services.bazarr.loadbalancer.server.port=6767
      - homepage.group=Download
      - homepage.name=Bazarr
      - homepage.icon=bazarr.png
      - homepage.href=/bazarr
      - homepage.description=Subtitles management
      - homepage.weight=4
      - homepage.widget.type=bazarr
      - homepage.widget.url=http://vpn:6767
      #- homepage.widget.url=http://bazarr:6767/bazarr
      - homepage.widget.key=${BAZARR_API_KEY}
    network_mode: "service:vpn"
    depends_on:
      vpn:
        condition: service_healthy

Due to the minimal configuration options for this I am kinda helpless. Maybe I am still overseeing something.

Cheers!

ilyashupta commented 2 months ago

Try changing labels like this?

homepage.href=/bazarr/
homepage.widget.url=http://bazarr:6767/bazarr/
ogamingSCV commented 2 months ago

Tried that, also because that is the default. But this way it can't even connect to the service:

API Error: HTTP Error
URL: http://bazarr:6767/bazarr/api/movies/wanted?apikey=***

I have Bazarr as well over VPN, so I copied the part of the config from the qBittorrent client with the vpn as the URL Label.

  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:libtorrentv1
    container_name: qbittorrent
[...]
    labels:
[...]
      - homepage.group=Download
      - homepage.name=qBittorrent
      - homepage.icon=qbittorrent.png
      - homepage.href=/qbittorrent
      - homepage.description=Bittorrent client
      - homepage.weight=2
      - homepage.widget.type=qbittorrent
      - homepage.widget.url=http://vpn:8080
      - homepage.widget.username=${QBITTORRENT_USERNAME}
      - homepage.widget.password=${QBITTORRENT_PASSWORD}
    network_mode: "service:vpn"
    depends_on:
      vpn:
        condition: service_healthy

Sonarr, Radarr and Prowlarr also have the same config change (Homepage Labels, VPN Network) and they work fine.

  radarr:
    image: lscr.io/linuxserver/radarr
    container_name: radarr
[...]
    labels:
      - traefik.enable=true
      - traefik.http.routers.radarr.rule=(Host(`${HOSTNAME}`) && PathPrefix(`/radarr`))
      - traefik.http.routers.radarr.tls=true
      - traefik.http.routers.radarr.tls.certresolver=myresolver
      - traefik.http.services.radarr.loadbalancer.server.port=7878
      - homepage.group=Media
      - homepage.name=Radarr
      - homepage.icon=radarr.png
      - homepage.href=/radarr
      - homepage.description=Movies management
      - homepage.weight=1
      - homepage.widget.type=radarr
      - homepage.widget.url=http://vpn:7878
      #- homepage.widget.url=http://radarr:7878/radarr
      - homepage.widget.key=${RADARR_API_KEY}
    network_mode: "service:vpn"
    depends_on:
      vpn:
        condition: service_healthy

As the original error suggests, it can connect to the service, but can't process the data for some reason.

ilyashupta commented 2 months ago

Did you try with the trailing slash as I have in the labels that I posted?

ogamingSCV commented 2 months ago

Yes I tested that as well, but it only sets the URL to a ...bazarr//..., due to it being added by the subpage anyways.

ilyashupta commented 2 months ago

Are you using any browser addons that would restrict javascript execution like NoScript, etc.?

ogamingSCV commented 2 months ago

Tried it with Firefox, Chrome and Safari. I tested with disabling every extension. The error seams to be Server side and not a local issue, also because its not an error in the console, but rather from the Homepage integration itself.

image
AdrienPoupa commented 1 month ago

homepage.widget.url=http://vpn:7878 this is where the error is coming from, it should be homepage.widget.url=http://vpn:7878/radarr instead. Make sure all services have their base URL configured. Bazarr should reply at http://vpn:6767/bazarr so the API URL should be http://vpn:6767/bazarr/api and not http://vpn:6767/api like in your screenshot.