Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS crashing on boot due to problem with json schema involving Youtube Music #199

Closed
bockbilbo opened this issue Oct 4, 2024 · 4 comments

Comments

@bockbilbo
Copy link

bockbilbo commented Oct 4, 2024

Describe the bug
I am setting up a brand new multi-scrobbler installation on my server, using the latest docker image. I am using AIO settings based on the base template within the documentation to just configure Last.fm and Youtube Music. My goal is to scrobble youtube music reproductions to Last.fm.

I was able to successfully configure and authenticate to Last.fm, but I am having problems loading the Youtube Music configurations. I have followed the directions in the documentation, getting the cookie from the browser. Tried different cookies, obtained from Chrome and Firefox with no luck. I am always getting the same behavior, which is a a loop of attempts to load the server and crashing with the [Sources] Json config was not valid. Please use schema to check validity. message.

To Reproduce
Steps to reproduce the behavior:

  1. Use the following docker-compose.yml base file to setup the service:
services:
  multi-scrobbler:
    container_name: multi-scrobbler
    image: foxxmd/multi-scrobbler
    restart: always
    networks:
      - multi-scrobbler
    ports:
      - 9078:9078
    environment:
      - TZ=America/Los_Angeles
      - LOG_LEVEL=debug
      - PUID=1000
      - PGID=1000
      - BASE_URL=https://scrobbler.domain.com
    volumes:
      - /opt/docker/containers/multi-scrobbler/:/config/

networks:
  multi-scrobbler:
    name: multi-scrobbler
    driver: bridge
  1. Set the following configurations in /opt/docker/containers/multi-scrobbler/config.json, replacing the place holders related to the Youtube Music cookie and Last.fm API key and secret:
{
  "debugMode": true,
  "disableWeb": false,
  "sourceDefaults": {
      "logPayload": false,
      "logFilterFailure": "warn",
      "logPlayerState": false,
      "scrobbleThresholds": {
          "duration": 30,
          "percent": 50
      },
      "maxPollRetries": 1,
      "maxRequestRetries": 1,
      "retryMultiplier": 1.5
  },
  "clientDefaults": {
      "maxRequestRetries": 1,
      "retryMultiplier": 1.5
  },
  "sources": [
      {
          "name": "MyYTMusic",
          "enable": true,
          "clients": [],
          "data": {
              "cookie": "YOUR_YOUTUBE_MUSIC_COOKIE",
              "authUser": "0"
          },
          "type": "ytmusic"
      }
  ],
  "clients": [
      {
          "name": "Last.fm",
          "enable": true,
          "configureAs": "client",
          "data": {
              "apiKey": "YOUR_API_KEY",
              "secret": "YOUR_SECRET",
              "redirectUri": "https://scrobbler.domain.com/lastfm/callback"
          },
          "type": "lastfm"
      }
  ],
  "webhooks": []
}
  1. Initiate the docker container
docker-compose up 
  1. Check the logs generated by multi-scrobbler in /opt/docker/containers/multi-scrobbler/logs and also the output of docker in the command line.

Expected behavior
I would expect the Youtube Music module to load and multi-scrobbler not to crash.

Logs

  • I am only sharing one boot cycle, after the crash, the server would reload with the same log messages.

*** Multi-scrobbler logs***

[2024-10-03 20:32:36.499 -0700] INFO   : [App] [API] Server started:
---> Local          http://localhost:9078
---> Network        http://172.30.0.2:9078
---> Network (IPv6) http://[::1]:9078
--- HINT ---
MS is likely being run in a container with BRIDGE networking which means the above addresses are not accessible from outside this container.
To ensure the container is accessible make sure you have mapped the *container* port 9078 to a *host* port. https://foxxmd.github.io/multi-scrobbler/docs/installation#networking
The container will then be accessible at http://HOST_MACHINE_IP:HOST_PORT (or https://scrobbler.domain.com/ since you defined this!)
--- HINT ---
[2024-10-03 20:32:36.500 -0700] INFO   : [App] [API] User-defined base URL for UI and redirect URLs (spotify, deezer, lastfm): https://scrobbler.domain.com/
[2024-10-03 20:32:36.554 -0700] DEBUG  : [App] [Scrobblers] Constructing lastfm (Last.fm) client...
[2024-10-03 20:32:36.556 -0700] INFO   : [App] [Scrobblers] [Lastfm - Last.fm] Client Added
[2024-10-03 20:32:36.556 -0700] INFO   : [App] Starting scrobble clients...
[2024-10-03 20:32:36.557 -0700] DEBUG  : [App] [Scrobblers] [Lastfm - Last.fm] Attempting to initialize...
[2024-10-03 20:32:36.558 -0700] VERBOSE: [App] [Scrobblers] [Lastfm - Last.fm] Building required data init succeeded
[2024-10-03 20:32:36.559 -0700] DEBUG  : [App] [Scrobblers] [Lastfm - Last.fm] Connection check was not required.
[2024-10-03 20:32:37.048 -0700] INFO   : [App] [Scrobblers] [API - Lastfm - Last.fm] Client authorized for user UserName
[2024-10-03 20:32:37.050 -0700] INFO   : [App] [Scrobblers] [Lastfm - Last.fm] Fully Initialized!
[2024-10-03 20:32:37.052 -0700] VERBOSE: [App] [Scrobblers] [Lastfm - Last.fm] Fetching up to 200 initial scrobbles...
[2024-10-03 20:32:37.053 -0700] DEBUG  : [App] [Scrobblers] [Lastfm - Last.fm] Refreshing recent scrobbles
[2024-10-03 20:32:37.615 -0700] DEBUG  : [App] [Scrobblers] [Lastfm - Last.fm] Found 200 recent scrobbles
[2024-10-03 20:32:37.621 -0700] INFO   : [App] [Scrobblers] [Lastfm - Last.fm] Scrobble processing started
[2024-10-03 20:32:37.723 -0700] ERROR  : [App] [Sources] Json config was not valid. Please use schema to check validity.

*** Docker Logs logs***

multi-scrobbler is starting!
[2024-10-03 20:32:36.455 -0700] VERBOSE: [Init] Config Dir ENV: /config -> Resolved: /config
[2024-10-03 20:32:36.478 -0700] INFO   : [Init] Version: 0.8.5
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
8:32:36 PM [vite-express] Running in production mode
8:32:36 PM [vite-express] Inline config detected, ignoring Vite config file
8:32:36 PM [vite-express] Serving static files from /app/dist
[2024-10-03 20:32:36.499 -0700] INFO   : [App] [API] Server started:
---> Local          http://localhost:9078
---> Network        http://172.30.0.2:9078
---> Network (IPv6) http://[::1]:9078
�
--- HINT ---
MS is likely being run in a container with BRIDGE networking which means the above addresses are not accessible from outside this container.
To ensure the container is accessible make sure you have mapped the *container* port 9078 to a *host* port. https://foxxmd.github.io/multi-scrobbler/docs/installation#networking
The container will then be accessible at http://HOST_MACHINE_IP:HOST_PORT (or https://scrobbler.domain.com/ since you defined this!)
�
--- HINT ---
[2024-10-03 20:32:36.500 -0700] INFO   : [App] [API] User-defined base URL for UI and redirect URLs (spotify, deezer, lastfm): https://scrobbler.domain.com/
[2024-10-03 20:32:36.554 -0700] DEBUG  : [App] [Scrobblers] Constructing lastfm (Last.fm) client...
[2024-10-03 20:32:36.556 -0700] INFO   : [App] [Scrobblers] [Lastfm - Last.fm] Client Added
[2024-10-03 20:32:36.556 -0700] INFO   : [App] Starting scrobble clients...
[2024-10-03 20:32:36.557 -0700] DEBUG  : [App] [Scrobblers] [Lastfm - Last.fm] Attempting to initialize...
[2024-10-03 20:32:36.558 -0700] VERBOSE: [App] [Scrobblers] [Lastfm - Last.fm] Building required data init succeeded
[2024-10-03 20:32:36.559 -0700] DEBUG  : [App] [Scrobblers] [Lastfm - Last.fm] Connection check was not required.
[2024-10-03 20:32:37.048 -0700] INFO   : [App] [Scrobblers] [API - Lastfm - Last.fm] Client authorized for user UserName
[2024-10-03 20:32:37.050 -0700] INFO   : [App] [Scrobblers] [Lastfm - Last.fm] Fully Initialized!
[2024-10-03 20:32:37.052 -0700] VERBOSE: [App] [Scrobblers] [Lastfm - Last.fm] Fetching up to 200 initial scrobbles...
[2024-10-03 20:32:37.053 -0700] DEBUG  : [App] [Scrobblers] [Lastfm - Last.fm] Refreshing recent scrobbles
[2024-10-03 20:32:37.615 -0700] DEBUG  : [App] [Scrobblers] [Lastfm - Last.fm] Found 200 recent scrobbles
[2024-10-03 20:32:37.621 -0700] INFO   : [App] [Scrobblers] [Lastfm - Last.fm] Scrobble processing started
[2024-10-03 20:32:37.723 -0700] ERROR  : [App] [Sources] Json config was not valid. Please use schema to check validity.
[2024-10-03 20:32:37.723 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/type
Data: ytmusic
enum: #/properties/type/enum => must be equal to one of the allowed values [chromecast]
[2024-10-03 20:32:37.724 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/DeezerData/required => must have required property 'clientId'
[2024-10-03 20:32:37.724 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/type
Data: ytmusic
enum: #/properties/type/enum => must be equal to one of the allowed values [jellyfin]
[2024-10-03 20:32:37.724 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0
Data: Object named 'MyYTMusic'
required: #/required => must have required property 'options'
[2024-10-03 20:32:37.724 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/JRiverData/required => must have required property 'url'
[2024-10-03 20:32:37.725 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/KodiData/required => must have required property 'password'
[2024-10-03 20:32:37.725 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/LastFmSourceData/required => must have required property 'apiKey'
[2024-10-03 20:32:37.725 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/ListenBrainzSourceData/required => must have required property 'token'
[2024-10-03 20:32:37.725 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/type
Data: ytmusic
enum: #/properties/type/enum => must be equal to one of the allowed values [mopidy]
[2024-10-03 20:32:37.726 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0
Data: Object named 'MyYTMusic'
required: #/required => must have required property 'options'
[2024-10-03 20:32:37.726 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/type
Data: ytmusic
enum: #/properties/type/enum => must be equal to one of the allowed values [mpris]
[2024-10-03 20:32:37.726 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/MusikcubeData/required => must have required property 'password'
[2024-10-03 20:32:37.726 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/type
Data: ytmusic
enum: #/properties/type/enum => must be equal to one of the allowed values [plex]
[2024-10-03 20:32:37.726 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/SpotifySourceData/required => must have required property 'clientId'
[2024-10-03 20:32:37.727 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/SubsonicData/required => must have required property 'password'
[2024-10-03 20:32:37.727 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/type
Data: ytmusic
enum: #/properties/type/enum => must be equal to one of the allowed values [tautulli]
[2024-10-03 20:32:37.727 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data
required: #/definitions/VLCData/required => must have required property 'password'
[2024-10-03 20:32:37.727 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/type
Data: ytmusic
enum: #/properties/type/enum => must be equal to one of the allowed values [webscrobbler]
[2024-10-03 20:32:37.728 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0/data/authUser
Data: 0
type: #/definitions/YTMusicData/properties/authUser/type => must be number
[2024-10-03 20:32:37.728 -0700] ERROR  : [App] [Sources] Schema Error:
At: /sources/0
Data: Object named 'MyYTMusic'
anyOf: #/anyOf => must match a schema in anyOf
[2024-10-03 20:32:37.728 -0700] ERROR  : [App] Exited with uncaught error
Error: Exited with uncaught error
    at <anonymous> (CWD/src/backend/index.ts:151:26)
caused by: Error: Config schema validity failure
    at validateJson (CWD/src/backend/utils.ts:406:15)
    at ScrobbleSources.buildSourcesFromConfig (CWD/src/backend/sources/ScrobbleSources.ts:122:31)
    at <anonymous> (CWD/src/backend/index.ts:115:9)

Versions (please complete the following information):
Provide version information for any related sources/clients.

  • multi-scrobbler: 0.8.5 on docker

Additional context

  • When reviewing problems with the json, for the Chrome cookie, I noticed that it had an embedded json for YT_CL={"loctok":"REDACTED"}. This was not included in the the FF cookie. I tried escaping the quotations with ", with allowed the server to parse the config json correctly, but it did not fix the schema validity error.
  • I also tried using the foxxmd/multi-scrobbler:edge image, with the same results.
@MyNameHand
Copy link

same issue here, idk what I'm doing wrong

@FoxxMD
Copy link
Owner

FoxxMD commented Oct 7, 2024

@bockbilbo @MyNameHand please try the fix in #201 and let me know if that fixes the config issue for you -- use docker image foxxmd/multi-scrobbler:pr-201.

I don't know if you'll have any luck with YTMusic as a source at the moment, however, due to potential upstream changes in ytmusic's service that are breaking things 😬

@bockbilbo
Copy link
Author

Thanks @FoxxMD . I have tried the fix from #201 and I get exactly the same error you shared in the reply to issue #195 . I am closing this issue and will follow progress on the other ticket.

FoxxMD added a commit that referenced this issue Oct 9, 2024
fix(ytmusic): Allow authUser to be number or string
@FoxxMD
Copy link
Owner

FoxxMD commented Oct 16, 2024

These fixes are in 0.8.6 (latest docker image)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants