Skip to content
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

Intermittent "Internal Server Error" #2136

Closed
1 task done
leewillis77 opened this issue Nov 9, 2021 · 12 comments
Closed
1 task done

Intermittent "Internal Server Error" #2136

leewillis77 opened this issue Nov 9, 2021 · 12 comments
Labels
note:more information needed The reporter has to provide more information Stale undetermined Not sure if this is considered a real bug

Comments

@leewillis77
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

With increasing frequency, when I try and access Teslamate though the web interface, I get an Internal Server Error message instead of the homepage. It typically comes back after a minute or two. This is running on a raspberry pi under docker with nothing else on the machine so no other services should be interfering. The Pi looks healthy (not maxing out CPU, or Memory or anything similar).

The logs (below) don't seem that useful to me, so if there is some other debug I can provide, please do let me know.

Expected Behavior

Consistently available

Steps To Reproduce

Attempt to load main teslamate page (http://teslamate.ip.address:4000).

Relevant log output

teslamate_1  | 2021-11-09 10:58:40.819 [error] #PID<0.18726.1> running TeslaMateWeb.Endpoint (connection #PID<0.18725.1>, stream id 1) terminated
teslamate_1  | Server: teslamate:4000 (http)
teslamate_1  | Request: GET /
teslamate_1  | ** (exit) exited in: Task.Supervised.stream(2500)
teslamate_1  |     ** (EXIT) time out
teslamate_1  | 2021-11-09 10:58:42.969 [info] GET /
teslamate_1  | 2021-11-09 10:58:45.476 [error] #PID<0.18735.1> running TeslaMateWeb.Endpoint (connection #PID<0.18725.1>, stream id 3) terminated
teslamate_1  | Server: teslamate:4000 (http)
teslamate_1  | Request: GET /
teslamate_1  | ** (exit) exited in: Task.Supervised.stream(2500)
teslamate_1  |     ** (EXIT) time out

Screenshots

No response

Additional data

No response

Type of installation

Docker

Version

v1.24.2

adriankumpf added a commit that referenced this issue Nov 9, 2021
@drewpost
Copy link

I am experiencing this error as well however it is only occurring when I load it from my laptop (macOS 12.0.1 in Safari 15.1 and Chrome 95.0). If I load it in Safari from my iPhone or iPad, it loads fine.

I can go directly to Grafana via the local IP + port and it loads and shows current data.

@drewpost
Copy link

Update: it seems that 1.25.0 resolves the issue (sorry I had missed that release earlier today).

@leewillis77
Copy link
Contributor Author

Closing this since I've not seen the issue on 1.25.0 either.

@leewillis77
Copy link
Contributor Author

Re-opened as I've just had this again (on 1.25.0):

teslamate_1  | 2021-12-14 13:19:28.429 [error] #PID<0.25906.7> running TeslaMateWeb.Endpoint (connection #PID<0.25905.7>, stream id 1) terminated
teslamate_1  | Server: teslamate:4000 (http)
teslamate_1  | Request: GET /
teslamate_1  | ** (exit) exited in: Task.Supervised.stream(5000)
teslamate_1  |     ** (EXIT) time out
teslamate_1  | 2021-12-14 13:19:30.848 [info] GET /
teslamate_1  | 2021-12-14 13:19:35.854 [error] #PID<0.25913.7> running TeslaMateWeb.Endpoint (connection #PID<0.25905.7>, stream id 3) terminated
teslamate_1  | Server: teslamate:4000 (http)
teslamate_1  | Request: GET /
teslamate_1  | ** (exit) exited in: Task.Supervised.stream(5000)
teslamate_1  |     ** (EXIT) time out

@adriankumpf
Copy link
Collaborator

Do you notice an increased CPU load when you load the page and run into this timeout? Increasing the timeout even further does not seem to make sense to me. This operation usually takes a few milliseconds.

@leewillis77
Copy link
Contributor Author

Hi;

I don't have any monitoring in place unfortunately. It's hosted on a raspberry PI that's running only teslamate, so if there is a CPU spike. I'll see if I can install some monitoring on it so I can check next time this occurs.

@w0rd3r
Copy link

w0rd3r commented Jan 5, 2022

Hi @leewillis77 I have the same thing happening:

image

Here is the issue I opened, related I assume:
#2278

@adriankumpf adriankumpf added note:more information needed The reporter has to provide more information undetermined Not sure if this is considered a real bug labels Jan 7, 2022
@BriCo84
Copy link

BriCo84 commented Dec 7, 2022

I'm having this issue as well. It's been going on for awhile and very frustrating. Is this being worked on for a resolution?

@bawfnje
Copy link

bawfnje commented Dec 14, 2022

I'm having this issue as well. It's been going on for awhile and very frustrating. Is this being worked on for a resolution?

@hanjuq
Copy link

hanjuq commented Feb 9, 2023

Same issue with 1.27.2. I had it on Synology-Docker and on Raspberry Pi4 with Docker 20.10.5.
It never restarts automatically.
Unbenannt

At first the MQTT publishing stopped, Homeassistant and ABRP didn't get updated values while my Tesla was moving! This caused me to call Teslamate webpage - with "internal server error". Maybe my post is a bit off-topic because the web interface is not the root problem.

Actually I'm following an idea related to Tesla user/login/tokens found in TFF forum. To avoid a conflict between Teslamate and Tesla App using the same user, I created a special Teslamate user account. Let's see....

@hanjuq
Copy link

hanjuq commented Feb 20, 2023

Separate Tesla user for Teslamate didn't solve it. :-(

Now I was patient enough to wait for teslamate coming up itself and I have a log that's covering a complete drive containing a 7 minute gap with "internal server error" from 09:25 to 09:32 ->

�[0m�[22m2023-02-20 09:22:51.315 [info] Start of drive initiated by: %TeslaApi.Vehicle.State.Drive{gps_as_of: 1676881370, heading: 5, latitude: 48.357878, longitude: 10.859161, native_latitude: 48.357878, native_location_supported: 1, native_longitude: 10.859161, native_type: "wgs", power: 3, shift_state: "D", speed: 1, timestamp: 1676881368297}
�[0m�[22m2023-02-20 09:22:51.315 car_id=1 [info] Driving / Start
�[0m�[22m2023-02-20 09:24:19.871 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/.../vehicle_data -> 408 (9088.755 ms)
�[0m�[33m2023-02-20 09:24:19.871 [warning] TeslaApi.Error / %{"error" => "{"error": "timeout"}", "error_description" => "", "response" => nil}
�[0m�[31m2023-02-20 09:24:30.327 car_id=1 [error] Error / :unknown
�[0m�[22m2023-02-20 09:25:23.443 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/.../vehicle_data -> 408 (23059.829 ms)
�[0m�[33m2023-02-20 09:25:23.443 [warning] TeslaApi.Error / %{"error" => "{"error": "timeout"}", "error_description" => "", "response" => nil}
�[0m�[22m2023-02-20 09:25:45.269 [info] GET /
�[0m�[31m2023-02-20 09:25:50.283 [error] #PID<0.14976.2> running TeslaMateWeb.Endpoint (connection #PID<0.14975.2>, stream id 1) terminated
Server: 192.168.10.8:4000 (http)
Request: GET /
** (exit) exited in: Task.Supervised.stream(5000)
** (EXIT) time out
�[0m�[31m2023-02-20 09:25:58.633 car_id=1 [error] Error / :unknown
�[0m�[22m2023-02-20 09:27:03.348 [info] GET /
�[0m�[31m2023-02-20 09:27:08.353 [error] #PID<0.15589.2> running TeslaMateWeb.Endpoint (connection #PID<0.15588.2>, stream id 1) terminated
Server: 192.168.10.8:4000 (http)
Request: GET /
** (exit) exited in: Task.Supervised.stream(5000)
** (EXIT) time out
�[0m�[22m2023-02-20 09:32:07.340 [info] GET /
�[0m�[22m2023-02-20 09:32:12.211 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.211 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.211 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.211 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.211 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.211 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.211 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.211 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.212 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.212 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.212 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.212 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.212 car_id=1 [info] Fetch already in progress ...
�[0m�[22m2023-02-20 09:32:12.212 car_id=1 [info] Fetch already in progress ...
�[0m�[31m2023-02-20 09:32:12.347 [error] #PID<0.18054.2> running TeslaMateWeb.Endpoint (connection #PID<0.18053.2>, stream id 1) terminated
Server: 192.168.10.8:4000 (http)
Request: GET /
** (exit) exited in: Task.Supervised.stream(5000)
** (EXIT) time out
�[0m�[22m2023-02-20 09:32:12.985 [info] GET https://nominatim.openstreetmap.org/reverse -> 200 (130.239 ms)
�[0m�[22m2023-02-20 09:32:13.459 [info] GET https://nominatim.openstreetmap.org/reverse -> 200 (462.716 ms)
�[0m�[22m2023-02-20 09:32:14.358 [info] End of drive initiated by: %TeslaApi.Vehicle.State.Drive{gps_as_of: 1676881919, heading: 248, latitude: 48.377564, longitude: 10.84347, native_latitude: 48.377564, native_location_supported: 1, native_longitude: 10.84347, native_type: "wgs", power: 0, shift_state: nil, speed: nil, timestamp: 1676881920671}
�[0m�[22m2023-02-20 09:32:14.358 car_id=1 [info] Driving / Ended / 4 km – 9 min
�[0m�[22m2023-02-20 09:32:14.358 car_id=1 [info] Start / :online
�[0m�[22m2023-02-20 09:32:15.191 [info] GET /
�[0m�[22m2023-02-20 09:32:15.195 [info] Sent 200 in 4ms

@hanjuq
Copy link

hanjuq commented Feb 26, 2023

This week I had a round trip 2 x 600 km.

Part 1: With help of homeassistant I made a dirty workaround. Everytime homeassistant could scrape "Internal server error" it sent me an email and initiated a restart of teslamate container. I could see about 20 restarts, None of the chargings was recorded completely. I always missed the first part of it.

Part 2: I disabled streaming API in teslamate -> 7,5 hours and 600 km without any problem. All relevant stuff was recorded completely, my MQTT messages were up to date. Some single warnings (TeslaApi.Error) I could see in the log but none of it blocked the system the way I had before.


Edit: Now 3000 km later: No more problems -> disabling streaming API ist my solution!

@Dulanic Dulanic added the Stale label Nov 12, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
note:more information needed The reporter has to provide more information Stale undetermined Not sure if this is considered a real bug
Projects
None yet
Development

No branches or pull requests

8 participants