add-ons / add-ons/plugin.video.vrt.nu

Timeout: The read operation timed out

Open
#938 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
125
Forks
27
Avg merge
3h 46m
Merged PRs (30d)
12

Description

Describe the bug

It appears we are having these read timeouts quite often lately. It is unclear to me what is causing them, but maybe this is an opportunity to make our code somewhat more robust when this happens.

To Reproduce

Not sure how to reproduce it, we get it quite a lot since very recently.

Expected behavior

We now get a generic Kodi plugin error, whereas I would rather have it show there are issues with the connection, and include the Timeout error "The read operation timed out" as part of it.

Additional context
  • Operating system: LibreELEC v10.0.1
  • Kodi version: v19.3
  • Addon version: v2.5.7+matrix.1 (with #936 included)
  • Using a VPN: no
  • Country you are using the addon from: BE
Log (if available)
2022-02-18 23:35:23.087 T:14086    INFO <general>: initializing python engine.
2022-02-18 23:35:23.367 T:14086 WARNING <general>: [plugin.video.vrt.nu] Access: plugin://plugin.video.vrt.nu/
2022-02-18 23:35:23.393 T:14086    INFO <general>: CPythonInvoker(170, /storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/addon_entry.py): script successfully run
2022-02-18 23:35:36.436 T:14086    INFO <general>: initializing python engine.
2022-02-18 23:35:36.448 T:14086 WARNING <general>: [plugin.video.vrt.nu] Access: plugin://plugin.video.vrt.nu/favorites
2022-02-18 23:35:36.556 T:14086 WARNING <general>: [plugin.video.vrt.nu] Got item from cache '/storage/.kodi/userdata/addon_data/plugin.video.vrt.nu/tokens/vrtloginat.tkn'
2022-02-18 23:35:36.564 T:14086 WARNING <general>: [plugin.video.vrt.nu] URL get: https://www.vrt.be/vrtnu-api/rest/lists/vrtnu-favoritePrograms?tileType=program-poster&tileContentType=program&tileOrientation=po
rtrait&layout=slider&title=Mijn+favoriete+programma's
2022-02-18 23:35:39.311 T:14086   FATAL <general>: [plugin.video.vrt.nu] Timeout: The read operation timed out
                                                   url: https://www.vrt.be/vrtnu-api/rest/lists/vrtnu-favoritePrograms?tileType=program-poster&tileContentType=program&tileOrientation=portrait&layout=slider&title=Mijn+favoriete+programma%27s
2022-02-18 23:35:39.326 T:14086   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'NoneType' object has no attribute 'get'
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/addon_entry.py", line 14, in<module>
                                                       run(argv)
                                                     File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/addon.py", line 362, 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 81, in favorites_menu
                                                       VRTPlayer().show_favorites_menu()
                                                     File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/vrtplayer.py", line 125, in show_favorites_menu
                                                       self._favorites.refresh(ttl=ttl('indirect'))
                                                     File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/favorites.py", line 40, in refresh
                                                       favorites_dict = self._generate_favorites_dict(self.get_favorites())
                                                     File "/storage/.kodi/addons/plugin.video.vrt.nu/resources/lib/favorites.py", line 184, in _generate_favorites_dict
                                                       for item in favorites_json.get(':items', []):
                                                   AttributeError: 'NoneType' object has no attribute 'get'
                                                   -->End of Python script error report<--
                                                   
2022-02-18 23:35:40.018 T:14086    INFO <general>: Python interpreter stopped
2022-02-18 23:35:40.031 T:14090    INFO <general>: Skipped 1 duplicate messages..
2022-02-18 23:35:40.031 T:14090   ERROR <general>: GetDirectory - Error getting plugin://plugin.video.vrt.nu/favorites
2022-02-18 23:35:40.035 T:16370   ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.vrt.nu/favorites) failed

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the traceback in resources/lib/favorites.py at _generate_favorites_dict, then follow the call from resources/lib/vrtplayer.py and addon.py. Check how the timeout from the VRT API is propagated and how the favorites menu handles it. Done means the user sees a connection-related error including the timeout instead of a generic Kodi plugin error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.