[GH-ISSUE #461] No playlist on psst-gui and failed to read json error #289

Closed
opened 2026-02-28 14:31:56 +03:00 by kerem · 8 comments
Owner

Originally created by @slovanos on GitHub (Mar 21, 2024).
Original GitHub issue: https://github.com/jpochyla/psst/issues/461

Bug description: There is no playlist menu.

  • Error shown on the gui:
    "failed to read JSON"

  • Error shown on the terminal:
    ERROR psst_gui::webapi::client] failed to read local tracks: No such file or directory (os error 2)

To Reproduce
Simple open the app with ./psst-gui

Environment
OS: Linux Mint 21

psst-error

Originally created by @slovanos on GitHub (Mar 21, 2024). Original GitHub issue: https://github.com/jpochyla/psst/issues/461 **Bug description:** There is no playlist menu. - Error shown on the gui: "failed to read JSON" - Error shown on the terminal: ERROR psst_gui::webapi::client] failed to read local tracks: No such file or directory (os error 2) **To Reproduce** Simple open the app with ./psst-gui **Environment** OS: Linux Mint 21 ![psst-error](https://github.com/jpochyla/psst/assets/48527469/8711ac10-632d-4daf-9f87-65d14ef8649c)
kerem 2026-02-28 14:31:56 +03:00
Author
Owner

@mackcoding commented on GitHub (Mar 22, 2024):

I am having the same issue. I get an error saying network timed out, and it gives an api url. I can't see anything that would be pulled with the API.

This started out of nowhere. I'm able to access the API directly with no issue, so I don't believe it's a network issue. This started yesterday (3/21/24).

Spot works with no issue.

<!-- gh-comment-id:2015621232 --> @mackcoding commented on GitHub (Mar 22, 2024): I am having the same issue. I get an error saying network timed out, and it gives an api url. I can't see anything that would be pulled with the API. This started out of nowhere. I'm able to access the API directly with no issue, so I don't believe it's a network issue. This started yesterday (3/21/24). Spot works with no issue.
Author
Owner

@peorth80 commented on GitHub (Mar 22, 2024):

Same issue here! Probably the JSON changed
image

<!-- gh-comment-id:2015925376 --> @peorth80 commented on GitHub (Mar 22, 2024): Same issue here! Probably the JSON changed ![image](https://github.com/jpochyla/psst/assets/16003799/65f1dc37-991d-4871-8698-3e2988e89c02)
Author
Owner

@mackcoding commented on GitHub (Mar 22, 2024):

I'm not even getting that far:
image

<!-- gh-comment-id:2015960381 --> @mackcoding commented on GitHub (Mar 22, 2024): I'm not even getting that far: ![image](https://github.com/jpochyla/psst/assets/10917563/9c38e0d1-c972-45cf-a55d-9497b668de13)
Author
Owner

@nicolasf commented on GitHub (Mar 25, 2024):

Similar issue here on MacOS.
In my case the file exists but is not what's expected.

The odd thing is that the file it's trying to load with local : load_tracks_for_user has some content that is unrelated to Spotify or PSST. I have no idea why.

It starts with "SPCOLocalFilesStoraged` " and continues with data unrelated to Spotify.

<!-- gh-comment-id:2018984848 --> @nicolasf commented on GitHub (Mar 25, 2024): Similar issue here on MacOS. In my case the file exists but is not what's expected. The odd thing is that the file it's trying to load with local : load_tracks_for_user has some content that is unrelated to Spotify or PSST. I have no idea why. It starts with "SPCOLocalFilesStoraged` " and continues with data unrelated to Spotify.
Author
Owner

@dylannorthrup commented on GitHub (Mar 28, 2024):

I attempted to add some debugging in the "make request" code path, but I am not a rust programmer so it is possible/likely I did something incorrectly.

After adding log::info!(...) bits and various values of export PSST_LOG=debug,function=trace, I could see requests initiated from get_playlists and dispatched to for_all_pages which calls self.load that calls ureq::Response.into_json. Because into_json consumes the contents of the response, it's non-obvious how to log the contents of the request and have that request used by the psst-gui client.

Unlike @mackcoding, it seems I'm able to get a response, but there's something about the returned JSON that psst-gui does not like. Happy to re-run if someone can provide a way to simultaneously log the response (or print to STDOUT) and have it used by psst, but since is rust is outside my area of knowledge, I'll need someone else to provide the code for it (or point to an example of it elsewhere).

image

<!-- gh-comment-id:2025745461 --> @dylannorthrup commented on GitHub (Mar 28, 2024): I attempted to add some debugging in the "make request" code path, but I am not a rust programmer so it is possible/likely I did something incorrectly. After adding `log::info!(...)` bits and various values of `export PSST_LOG=debug,function=trace`, I could see requests initiated from [`get_playlists`](https://github.com/jpochyla/psst/blob/0cb4f6964b5ba771182ccfe005260a86a494ef92/psst-gui/src/webapi/client.rs#L503) and dispatched to [`for_all_pages`](https://github.com/jpochyla/psst/blob/0cb4f6964b5ba771182ccfe005260a86a494ef92/psst-gui/src/webapi/client.rs#L159) which calls [`self.load`](https://github.com/jpochyla/psst/blob/0cb4f6964b5ba771182ccfe005260a86a494ef92/psst-gui/src/webapi/client.rs#L125-L129) that calls [`ureq::Response.into_json`](https://docs.rs/ureq/latest/ureq/struct.Response.html#method.into_json). Because `into_json` [consumes the contents of the response](https://docs.rs/ureq/latest/ureq/struct.Response.html#), it's non-obvious how to log the contents of the request *and* have that request used by the `psst-gui` client. Unlike @mackcoding, it seems I'm able to get a response, but there's something about the returned JSON that `psst-gui` does not like. Happy to re-run if someone can provide a way to simultaneously log the response (or print to STDOUT) and have it used by `psst`, but since is `rust` is outside my area of knowledge, I'll need someone else to provide the code for it (or point to an example of it elsewhere). ![image](https://github.com/jpochyla/psst/assets/1229014/bbbd6213-3d69-4a5f-bc4e-ac466c423471)
Author
Owner

@kingosticks commented on GitHub (Mar 28, 2024):

Recently (few weeks back) Spotify changed the format of some of their responses so that empty lists return 'null' instead of being actual empty lists like they are supposed to be. I had to change my (python) app to handle that, maybe you're hitting the same thing here.

The other problem in this thread appears to be the different case of where they turned off one of their undocumented (private) endpoints. I did see someone with a workaround for that but I helpfully can't find it now. I don't use the undocumented endpoints myself (in a futile attempt to avoid Spotify breaking my app all the time with their stupid random changes).

<!-- gh-comment-id:2026047477 --> @kingosticks commented on GitHub (Mar 28, 2024): Recently (few weeks back) Spotify changed the format of some of their responses so that empty lists return 'null' instead of being actual empty lists like they are supposed to be. I had to change my (python) app to handle that, maybe you're hitting the same thing here. The other problem in this thread appears to be the different case of where they turned off one of their undocumented (private) endpoints. I did see someone with a workaround for that but I helpfully can't find it now. I don't use the undocumented endpoints myself (in a futile attempt to avoid Spotify breaking my app all the time with their stupid random changes).
Author
Owner

@nicolasf commented on GitHub (Mar 30, 2024):

Recently (few weeks back) Spotify changed the format of some of their responses so that empty lists return 'null' instead of being actual empty lists like they are supposed to be. I had to change my (python) app to handle that, maybe you're hitting the same thing here.

Took a stab at fixing the error based on this info from @kingosticks (thanks!).
Here's a PR: https://github.com/jpochyla/psst/pull/464

Tested locally and it looks good to me, but I'm not familiar with Rust, so please review it :).

<!-- gh-comment-id:2028436265 --> @nicolasf commented on GitHub (Mar 30, 2024): > Recently (few weeks back) Spotify changed the format of some of their responses so that empty lists return 'null' instead of being actual empty lists like they are supposed to be. I had to change my (python) app to handle that, maybe you're hitting the same thing here. Took a stab at fixing the error based on this info from @kingosticks (thanks!). Here's a PR: https://github.com/jpochyla/psst/pull/464 Tested locally and it looks good to me, but I'm not familiar with Rust, so please review it :).
Author
Owner

@kingosticks commented on GitHub (Apr 1, 2024):

Recently (few weeks back) Spotify changed the format of some of their responses so that empty lists return 'null' instead of being actual empty lists like they are supposed to be. I had to change my (python) app to handle that, maybe you're hitting the same thing here.

The other problem in this thread appears to be the different case of where they turned off one of their undocumented (private) endpoints. I did see someone with a workaround for that but I helpfully can't find it now. I don't use the undocumented endpoints myself (in a futile attempt to avoid Spotify breaking my app all the time with their stupid random changes).

Regarding the other problem, with endpoints being removed (made-for-x etc), I found the related issue I was looking for: https://github.com/michaelherger/Spotty-Plugin/issues/117

I'm not sure if the fix they used there is directly relevant here, I don't personally use either software. But maybe it helps.

<!-- gh-comment-id:2029510926 --> @kingosticks commented on GitHub (Apr 1, 2024): > Recently (few weeks back) Spotify changed the format of some of their responses so that empty lists return 'null' instead of being actual empty lists like they are supposed to be. I had to change my (python) app to handle that, maybe you're hitting the same thing here. > > The other problem in this thread appears to be the different case of where they turned off one of their undocumented (private) endpoints. I did see someone with a workaround for that but I helpfully can't find it now. I don't use the undocumented endpoints myself (in a futile attempt to avoid Spotify breaking my app all the time with their stupid random changes). Regarding the other problem, with endpoints being removed (made-for-x etc), I found the related issue I was looking for: https://github.com/michaelherger/Spotty-Plugin/issues/117 I'm not sure if the fix they used there is directly relevant here, I don't personally use either software. But maybe it helps.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#289
No description provided.