vnghia / nghe

An OpenSubsonic implementation in Rust
GNU Affero General Public License v3.0
20 stars 0 forks source link

issues logging in with #329

Open BlueEther opened 3 months ago

BlueEther commented 3 months ago

Hi Having issues with both Amperly (ios) and Submariner (macos) connecting to a nghe docker container

Log:

Caused by:
    0: missing field `s`
    1: missing field `s`
2024-07-01T09:28:53.610985Z ERROR tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-07-01T09:28:53.772580Z ERROR nghe::open_subsonic::common::error: missing field `s`

Caused by:
    0: missing field `s`
    1: missing field `s`
2024-07-01T09:28:53.772599Z ERROR tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-07-01T09:29:11.407422Z ERROR nghe::open_subsonic::common::error: missing field `s`

Caused by:
    0: missing field `s`
    1: missing field `s`
2024-07-01T09:29:11.407441Z ERROR tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=0 ms

Docker:

services:
  nghe:
    image: ghcr.io/vnghia/nghe-musl:latest
    ports:
      - 3000:3000
    restart: unless-stopped
    environment:
      NGHE_DATABASE__URL: postgres://postgres:postgres@db:5432/postgres
      NGHE_DATABASE__KEY: nnnxxxnnnxxxnnnxxxnnnxxxnnnxxxnnn
    volumes:
      - /mnt/Media/Music/:/data/music/:ro
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:16
    environment:
      POSTGRES_PASSWORD: postgres
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5
vnghia commented 3 months ago

Hi, thank you very much for the very first issue.

The issue is nghe only supports the newer authencation scheme of Opensubsonic as seen here: https://opensubsonic.netlify.app/docs/api-reference/#authentication. I think you can toggle the authentication method in both Amperly and Submariner

BlueEther commented 3 months ago

Thanks for the project, I was looking for a used based server and saw this on lemmy and thought it worth a try.

I test the above latter

vnghia commented 3 months ago

Please try and give me some feedback. Thank you very much!

BlueEther commented 3 months ago

Hi can seem to login ok now, but have this in the logs on trying to read from the server:

2024-07-03T06:48:04.030649Z ERROR nghe::open_subsonic::common::error: missing field `id`
Caused by:
    0: missing field `id`
    1: missing field `id`
2024-07-03T06:48:04.031764Z ERROR tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=5 ms

The same library is working in Navidrome

vnghia commented 3 months ago

So there are two fields for artist id in the OpenSubsonic response. The artistId for the old API with the assumption that there is only one artist per song. And the newer ones artists to include multiple artists in the same song.

Nghe only returns artists field while some client might assume that artistId will always be non-null and they will use that empty id to request other information which causes the error above.

I am fine with including the first artist in the artists. But it will not be really consistent because the order of the artists might change everytime. Maybe an environment option to toggle this behavior is good enough for you (the option will sort for consistency and include the first artist) ?

Also, in client that supports multiple artists, you will see something like this (symfonium) image

or (airsonic) image

BlueEther commented 3 months ago

Thanks for the time, you seem to be correct and it is a client problem causing the errors. Substreamer seems to work well, at least with a single album with a single artist, which is more than I can say for either Amperly and Submariner

vnghia commented 3 months ago

I would add an option to add the artistid into the artistid field soon.