wouterdebie / locast2tuner

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

response '204 No Content' #41

Closed sgaert closed 3 years ago

sgaert commented 3 years ago

Hello, i try to get it running since a week, but i have no idea anymore. Here is my log:

Apr 19 20:45:31 locastvm systemd[1]: Started locast2tuner. Apr 19 20:45:31 locastvm locast2tuner[4052]: config selected = /etc/locast2tuner/config Apr 19 20:45:31 locastvm locast2tuner[4052]: Apr 19 20:45:31.711 INFO locast2tuner 0.1.28 on Linux 5.4.0-72-generic starting.. Apr 19 20:45:31 locastvm locast2tuner[4052]: Apr 19 20:45:31.711 INFO UUID: bc412c67-e151-4214-ad27-713b9355cf9a Apr 19 20:45:31 locastvm locast2tuner[4052]: Apr 19 20:45:31.711 INFO Logging in with xxxxx Apr 19 20:45:31 locastvm locast2tuner[4052]: Apr 19 20:45:31.753 DEBG starting new connection: https://api.locastnet.org/ Apr 19 20:45:31 locastvm locast2tuner[4052]: Apr 19 20:45:31.875 TRCE registering event source with poller: token=Token(1), interests=READABLE | WRITABLE Apr 19 20:45:32 locastvm locast2tuner[4052]: Apr 19 20:45:32.263 TRCE signal: Want Apr 19 20:45:32 locastvm locast2tuner[4052]: Apr 19 20:45:32.267 TRCE signal found waiting giver, notifying Apr 19 20:45:32 locastvm locast2tuner[4052]: Apr 19 20:45:32.268 TRCE poll_want: taker wants! Apr 19 20:45:32 locastvm locast2tuner[4052]: Apr 19 20:45:32.405 TRCE signal: Want Apr 19 20:45:32 locastvm locast2tuner[4052]: thread 'Apr 19 20:45:32.406 TRCE signal: Want Apr 19 20:45:32 locastvm locast2tuner[4052]: Apr 19 20:45:32.406 DEBG response '204 No Content' for https://api.locastnet.org/api/user/login Apr 19 20:45:32 locastvm locast2tuner[4052]: Apr 19 20:45:32.407 INFO Login succeeded! Apr 19 20:45:32 locastvm locast2tuner[4052]: main' panicked at 'called Result::unwrap() on an Err value: reqwest::Error { kind: Decode, source: Error("EOF while parsing a value", line: 1, column: 0) }'> Apr 19 20:45:32 locastvm locast2tuner[4052]: note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Apr 19 20:45:32 locastvm systemd[1]: locast2tuner.service: Main process exited, code=dumped, status=6/ABRT Apr 19 20:45:32 locastvm systemd[1]: locast2tuner.service: Failed with result 'core-dump'.

wouterdebie commented 3 years ago

Hi!

Would you mind running with --rust_backgrace and paste the full log here? Do you have an active locast subscription with donation?

sgaert commented 3 years ago

Thanks for the fast reply. Yes i have a 5$ month donation.

Here the log: sgaert@locastvm:/usr/bin$ ./locast2tuner --rust_backtrace Apr 19 21:16:19.123 INFO locast2tuner 0.1.28 on Linux 5.4.0-72-generic starting.. Apr 19 21:16:19.123 INFO UUID: 3b571f47-aadd-4c64-90fd-5b1677d98f7c Apr 19 21:16:19.123 INFO Logging in with xxxxxx Apr 19 21:16:19.145 DEBG starting new connection: https://api.locastnet.org/ Apr 19 21:16:19.149 TRCE registering event source with poller: token=Token(1), interests=READABLE | WRITABLE Apr 19 21:16:19.542 TRCE signal: Want Apr 19 21:16:19.542 TRCE signal found waiting giver, notifying Apr 19 21:16:19.542 TRCE poll_want: taker wants! thread 'main' panicked at 'called Result::unwrap() on an Err value: reqwest::Error { kind: Decode, source: Error("EOF while parsing a value", line: 1, column: 0) }', src/credentials.rs:75:50 stack backtrace: Apr 19 21:16:19.685 TRCE signal: Want Apr 19 21:16:19.685 TRCE signal: Want Apr 19 21:16:19.686 DEBG response '204 No Content' for https://api.locastnet.org/api/user/login Apr 19 21:16:19.686 INFO Login succeeded! note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. Aborted (core dumped)

wouterdebie commented 3 years ago

I just pushed a fix to a bug I though was the issue, but that doesn't seem to be the case. What is strange is that the response to https://api.locastnet.org/api/user/login is empty (you get a '204 No Content' response from the server), while normally you'd get a 200 OK with some json inside that contains the locast token. This is what my log shows:

Apr 19 16:31:01.228 INFO Logging in with xxxxxx
Apr 19 16:31:01.228 DEBG starting new connection: https://api.locastnet.org/
Apr 19 16:31:01.578 DEBG response '200 OK' for https://api.locastnet.org/api/user/login
Apr 19 16:31:01.578 INFO Login succeeded!

It's unclear to me why locast.org returns a 204 instead of a 200 to you.

Would you be able to try a curl from the command line? This should return some json with a token.

curl -X POST -d '{"username": "your@email.address", "password":"your_password"}' -H 'Content-Type: application/json' https://api.locastnet.org/api/user/login
sgaert commented 3 years ago

I tryed the CURL Post but not return. I also tryed the curl to the URL without the /login, i received an error json as return.

wouterdebie commented 3 years ago

Super weird.. Do you have any "strange" characters in your email address? Or something in your password that locast doesn't like? What if you supply a wrong password? This seems to be an issue with your account. I've tried replicating, but I can't seem to get an empty response.

sgaert commented 3 years ago

no strange characters in the credentials. i can write what i like in the usere and password, always no responce. Also the line as you wrote create no responce. When i delete the json out of the request I get an error responce.

sgaert@locastvm:/usr/bin$ curl -X POST https://api.locastnet.org/api/user/login {"code":500,"message":"There was an error processing your request. It has been logged (ID 4c9d61865cdd60a9)."}

wouterdebie commented 3 years ago

Is there a proxy in the way that blocks you from posting data?

sgaert commented 3 years ago

Thank you for your input, I got it. It is the geofence of locast, I´m from the outside of the supported area. If I use a VPN than I receive a token responce in curl.