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

No json object could be decoded #554

Closed
dagwieers opened this issue Oct 28, 2019 · 4 comments · Fixed by #624
Closed

No json object could be decoded #554

dagwieers opened this issue Oct 28, 2019 · 4 comments · Fixed by #624
Labels
bug Something isn't working
Milestone

Comments

@dagwieers
Copy link
Collaborator

Describe the bug

After playing another video (spoed 24/7), I again got the below traceback. This is the second time in two days to get this exact error. The first time I added it to #385

Additional context

  • Operating system: LibreELEC 9.2 Beta1 (9.1.501)
  • Kodi version: 18.4
  • Addon version: 2.3.0 branch
  • Using a VPN: no
  • Country you are using the addon from: BE

Log (if available)

2019-10-28 23:32:00.392 T:1937471936  NOTICE: VideoPlayer: waiting for threads to exit
2019-10-28 23:32:00.392 T:1937471936  NOTICE: VideoPlayer: finished waiting
2019-10-28 23:32:00.392 T:1937471936  NOTICE: CVideoPlayer::CloseFile()
2019-10-28 23:32:00.392 T:1937471936  NOTICE: VideoPlayer: waiting for threads to exit
2019-10-28 23:32:00.392 T:1937471936  NOTICE: VideoPlayer: finished waiting
2019-10-28 23:32:00.432 T:1937471936   ERROR: Control 55 in window 10025 has been asked to focus, but it can't
2019-10-28 23:32:00.492 T:1220756352  NOTICE: [plugin.video.vrt.nu] Got VRT NU Player info: {'position': 2833.000244140625, 'total': 2833.000244140625, 'event': u'playbackended'}
2019-10-28 23:32:00.503 T:1220756352  NOTICE: [plugin.video.vrt.nu] URL get: https://vrtnu-api.vrt.be/search?i=video&facets[videoId]=vid-648cfa46-c891-43c0-8043-3a59d443687e&size=1
2019-10-28 23:32:01.778 T:1506800512  NOTICE: [plugin.video.vrt.nu] Access: plugin://plugin.video.vrt.nu/favorites/recent
2019-10-28 23:32:01.869 T:1220756352  NOTICE: [plugin.video.vrt.nu] Cached token '/storage/.kodi/userdata/addon_data/plugin.video.vrt.nu/tokens/user_XVRTToken.tkn' deleted
2019-10-28 23:32:01.880 T:1220756352  NOTICE: [plugin.video.vrt.nu] Delete file '/storage/.kodi/userdata/addon_data/plugin.video.vrt.nu/tokens/user_XVRTToken.tkn'.
2019-10-28 23:32:01.947 T:1220756352  NOTICE: [plugin.video.vrt.nu] Got cached token '/storage/.kodi/userdata/addon_data/plugin.video.vrt.nu/tokens/vrtloginrt.tkn'
2019-10-28 23:32:01.950 T:1220756352  NOTICE: [plugin.video.vrt.nu] URL get: https://token.vrt.be/refreshtoken
2019-10-28 23:32:02.002 T:1506800512   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: No JSON object could be decoded
                                            Traceback (most recent call last):
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/addon_plugin.py", line 8, in <module>
                                                run(sys.argv)
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/addon.py", line 301, in run
                                                plugin.run(argv)
                                              File "/storage/.kodi/addons/script.module.routing/lib/routing.py", line 130, in run
                                                self._dispatch(self.path)
                                              File "/storage/.kodi/addons/script.module.routing/lib/routing.py", line 141, in _dispatch
                                                view_func(**kwargs)
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/addon.py", line 98, in favorites_recent
                                                VRTPlayer(kodi).show_recent_menu(page=page, use_favorites=True)
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/vrtplayer.py", line 243, in show_recent_menu
                                                self._favorites.refresh(ttl=5 * 60 if use_favorites else 60 * 60)
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/favorites.py", line 37, in refresh
                                                xvrttoken = TokenResolver(self._kodi).get_xvrttoken(token_variant='user')
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/tokenresolver.py", line 71, in get_xvrttoken
                                                token = self._get_cached_token('X-VRT-Token', token_variant)
                                              File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/tokenresolver.py", line 100, in _get_cached_token
                                                token = json.load(fdesc)
                                              File "/usr/lib/python2.7/json/__init__.py", line 291, in load
                                              File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
                                              File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
                                              File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
                                            ValueError: No JSON object could be decoded
                                            -->End of Python script error report<--
2019-10-28 23:32:02.259 T:1245934464   ERROR: GetDirectory - Error getting plugin://plugin.video.vrt.nu/favorites/recent
2019-10-28 23:32:02.264 T:1937471936   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.vrt.nu/favorites/recent) failed
@dagwieers dagwieers added the bug Something isn't working label Oct 29, 2019
@mediaminister
Copy link
Collaborator

This means that the file user_XVRTToken.tkn doesn't contain a json string. I can reproduce this error with an empty user_XVRTToken.tkn file and opening the My favorites menu.

Maybe file writing failed or something else...

@dagwieers
Copy link
Collaborator Author

Let's assume this is fixed, and see if it happens again.

@dagwieers dagwieers added this to the v2.3.0 milestone Oct 29, 2019
@dagwieers
Copy link
Collaborator Author

@mediaminister There is no good reason for it being incorrectly written to disk. My feeling is that due to problems at VRT we are getting an empty response. Could be useful to log when JSON can't decode (in all places where we process JSON we receive). Seems something we want to add to #385.

@dagwieers
Copy link
Collaborator Author

Reopen to track this issue and ensure it is really gone.

@dagwieers dagwieers reopened this Oct 30, 2019
@dagwieers dagwieers modified the milestones: v2.3.0, Future Oct 31, 2019
@dagwieers dagwieers modified the milestones: Future, v2.3.0 Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants