Yooooomi / your_spotify

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

Importing Extended Streaming Data not working. #265

Open Supbro112 opened 1 year ago

Supbro112 commented 1 year ago

Describe the bug Importing isn't working. I managed to only get one file working and that was 2016-2017 year, it wont take any other files because "import already running on this account" and it says this message even when restarting the server / my system.

I am also confused because when Spotify sent me my extended streaming history, they are in the format of "Streaming_History_Audio_X" which your_spotify says these should be formatted as "endsongX" so idk what's wrong there, but despite the issue I cannot import any files to either option of importing. It always says an import is running on the account despite trying to restart the server

Expected behavior That your_spotify would take my files all at once and import them all at mass.

Additional context

Please paste the docker-compose file you're using to host YourSpotify and their logs (you can skip mongo logs). If your issue have anything related to other tools, please paste their config too.

version: "3"

services:
  server:
    image: yooooomi/your_spotify_server
    restart: always
    ports:
      - "8080:8080"
    links:
      - mongo
    depends_on:
      - mongo
    environment:
      API_ENDPOINT: http://localhost:8080 # This MUST be included as a valid URL in the spotify dashboard (see below)
      CLIENT_ENDPOINT: http://localhost:3000
      SPOTIFY_PUBLIC: 431fd98814e848c6b4a03c24a7d1e547
      SPOTIFY_SECRET: <hidden>
      CORS: http://localhost:3000,http://localhost:3001 # "all" if you want to allow every origin

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

  web:
    image: yooooomi/your_spotify_client
    restart: always
    ports:
      - "3000:3000"
    environment:
      API_ENDPOINT: http://localhost:8080

Screenshots Screenshot of data import area. image_2023-07-22_114851669

Image I made trying to explain the file issues of formatting, and the confusion of which import option is the right one. image_2023-07-22_115639180

image_2023-07-22_115731891

Import doesn't recognize new name format image_2023-07-22_115754206

Shared link http://localhost:3000/settings/account?gname=Last+day&token=cb675f7a-91a4-4972-8b93-f513d6c7ee05 Dont think it would do much, but hopefully!

Yooooomi commented 1 year ago

Hello! Restarting the server should normally clean the running imports. Also, file name has no effect on the import, it just displays a warning. Are you running behind a reverse proxy / cloudflare?

the-lazy-fox commented 1 year ago

Same error on my side, it makes it crash with a 502 after few seconds. Files are approx 10Mo each. I'm running behind SWAG reverse proxy but I have the same issue without it.

https://spotify.thelazyfox.xyz/api/import/full-privacy --> 502 Bad Gateway

Yooooomi commented 1 year ago

Hi @the-lazy-fox , are you running behind any Cloudflare or some stuff?

D3rManiac commented 1 year ago

Got the same problem, checked all files from spotify and they are formatted correctly according to the fullprivacy-importer. Solution to make this work: Simply rename alle files with a "endsong" before the original filename. "Streaming_History_Audio_XXXX-XXXX_X.json" -> "endsong_Streaming_History_Audio_XXXX_XXXX_X.json" where the Xs can be everything from XXXX_XX to XXXX_XXXX_XX, (year_month or year_year_month, if the month is only singledigit, it is also in the filename). Worked fine for me.

the-lazy-fox commented 1 year ago

Hi @the-lazy-fox , are you running behind any Cloudflare or some stuff?

No, only through reverse proxy with SWAG. I tried to rename the files & access by IP directly but the issue is still the same for me.

Yooooomi commented 1 year ago

@the-lazy-fox Can you double check that swag does not limit file size to 10mo. I've tested many many times this last month and I'm quite sure everything is ok in your Spotify.

the-lazy-fox commented 12 months ago

Error logs:

2023/08/17 15:53:10 [error] 272#272: *1430 upstream prematurely closed connection while reading response header from upstream, client: 172.18.31.1, server: _, request: "POST /api/import/full-privacy HTTP/1.1", upstream: "http://127.0.0.1:8080/import/full-privacy", host: "spotify.xxxx.xyz", referrer: "https://spotify.xxxx.xyz/settings/account" 

EDIT: Solved, container had a memory limit.