HTTPError 408 Timeout

Posted on
Mon Apr 29, 2019 12:05 pm
cjp767 offline
Posts: 136
Joined: May 02, 2013
Location: Gig Harbor, WA

HTTPError 408 Timeout

I'm new to Tesla and, naturally, new to this plugin-- I have it updating the status every 30 minutes. It worked for several hours, then I began getting this set of error messages. From what I can tell, the error messages started after the car was finished charging and possibly went to sleep. (that's only a guess). I see there's a Wake command, if I want to use it. OR Just wait until the car wakes up when I drive it then the updates will continue.

So, my question: Is this set of messages normal when requesting an update from a sleeping car? Thanks for a cool plugin!

Apr 29, 2019 at 09:30:00
Schedule Tesla Data Update 30 mins
Tesla EV Control Tesla request doRefresh for vehicle 51008142629868904
Tesla EV Control Tesla request charge_state for vehicle 51008142629868904
Tesla EV Control Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 174, in vehicleStatus
File "plugin.py", line 185, in vehicleStatus2
File "plugin.py", line 198, in vehicleStatus2
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 118, in data_request
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 131, in get
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 69, in get
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 78, in post
File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 96, in __open
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
HTTPError: HTTP Error 408: Request Timeout

Posted on
Sat May 11, 2019 2:20 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Error when loading vehicle_state

Hi.

Sorry I missed this post.

Is it still doing it?

That error suggests maybe Tesla's website was offline / your internet was down for a short period, rather than any issue with the car itself.

Peter

Posted on
Sun May 12, 2019 7:22 am
cjp767 offline
Posts: 136
Joined: May 02, 2013
Location: Gig Harbor, WA

Re: Error when loading vehicle_state

This appears to be an intermittent issue— sometime it updates, sometimes it doesn’t. And when it doesn’t, it gives that set of error messages. I’ll try the web site the next time the update fails and we will see if the site has problems.

Posted on
Sun May 26, 2019 9:04 am
johnofcamas offline
Posts: 36
Joined: Jan 30, 2014

Error on ExecuteAction

I get the following error on every command:
Code: Select all
Traceback (most recent call last):
  File "plugin.py", line 154, in vehicleCommand
  File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 127, in command
  File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 135, in post
  File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 78, in post
  File "/Library/Application Support/Perceptive Automation/Indigo 7.3/Plugins/Tesla Control.indigoPlugin/Contents/Server Plugin/teslajson.py", line 96, in __open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
HTTPError: HTTP Error 408: Request Timeout

Posted on
Sun May 26, 2019 3:36 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: HTTPError 408 Timeout

I've merged @cjp767 and @johnofcamas posts into a new thread as they're the same error, even though one is sending a command one is requesting a state.

In v1.0.10 i've handled the error and now log what it was doing at the time.

It won't stop it happening, but tells me more what's going on.

Can you post logs here from the new version, with how often it happens, and how often you have a status check scheduled (if you do)?

I've had Gusten's Tesla running on my Indigo for months without a timeout error.

Posted on
Sun Jul 21, 2019 2:28 pm
shapa offline
Posts: 483
Joined: Sep 08, 2014
Location: Swindon

Re: HTTPError 408 Timeout

It looks like it's always http 408 for a second car

Model S works fine
Model X - always an error.

Actually, I tried to delete a second car and to add it back - because of Model X stopped to work in all scenarios with some latest plugin update

Always the same error. Looks like a handling logic?


Tesla EV Control Debug Device ID: 1553808060
Tesla EV Control Tesla request doRefresh for vehicle 69371731399089401
Tesla EV Control Tesla request charge_state for vehicle 69371731399089401
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: charge_state
Tesla EV Control Error Error in plugin execution UiClosed2:

Traceback (most recent call last):
File "plugin.py", line 125, in closedDeviceConfigUi
File "plugin.py", line 191, in vehicleStatus2
File "plugin.py", line 209, in vehicleStatus2
UnboundLocalError: local variable 'response' referenced before assignment

Posted on
Sun Jul 21, 2019 4:17 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: HTTPError 408 Timeout

There is obviously an issue with handling logic there, yes, but it still doesn’t help the HTTP 408 timeout.


Sent from my iPad using Tapatalk Pro

Posted on
Mon Jul 22, 2019 9:04 am
shapa offline
Posts: 483
Joined: Sep 08, 2014
Location: Swindon

Re: HTTPError 408 Timeout

Looks like 408 is an error not from the server side.

Manual requests using other libraries ( https://github.com/hjespers/teslams ) works fine for both cars.

Posted on
Sat Jul 27, 2019 1:35 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: HTTPError 408 Timeout

shapa wrote:
Looks like 408 is an error not from the server side.
408 is a communication timeout error, not one I've written, not one Tesla has written. If communication times out because either party doesn't respond quick enough, the process will timeout.

I know several folk are seeing this error, but as I stated above:

howartp wrote:
I've had Gusten's Tesla running on my Indigo for months without a timeout error.

So it's not just a "howartp needs to fix his code because it's obviously wrong".

I do have two theories:

One is based on location. Which users are in UK, or in USA, or in Europe? Do Tesla have different entry points for the API depending on location?

The second is there is a file containing a token that supposedly expires regularly and needs refreshing. (Not the user token or 90 day token). However that token has been hard-coded in the plugin since I took it over (updated AT the time I took it over) and has never expired in that time. If it had completely expired, then I'd expect all users to immediately stop working and throwing all sorts of errors - not SOME users getting timeout errors, and OTHER users working perfectly fine.

I'm intending refreshing several of my plugins over the next fortnight whilst i'm on vacation - i mean who doesn't take two sets of laptops with separate monitors, keyboards, mice, a suitcase full of electronics inc X10 radio alarm clock and several X10 plugin appliance modules, and who knows what else with them on holiday - and will be looking at the code for the Tesla token refresh to hopefully make it read it dynamically.

Peter

Posted on
Sun Jul 28, 2019 2:43 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: HTTPError 408 Timeout

Please can folk try v1.0.13

https://github.com/howartp84/TeslaControlBETA/releases/tag/1.0.13

This is now using the latest API tokens - until now i've been using Greg Glockner's (original plugin author) latest API token, but I didn't realise he had a private link versus the one everyone else uses, so when he stopped updating the plugin, the token stopped updating as well.

Also adds more error handling and debugging.

Peter

Posted on
Fri Sep 20, 2019 10:54 am
shapa offline
Posts: 483
Joined: Sep 08, 2014
Location: Swindon

Re: HTTPError 408 Timeout

Hi

Just noticed the update

Tried to upgrade, everything stopped to work (a lot of http 408)

Deleted both cars and re-added them - seems to work now, will test for a few days.

Thank you for the support!

Posted on
Fri Sep 20, 2019 1:44 pm
shapa offline
Posts: 483
Joined: Sep 08, 2014
Location: Swindon

Re: HTTPError 408 Timeout

23314918617956119: Completed
Tesla EV Control Tesla request doRefresh for vehicle 69371731399089401: Initialising
Tesla EV Control Tesla request charge_state for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: charge_state
Tesla EV Control Tesla request drive_state for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: drive_state
Tesla EV Control Tesla request climate_state for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: climate_state
Tesla EV Control Tesla request vehicle_state for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: vehicle_state
Tesla EV Control Tesla request gui_settings for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: gui_settings
Tesla EV Control Tesla request vehicle_config for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: vehicle_config
Tesla EV Control Tesla request doRefresh for vehicle 23314918617956119: Initialising
Tesla EV Control Tesla request charge_state for vehicle 23314918617956119: Initialising
Tesla EV Control Tesla request charge_state for vehicle 23314918617956119: Data received
Tesla EV Control Tesla request charge_state for vehicle 23314918617956119: Completed
Tesla EV Control Tesla request drive_state for vehicle 23314918617956119: Initialising
Tesla EV Control Tesla request drive_state for vehicle 23314918617956119: Data received
Tesla EV Control Tesla request drive_state for vehicle 23314918617956119: Completed
Tesla EV Control Tesla request climate_state for vehicle 23314918617956119: Initialising
Tesla EV Control Tesla request climate_state for vehicle 23314918617956119: Data received
Tesla EV Control Tesla request climate_state for vehicle 23314918617956119: Completed
Tesla EV Control Tesla request vehicle_state for vehicle 23314918617956119: Initialising
Tesla EV Control Tesla request vehicle_state for vehicle 23314918617956119: Data received
Tesla EV Control Skipping state media_state: JSON Dict found
Tesla EV Control Skipping state software_update: JSON Dict found
Tesla EV Control Skipping state speed_limit_mode: JSON Dict found
Tesla EV Control Tesla request vehicle_state for vehicle 23314918617956119: Completed
Tesla EV Control Tesla request gui_settings for vehicle 23314918617956119: Initialising
Tesla EV Control Tesla request gui_settings for vehicle 23314918617956119: Data received
Tesla EV Control Tesla request gui_settings for vehicle 23314918617956119: Completed
Tesla EV Control Tesla request vehicle_config for vehicle 23314918617956119: Initialising
Tesla EV Control Tesla request vehicle_config for vehicle 23314918617956119: Data received
Tesla EV Control Tesla request vehicle_config for vehicle 23314918617956119: Completed
Tesla EV Control Tesla request doRefresh for vehicle 69371731399089401: Initialising
Tesla EV Control Tesla request charge_state for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: charge_state
Tesla EV Control Tesla request drive_state for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: drive_state
Tesla EV Control Tesla request climate_state for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: climate_state
Tesla EV Control Tesla request vehicle_state for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: vehicle_state
Tesla EV Control Tesla request gui_settings for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: gui_settings
Tesla EV Control Tesla request vehicle_config for vehicle 69371731399089401: Initialising
Tesla EV Control Error HTTP Error 408: Request Timeout
Tesla EV Control Error Timeout retrieving status: vehicle_config

Posted on
Fri Sep 20, 2019 1:44 pm
shapa offline
Posts: 483
Joined: Sep 08, 2014
Location: Swindon

Re: HTTPError 408 Timeout

May be to increase timeouts?

Posted on
Fri Sep 20, 2019 2:19 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: HTTPError 408 Timeout

Unfortunately @gusta who's login details i've been using for over 12 months has currently disabled mobile access to his Tesla, possibly for whilst in for maintainance. Was live until 16th September.

I've switched to @Brian's details which are still live (and PM'd him accordingly) so will keep an eye on the plugin, but I've still seen zero timeout issues with Gusta's in the log for months.

Posted on
Mon Nov 11, 2019 6:07 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: HTTPError 408 Timeout

Right, good news on the 408 Timeout.

@Brian’s car has been reliably throwing 408 errors for the last two days, which has allowed me to test against it.

I’ve discovered by using a different module (requests instead of urllib2) that when it throws 408, it also sends message “vehicle unavailable”, or in other words, “vehicle is asleep”.

So by sending wake_up to the car, it then stops throwing 408’s and starts giving data we expect.

I’m going to rewrite the plugin to use requests instead of urllib2, then I can properly handle the vehicle_unavailable error and automatically send wake_up.

It’ll be a couple of days at least as I’m not around tomorrow.


Sent from my iPhone using Tapatalk Pro

Who is online

Users browsing this forum: No registered users and 1 guest