wouterdebie / locast2tuner

Locast to Emby/Plex/Channels server
https://wouterdebie.github.io/locast2tuner/
MIT License
52 stars 8 forks source link

Docker Container Crashes On Gateway Timeout #40

Closed rtm2017 closed 3 years ago

rtm2017 commented 3 years ago

Noticed my Docker container had stopped. Thought I would grab the log Unraid: 6.9.1 locast2tuner: 0.1.25

I would have expected locast2tuner to retry instead of stopping.

Let me know what else I can provide to help solve this!


Apr 17 14:04:47.342 INFO Stream 4c4f2d8 - draining 10 segments
Apr 17 14:04:47.342 INFO Serving https://dal.locastnet.org/proxy/dal/wfaaquest161866829.ts (10 s) in 9.432129s
Apr 17 14:04:49.046 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000031
Apr 17 14:04:49.046 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000014
Apr 17 14:04:52.080 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000037
Apr 17 14:04:52.081 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000014
Apr 17 14:04:55.107 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000040
Apr 17 14:04:55.108 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000013
Apr 17 14:04:56.781 DEBG starting new connection: https://dal.locastnet.org/
Apr 17 14:04:56.969 DEBG response '200 OK' for https://dal.locastnet.org/proxy/dal/wfaaquest161866829.ts
Apr 17 14:04:57.119 INFO Stream 4c4f2d8 - playing: segment "https://dal.locastnet.org/proxy/dal/wfaaquest161866829.ts"
Apr 17 14:04:57.126 DEBG starting new connection: https://dal.locastnet.org/
Apr 17 14:04:58.137 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000037
Apr 17 14:04:58.137 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000016
Apr 17 14:05:01.178 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000039
Apr 17 14:05:01.178 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000013
Apr 17 14:05:04.198 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000038
Apr 17 14:05:04.198 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000014
Apr 17 14:05:07.223 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000037
Apr 17 14:05:07.223 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000015
Apr 17 14:05:10.248 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000036
Apr 17 14:05:10.248 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000014
Apr 17 14:05:13.271 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000031
Apr 17 14:05:13.272 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000015
Apr 17 14:05:16.296 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000037
Apr 17 14:05:16.296 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000014
Apr 17 14:05:19.334 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000037
Apr 17 14:05:19.334 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000014
Apr 17 14:05:22.368 INFO 192.168.1.250:50304 "GET /discover.json HTTP/1.1" 200 294 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000038
Apr 17 14:05:22.368 INFO 192.168.1.250:50304 "GET /lineup_status.json HTTP/1.1" 200 73 "-" "PlexMediaServer/1.22.2.4282-a97b03fad" 0.000014
Apr 17 14:05:24.625 DEBG response '504 Gateway Timeout' for https://dal.locastnet.org/proxy/dal/variant/2l0fAe8wF7ilSYEdmkJvO0g0Lrlcmlt4cia0urF4WDPKQgmDY7PTLtvYzDI2BjBwU8SQUGXTvnIWVQVzYhXSEa.m3u8
thread 'actix-rt|system:0|arbiter:0' panicked at 'called `Result::unwrap()` on an `Err` value: Error { inner: MissingTag { tag: "#EXTM3U", input: "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n\t<head>\n\t\t<title>504 - Gateway Timeout</title>\n\t</head>\n\t<body>\n\t\t<h1>504 - Gateway Timeout</h1>\n\t</body>\n</html>\n" } }', src/http/mod.rs:426:83

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace```
eiddor commented 3 years ago

@rtm2017 Did this only happen the one time? "504 - Gateway Timeout" sounds like it would be something on the locast end where their web server is having a problem reaching something on the back end. I get this with nginx when using reverse proxy and one the services behind it is down.

@wouterdebie I'm not sure whether this is worth adding some kind of retry behavior to mitigate against.

wouterdebie commented 3 years ago

Right now the http client retries recoverable errors, but a 504 is considered serious, so it won't retry. What I could do though is to try again until we run out of chunks to serve and then just stop the stream.

On Sun, Apr 18, 2021, 11:11 Roddie Hasan @.***> wrote:

@rtm2017 https://github.com/rtm2017 Did this only happen the one time? "504 - Gateway Timeout" sounds like it would be something on the locast end where their web server is having a problem reaching something on the back end. I get this with nginx when using reverse proxy and one the services behind it is down.

@wouterdebie https://github.com/wouterdebie I'm not sure whether this is worth adding some kind of retry behavior to mitigate against.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wouterdebie/locast2tuner/issues/40#issuecomment-822016679, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABKABSJ3WTRKN7RIKI5EJLTJMAB7ANCNFSM43D3PENQ .

rtm2017 commented 3 years ago

I've only seen it this one time. I'm not even sure it was streaming anything when it happened, I just logged in and saw that the docker container had stopped. I would expect that if locast was down or connection to the internet was lost the docker container would continue to run and simply retry

wouterdebie commented 3 years ago

Yeah, this should not result in a panic, but locast2tuner should either silently ignore this and stop the stream or retry.

On Sun, Apr 18, 2021 at 1:30 PM rtm2017 @.***> wrote:

I've only seen it this one time. I'm not even sure it was streaming anything when it happened, I just logged in and saw that the docker container had stopped. I would expect that if locast was down or connection to the internet was lost the docker container would continue to run and simply retry every 5 minutes or something

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wouterdebie/locast2tuner/issues/40#issuecomment-822038284, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABKABWNA3ZWMFGBTJE7GWTTJMQM7ANCNFSM43D3PENQ .

wouterdebie commented 3 years ago

I chose to just stop the stream, rather than retrying. I think this is a nice solution, since locast2tuner doesn't panic and exit, but the stream is just gone. With errors like this, we have no idea when it comes back, and we only have a 10 segment window to recover before the stream pretty much craps out. I just pushed a fix for this and should be available in 0.1.26 (currently building and available in 15 mins or so). Thanks for the bug report!

wouterdebie commented 3 years ago

Closing this issue for now, since this should not happen anymore. Let me know when something similar does happen :)