Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
2.64k stars 108 forks source link

Extended streaming history: 'User has no accessToken or no refreshToken' #362

Closed harrymander closed 4 months ago

harrymander commented 4 months ago

Firstly, thanks for the great app! Running into this error when trying to import my complete listening history.

Describe the bug

In settings, under 'Import data', select 'Import type' = 'Extended streaming history'. Click 'Select your files', upload all files beginning with Streaming_History_Audio, UI says 'Everything looks fine for the import to work', click 'Import'.

image

The server responds with error 400 (see logs) when attempting to upload extended streaming history. A pop-up shows saying:

The initialization failed, maybe your files are wrongly formatted

I have also tried with just uploading a single .json file and get the same error.

Expected behavior

The listening history uploads and is processed properly.

Additional context

your_spotify version 1.8.0 OS: Armbian 24.2.1 jammy Docker version 25.0.3, build 4debf41 Docker Compose version v2.24.6

The application is only available on my local network.

docker-compose.yml:

version: "3"

services:
  server:
    image: yooooomi/your_spotify_server
    restart: always
    ports:
      - "3333:8080"
    links:
      - mongo
    depends_on:
      - mongo
    environment:
      API_ENDPOINT: http://[hostname]:3333 # This MUST be included as a valid URL in the spotify dashboard
      CLIENT_ENDPOINT: http://[hostname]:3000
      SPOTIFY_PUBLIC: "[...]"
      SPOTIFY_SECRET: "[...]"
      CORS: http://[hostname]:3000,http://[hostname]:3001 # "all" if you want to allow every origin

  mongo:
    container_name: mongo
    image: mongo:6
    volumes:
      - /ssd/your_spotify/db:/data/db

  web:
    image: yooooomi/your_spotify_client
    restart: always
    ports:
      - "3000:3000"
    environment:
      API_ENDPOINT: http://[hostname]:3333

Server logs:

yarn run v1.22.19
$ node ./lib/migrations.js
[info]  Trying to connect to database at mongodb://mongo:27017/your_spotify
[info]  Connected to database !
[debug]  Locking DB_LongWriteLock
[info]  Checking database for missing track data...
[debug]  Unlocking DB_LongWriteLock
[info]  Starting migrations
[info]  Migrations successfully ran
Done in 1.13s.
yarn run v1.22.19
$ node lib/index.js
[info]  Trying to connect to database at mongodb://mongo:27017/your_spotify
[info]  Connected to database !
[debug]  Listening on port 8080
[info]  [DbLoop] starting for 1 users
[info]  [Harry Mander]: refreshing...
[info]  No missing tracks, passing...
[debug]  Locking DB_LongWriteLock
[debug]  Unlocking DB_LongWriteLock
[info]  [Harry Mander]: 0 tracks, 0 albums, 0 artists
[error]  User Harry Mander has no accessToken or no refreshToken
POST /import/full-privacy 400 2466.696 ms - 29

I belive the relevant lines are:

[error]  User Harry Mander has no accessToken or no refreshToken
POST /import/full-privacy 400 2466.696 ms - 29
hkamran80 commented 4 months ago

I have the same error with the exact same logs. I'm running 1.8.0 on Ubuntu 21.10, with Docker 20.10.17 (build 100c701).

Here's my Compose file:

services:
  server:
    image: yooooomi/your_spotify_server:latest
    depends_on:
      - mongo
    links:
      - mongo
    environment:
      API_ENDPOINT: https://ys-srv.mydomain.com
      CLIENT_ENDPOINT: https://ys.mydomain.com
      SPOTIFY_PUBLIC: [client id]
      SPOTIFY_SECRET: [client secret]
      CORS: https://ys.mydomain.com
    restart: always

  mongo:
    image: mongo:6
    volumes:
      - ./db:/data/db

  web-client:
    image: yooooomi/your_spotify_client
    depends_on:
      - server
    environment:
      API_ENDPOINT: https://ys-srv.mydomain.com
    restart: always

  server-tunnel:
    image: cloudflare/cloudflared:latest
    depends_on:
      - server
    restart: unless-stopped
    command: tunnel --no-autoupdate run --token [tunnel token]

  web-tunnel:
    image: cloudflare/cloudflared:latest
    depends_on:
      - web-client
    restart: unless-stopped
    command: tunnel --no-autoupdate run --token [tunnel token]
KingsleyBawuah commented 4 months ago

Having the same issue!

jjscaria commented 4 months ago

I am having the same issue

your_spotify version 1.8.0 OS: Debian 12 Docker version 20.10.24 Docker Compose version v2.24.6

cpuks commented 4 months ago

Same here with latest running docker.

mwckr commented 4 months ago

Same here. Just updated the whole image.

edit: updated from 1.7.3 to 1.8.0 through portainer. Same issue as @harrymander with the same message in the logs of the server.

Tried going back to 1.7.3, but no luck. Same error. It must be something between the web-app and the server or the database.

LucaNerlich commented 4 months ago

same, happy to share my extended history with the maintainer. Just let me know. all the best and thanks for the work! :)

Yooooomi commented 4 months ago

Sorry for this, pipeline running for 1.8.1 fixing this 👀 https://github.com/Yooooomi/your_spotify/actions/runs/8202141961

mwckr commented 4 months ago

Sorry for this

no worries, happens!

Yooooomi commented 4 months ago

Ok the image is updated, you should be able to pull and import. Have a great day and a good weekend :)

yaakovfeldman commented 4 months ago

Confirmed working - thanks so much!