-
Notifications
You must be signed in to change notification settings - Fork 20
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
Provide sensible errors on network issues #385
base: master
Are you sure you want to change the base?
Conversation
1d84eae
to
cdcc95c
Compare
Part of me would like to put the actual error message (e.g. Connection Refused) into the OK dialog heading. But I don't know (yet) if the error message is always short and concise. |
cdcc95c
to
68c33f7
Compare
I don't think its a good idea to put |
BTW I haven't been testing this yet. I just started adding it to a part that failed for me once, and then added it to similar calls as well. But I have not induced any errors to see what gets caught. Most likely we want to add an abstraction layer for this if we decided we want/need this after sufficient testing. |
68c33f7
to
6c236fa
Compare
[Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissionsAn issue I encountered on Windows 10 using Kodi 18.4 when the corporate VPN was enabled, and my local proxy was still enabled for testing.
|
Just as a reference, here is a retry-mechanism we could implement as well: |
HTTPError: HTTP Error 500: Internal Server ErrorHere is another issue from an unexpected HTTP Error 500 that causes a backtrace:
While we cannot fix this, we ought to make sure this gives a proper error and possibly a cause/remediation text. Update: In this case, I tried multiple times and restarted the add-on, which didn't work. A restart of Kodi did work. So I guess invalidating tokens did help. But it is also clear that it should not be playing the file if we have an issue with getting a new token. cc @mediaminister |
Tunnel connection failed: 503 Service UnavailableWhen Telenet was doing maintenance on my Internet connection, my video froze.
After this error, I got transfered to the default Videos menu. When I then opened VRT NU, the main menu opened fine, but going to My favorites, showed the "No followed programs found" dialog. Doing this again did open the favorites menu, but opening My programs (without proxy) would result again in:
And then my Internet connection was back. |
No JSON object could be decodedAnother error occurred out of the blue.
So the assumption is that we get (from time to time?) empty responses and we may cache these responses, where we ought to escalate/log them instead. See #554 #556 #558 As a means to get a more reliable add-on and improve reporting we should always check/catch JSON issues and report/log them. |
urllib.error.HTTPError: HTTP Error 504: Gateway Time-outThis happened during integration tests on Travis CI: VRT NU infrastructure seems to be having issues currently, resulting in:
And also this occurred:
|
urllib.error.HTTPError: HTTP Error 500: Internal Server ErrorThis error occurred during integration tests on Travis CI: Still during the same VRT NU infrastructure issues, we see this as well:
It occurred a second time in another setting:
|
SSLError: ('The read operation timed out',)I just got this one:
|
SSLError: ('The read operation timed out',)This just happened to me again:
|
Exception: Playing stream returned: HTTP Error 415: Unsupported Media TypeThis happened during integration tests on Travis CI.
|
urllib.error.HTTPError: HTTP Error 401: UnauthorizedThis happened during integration tests on Travis CI.
|
urllib.error.URLError: <urlopen error Remote end closed connection without response>This happened during integration tests on Travis CI:
|
urllib.error.HTTPError: HTTP Error 500:The following error occurred during integration tests on Travis CI:
|
URLError: <urlopen error [Errno -2] Name or service not known>I got the below error during playback when my Telenet internet connection suddenly disappeared. Cable modem was gone for a few minutes, when it returned, my connection took some more minutes to come back. So I assume there was some Telenet maintenance going on. The events that happened:
|
HTTPError: HTTP Error 404: Not FoundDuring integration tests, this happened.
|
Whoops something went wrong, check the kodi log for more details.I got the below error after playing another recent item in the Most recent listing. What I think happened is that this episode of De ideale wereld was ongoing when the listing was made, and it was finished (and re-cut) after playing another item. So the listed item was no longer available because it was re-cut into another video. My indirect HTTP cache time-to-live was set to 120 minutes (2 hours) for testing purposes and this obviously is not a good value. It would probably be better to lower this to e.g. 30 or 45 minutes so the probability of the menu being rebuilt after playing an item is a lot higher. (Currently it is 60 minutes)
After refreshing the menu, the listed item did play correctly (using a different video id).
De publication id stays the same, but the video id does get changed when the video is re-cut. I just experienced this again:
The solution here is to refresh the listing because it has gone stale. This happens when the listing is showing an item that is still being broadcasted, and refreshing the listing would update the stale item. |
b0ddf75
to
bae1048
Compare
Currently the add-on works fine if all is well, however various things can go wrong which makes the add-on bail out with no proper error. And since the cause of network errors could be anywhere, we do not want the end-user to have to dig deep into Kodi logs to find probable suspects. So we do want to return the exact error message (i.e. Connection refused, No route to host, etc.) so the user can relate it to other possible problems. (WIFI issues, Internet down or unreliable, etc.)
bae1048
to
7986718
Compare
An implementation like this would have helped for #748 so users do not need to go to the Kodi log to have an identifiable error to report. |
HTTP Error 503: Service Unavailable: Back-end server is at capacityI got a new error message last night, which gives some insight where the problem is.
|
HTTP Error 504: GATEWAY_TIMEOUTAnd this one is related to the previous error.
|
Yesterday evening, there was a problem logging in at VRT NU: https://twitter.com/VRT_NU/status/1299829574759583744 Did you get an ok dialog in Kodi GUI? Which message? |
It started with a blank statement of an issue that could be related to almost anything, followed by specific error messages like the above in dialogs. But then I still got a generic Kodi error referring me to the logs which was caused by the SSLError in #806 So the communication was a lot better than before. |
http.client.IncompleteRead: IncompleteRead(3004 bytes read)Got another weird error in GitHub CI today:
|
ERROR: CCurlFile::FillBuffer - Failed: Timeout was reached(28)Tonight I experienced a whole new behaviour for the first time.
There was no indication of buffering issues on screen, playback stalled and after about 20 seconds you return to the menu and a generic VRT NU pop-up appear that there were network issues. It is possible my RPi had network issues, but it is happening multiple times with 5 to 10 minutes of normal playback. Rebooting did not help. Playback from Chrome on my laptop worked as expected. |
http.client.IncompleteRead: IncompleteRead(3004 bytes read)This was encounter on GitHub CI on Windows using Python 3.8.
|
Currently the add-on works fine if all is well, however various things can go wrong which makes the add-on bail out with no proper error.
And since the cause of network errors could be anywhere, we do not want the end-user to have to dig deep into Kodi logs to find probable suspects.
So we do want to return the exact error message (i.e. Connection refused, No route to host, etc.) so the user can relate it to other possible problems. (WIFI issues, Internet down or unreliable, etc.)
This PR relies on #384 and is far from finished, there are many places in the code that may be affected by network issues. So we have to make sure we are doing this as efficient as possible so the code remains readable and transparent.