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

[spotify] Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "pl" is null #17875

Open
ghostface opened this issue Dec 10, 2024 · 3 comments
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@ghostface
Copy link

I noticed my spotify player things were throwing errors and no longer worked because the spotify bridge thing was down.
Checking the logs revealed some errors:

Expected Behavior

Spotify should work as it did before without throwing an error

Current Behavior

The spotify bridge thing throws:


2024-12-10 09:22:34.020 [INFO ] [nternal.handler.SpotifyBridgeHandler] - Unexpected error during polling status, please report if this keeps occurring: 

java.lang.NullPointerException: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "pl" is null

	at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.lambda$10(SpotifyBridgeHandler.java:555) ~[?:?]

	at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.updateChannelsPlayList(SpotifyBridgeHandler.java:555) ~[?:?]

	at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.updatePlayerInfo(SpotifyBridgeHandler.java:498) ~[?:?]

	at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.pollStatus(SpotifyBridgeHandler.java:416) ~[?:?]

	at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.lambda$4(SpotifyBridgeHandler.java:323) ~[?:?]

Possible Solution

Maybe it has something todo with this? https://musically.com/2024/11/28/spotify-removes-features-from-web-api-citing-security-issues/

Steps to Reproduce (for Bugs)

Enabling the spotify bridge causes this.

Context

Spotify things no longer work

Your Environment

  • openHAB 4.2.2
  • Archlinux
  • Raspberry Pi 4
  • Docker Container
  • Spotify addon version: 4.2.2
@ghostface ghostface added the bug An unexpected problem or unintended behavior of an add-on label Dec 10, 2024
@felixschndr
Copy link
Contributor

felixschndr commented Dec 10, 2024

I get the same issue but for me it says that the playlist is null

    412 03:03:30 (10. 12.)    Unexpected error during polling status, please report if this keeps occurring:
    413 java.lang.NullPointerException: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null
    414         at org.openhab.binding.spotify.internal.handler.SpotifyDynamicStateDescriptionProvider.lambda$5(SpotifyDynamicStateDescriptionProvider.java:62) ~[?:?]
    415         at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
    416         at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[?:?]
    417         at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    418         at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    419         at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
    420         at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    421         at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
    422         at org.openhab.binding.spotify.internal.handler.SpotifyDynamicStateDescriptionProvider.setPlayLists(SpotifyDynamicStateDescriptionProvider.java:63) ~[?:?]
    423         at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.pollStatus(SpotifyBridgeHandler.java:417) ~[?:?]
    424         at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.lambda$4(SpotifyBridgeHandler.java:323) ~[?:?]
    425         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
    426         at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
    427         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
    428         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
    429         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
    430         at java.lang.Thread.run(Thread.java:840) [?:?]
    431 03:03:30 (10. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null

This happens quite often

$ zgrep -h "org.openhab.binding.spotify.internal.api.model.Playlist." ./* | sort -u
03:00:48 (07. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null to UNINITIALIZED
03:00:49 (06. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null to UNINITIALIZED
03:00:50 (08. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null to UNINITIALIZED
03:00:52 (05. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null to UNINITIALIZED
03:03:21 (06. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null
03:03:28 (07. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null
03:03:29 (05. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null
03:03:30 (08. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null
03:03:30 (10. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null
03:03:41 (04. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null
13:29:35 (07. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null to UNINITIALIZED
15:25:32 (09. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null to UNKNOWN
15:25:33 (09. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "<parameter1>" is null
15:25:43 (09. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "<parameter1>" is null to OFFLINE (CONFIGURATION_ERROR): Unknown Spotify response:Check settings on developer.spotify.com/dashboard, the user may not be registered.
15:58:30 (09. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felix' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "<parameter1>" is null
15:58:32 (09. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felix' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "<parameter1>" is null to ONLINE
18:17:28 (09. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from ONLINE to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "<parameter1>" is null
18:17:54 (09. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "<parameter1>" is null to OFFLINE
20:27:23 (10. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null to UNINITIALIZED
20:27:26 (10. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from UNKNOWN to OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null
23:29:08 (08. 12.)    Thing 'spotify:player:Musik_System_Bridge_Felicitas' changed from OFFLINE: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null to UNINITIALIZED
java.lang.NullPointerException: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "<parameter1>" is null
java.lang.NullPointerException: Cannot invoke "org.openhab.binding.spotify.internal.api.model.Playlist.getUri()" because "playlist" is null

Maybe it has something todo with this? https://musically.com/2024/11/28/spotify-removes-features-from-web-api-citing-security-issues/

Interestingly enough I have two Spotify bridges, one for my Spotify account, one for my GFs. Mine works flawlessly, but for hers I get those errors. I tried to reconnect the account, did not help. After reconnecting yesterday it worked, after restarting OpenHAB in the morning (because of the daily backup) the error occurred.


I took a look at recent OpenHAB releases, nothing regarding Spotify there.
The issue of @ghostface appears here, mine appears here; different locations, both related to playlists

@ghostface
Copy link
Author

Quick note: I just tried it and my bridge thing is able to go online again. Players are shown as offline tho, i need todo some more testing/debugging first

@felixschndr
Copy link
Contributor

Quick note: I just tried it and my bridge thing is able to go online again. Players are shown as offline tho, i need todo some more testing/debugging first

Lets see if it stays up this way. For me its that it goes offline after some hours (because of the aforementioned error).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

2 participants