teslamate-org / teslamate

A self-hosted data logger for your Tesla 🚘
https://docs.teslamate.org
MIT License
5.76k stars 719 forks source link

Owner API returns 404 - vehicle_not_found #4154

Closed ivanovd closed 3 weeks ago

ivanovd commented 3 weeks ago

Is there an existing issue for this?

What happened?

After updating to 2024.26.7 Teslamate stopped logging anything. I have two instances, one on my local NAS (manual install on FreeBSD) and one on Azure (Docker install) - both stopped showing data right after the update. I logged out and logged back in, restarted the instances ... nothing helped. Both are accessible via the Internet.

image

Expected Behavior

Teslamate to be logging my drives

Steps To Reproduce

No response

Relevant log output

teslamate-teslamate-1  | 2024-08-22 16:57:02.774 [info] Migrations already up
teslamate-teslamate-1  | 2024-08-22 16:57:06.221 [info] System Info: Erlang/OTP 26 (jit)
teslamate-teslamate-1  | 2024-08-22 16:57:06.221 [info] Version: 1.30.1
teslamate-teslamate-1  | 2024-08-22 16:57:06.750 [info] POST https://auth.tesla.com/oauth2/v3/token -> 200 (442.971 ms)
teslamate-teslamate-1  | 2024-08-22 16:57:06.751 [info] Refreshed api tokens
teslamate-teslamate-1  | 2024-08-22 16:57:06.765 [info] Scheduling token refresh in 6 h
teslamate-teslamate-1  | 2024-08-22 16:57:06.772 [info] Running TeslaMateWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
teslamate-teslamate-1  | 2024-08-22 16:57:06.777 [info] Access TeslaMateWeb.Endpoint at http://xxxxxxxx.cloudapp.azure.com
teslamate-teslamate-1  | 2024-08-22 16:57:08.064 [info] Starting logger for 'XXX'
teslamate-teslamate-1  | 2024-08-22 16:57:08.112 [info] MQTT connection has been established
teslamate-teslamate-1  | 2024-08-22 16:57:08.159 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/1493036967800483 -> 404 (47.983 ms)
teslamate-teslamate-1  | 2024-08-22 16:57:08.159 car_id=1 [error] Error / :vehicle_not_found
teslamate-teslamate-1  | 2024-08-22 16:57:14.462 [info] GET /
teslamate-teslamate-1  | 2024-08-22 16:57:14.480 [info] Sent 200 in 18ms

Screenshots

No response

Additional data

No response

Type of installation

Docker

Version

v.1.30.1

ivanovd commented 3 weeks ago

When the update happened:

image

Last recorded drive:

image

The car was driven extensively since then and nothing is recorded.

cwanja commented 3 weeks ago

teslamate-teslamate-1 | 2024-08-22 16:57:08.159 [info] GET https://owner-api.teslamotors.com/api/1/vehicles/1493036967800483 -> 404 (47.983 ms)

The 404 makes me wonder if the .26.X branch moves to the new API endpoint. @swiffer @JakobLichterfeld @brianmay @jlestel

JakobLichterfeld commented 3 weeks ago

The 404 makes me wonder if the .26.X branch moves to the new API endpoint. @swiffer @JakobLichterfeld @brianmay @jlestel

No, running 2024.26.7 since 6 days without any issues: image

From the screenshot posted in OP it seems like the docker container does have DNS issues.

We had similar issues in the past, setting a DNS server for the docker daemon is the most elegant solution. Others keep rebooting till docker get correct DNS queries.

ivanovd commented 3 weeks ago

The docker container is in Azure and doesn't seem to have DNS issues, at least at the moment. The local installation on my NAS (FreeBSD) also doesn't seem to have DNS issues.

What would be a good test?

cwanja commented 3 weeks ago

The 404 makes me wonder if the .26.X branch moves to the new API endpoint. @swiffer @JakobLichterfeld @brianmay @jlestel

No, running 2024.26.7 since 6 days without any issues:

image

From the screenshot posted in OP it seems like the docker container does have DNS issues.

We had similar issues in the past, setting a DNS server for the docker daemon is the most elegant solution. Others keep rebooting till docker get correct DNS queries.

I would disagree with DNS. Two seconds before the 404 it can post for tokens. And the GET is a 404, which tells me the services can talk.

JakobLichterfeld commented 3 weeks ago

What would be a good test?

docker run busybox ping -c 1 192.203.230.10

JakobLichterfeld commented 3 weeks ago

I would disagree with DNS. Two seconds before the 404 it can post for tokens. And the GET is a 404, which tells me the services can talk.

different endpoints so different dns entries

ivanovd commented 3 weeks ago

What would be a good test?

docker run busybox ping -c 1 192.203.230.10

docker run busybox ping -c 1 192.203.230.10
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
ec562eabd705: Pull complete 
Digest: sha256:9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7
Status: Downloaded newer image for busybox:latest
PING 192.203.230.10 (192.203.230.10): 56 data bytes
64 bytes from 192.203.230.10: seq=0 ttl=50 time=11.274 ms

--- 192.203.230.10 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 11.274/11.274/11.274 ms

Nothing wrong with the DNS on both instances - local and cloud

teslamate:/ # ping owner-api.teslamotors.com
PING epuca-prd-b-c4d33cffd22b9635.elb.eu-west-1.amazonaws.com (18.203.70.200): 56 data bytes
ivanovd commented 3 weeks ago

Is the API down?

image
JakobLichterfeld commented 3 weeks ago

Is the API down?

image

Your direct browser call will never work

cwanja commented 3 weeks ago

Is the API down?

image

Do not believe their API has a web-interface. This is expected.

brianmay commented 3 weeks ago

GET https://owner-api.teslamotors.com/api/1/vehicles/1493036967800483 -> 404

To me this looks like Tesla is responding to the query and saying the vehicle does not exist. Or you do not have permission to access it.

Would be interested to know if the "get products" api returns the car. The command is something like:

curl -v --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $token" \
  'https://owner-api.teslamotors.com/api/1/products'

But you do need the token to run this.

ivanovd commented 3 weeks ago

The issue seems to have resolved by itself (no docker or host restarts)... so, I am wondering whether it was an issue on Tesla's end ... I lost two days' worth of data though

image
JakobLichterfeld commented 3 weeks ago

The issue seems to have resolved by itself (no docker or host restarts)... so, I am wondering whether it was an issue on Tesla's end ... I lost two days' worth of data though

image

No general TeslaMate issue nor a general Tesla API down issue. I assume an Issue with your IP got blocked or something went wrong in Tesla Server, which is not very likely.