wouterdebie / locast2tuner

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

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error #38

Closed TheSamDickey closed 3 years ago

TheSamDickey commented 3 years ago

Hello, I ran the docker image and it crashed. Here's the log:

thread 'main' panicked at 'Username required', src/config.rs:73:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
config selected = /app/config/config
[INFO] - locast2tuner 0.1.15 on Linux 5.10.1-Unraid starting..
[INFO] - UUID: 2b97e7a7-a137-4bea-9af2-aeab226cd40a
[INFO] - Logging in with thesamdickey@gmail.com
[DEBUG] - starting new connection: https://api.locastnet.org/
[DEBUG] - response '200 OK' for https://api.locastnet.org/api/user/login
[INFO] - Login succeeded!
[DEBUG] - starting new connection: https://api.locastnet.org/
[DEBUG] - response '200 OK' for https://api.locastnet.org/api/user/me
[DEBUG] - starting new connection: https://api.locastnet.org/
[DEBUG] - response '200 OK' for https://api.locastnet.org/api/dma
[INFO] - Downloading FCC facilities
[DEBUG] - starting new connection: https://transition.fcc.gov/
[DEBUG] - redirecting 'https://transition.fcc.gov/ftp/Bureaus/MB/Databases/cdbs/facility.zip' to 'https://transition.fcc.gov/Bureaus/MB/Databases/cdbs/facility.zip'
[DEBUG] - response '200 OK' for https://transition.fcc.gov/Bureaus/MB/Databases/cdbs/facility.zip
[INFO] - Cached FCC facilities to /root/.locast2tuner/facilities
[DEBUG] - starting new connection: https://api.locastnet.org/
[DEBUG] - response '200 OK' for https://api.locastnet.org/api/watch/dma/zip/60601
[DEBUG] - starting new connection: https://api.locastnet.org/
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: Url { scheme: "https", username: "", password: None, host: Some(Domain("api.locastnet.org")), port: None, path: "/api/watch/epg/602", query: Some("startTime=2021-04-14T00:00:00-00:00&hours=192"), fragment: None }, source: hyper::Error(Connect, ConnectError("dns error", Custom { kind: Other, error: "failed to lookup address information: Try again" })) }', src/utils.rs:22:36

stack backtrace:
0: rust_begin_unwind
at ./rustc/c755ee4ce8cae6ea977d65a0288480940db721d9/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at ./rustc/c755ee4ce8cae6ea977d65a0288480940db721d9/library/core/src/panicking.rs:92:14
2: core::result::unwrap_failed
at ./rustc/c755ee4ce8cae6ea977d65a0288480940db721d9/library/core/src/result.rs:1355:5
3: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
5: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
6: <futures_util::future::join_all::JoinAll<F> as core::future::future::Future>::poll
7: locast2tuner::main::{{closure}}
8: tokio::macros::scoped_tls::ScopedKey<T>::set
9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
10: tokio::macros::scoped_tls::ScopedKey<T>::set
11: tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on
12: tokio::task::local::LocalSet::block_on
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

If more information would be helpful I can up the verbosity level to full. Thanks for the awesome work you do!

eiddor commented 3 years ago

@TheSamDickey My docker version runs fine once I renamed config.ini to config. Is it only failing on system startup, or can you ever get it to start?

Your logs kind of look a bit odd, though - The error in the first line would probably be related to the config file not being found due to the change for #35. But the rest appears to be more of a connectivity issue similar to #32.

(@wouterdebie We might want to consider calling out the config change prominently for some of the early-adopters who used config.ini and then to update their package or Docker image.)

TheSamDickey commented 3 years ago

@eiddor Yeah, it wouldn't run at all until I changed the config.ini to config. This log was after changing over to just config.

It ran for about 30 seconds before failing. It seems to have worked properly up until it was starting to log into api.locastnet.org.

wouterdebie commented 3 years ago

@TheSamDickey for some reason Docker seems to suffer some transient network issues. I'll implement some retry/exponential backoff behavior to mitigate this.

@rtm2017 this is a different error. After logging in, it seems that the user info doesn't contain the donationExpire flag. I'll add some debugging output to see what the response is you're getting. Do you have an active (paid for) locast.org account?

TheSamDickey commented 3 years ago

Alright sounds good! Thanks!

Ryan-Rogue commented 3 years ago

@wouterdebie You were right, think I got it all working now! Sorry to bother you!

wouterdebie commented 3 years ago

@rtm2017 No worries! It exposed a bug though, where the error handling wasn't correct. I'm fixing this now.

wouterdebie commented 3 years ago

@TheSamDickey I just pushed v0.1.17, which has retry behavior. This should fix your issue.

srvoets commented 3 years ago

Im having this same issue running the unraid template, should I just run it in an ubuntu VM container so I can change the config.ini?

eiddor commented 3 years ago

@deputyd0ng Can you tell me the exact issue you're having? Renaming the config.ini to config was one problem, but the ultimate issue that @TheSamDickey had seemed to be something transient upstream and v0.1.17 added some retry behavior to mitigate against it.

We may have to open a new issue if your problem is different or something specific to how unraid runs containers.