G-Two / subarulink

A python package for interacting with Subaru STARLINK remote vehicle services.
Apache License 2.0
84 stars 14 forks source link

Error when session cookie expires and API request is invoked under new session. #2

Closed G-Two closed 4 years ago

G-Two commented 4 years ago

This may only affect accounts with multiple vehicles. Error persists even when supplying selectedVin to login.json. Must fix prior to publishing new release. Likely solution is just to call selectVehicle.json when validateSession.json fails (indicating the session cookie has expired) after login.json succeeds. It might also be helpful to add a debug print to indicate the result of validateSession.json.

Debug log:

subarulink.controller - DEBUG - Fetching vehicle status from Subaru
subarulink.connection - DEBUG - GET: https://mobileapi.prod.subarucs.com/g2v15/validateSession.json
subarulink.connection - DEBUG - POST: https://mobileapi.prod.subarucs.com/g2v15/login.json
subarulink.connection - DEBUG - Client authentication successful
subarulink.connection - DEBUG - GET: https://mobileapi.prod.subarucs.com/g2v15/service/g2/condition/execute.json
subarulink.connection - DEBUG - {'errorCode': 'error',
 'errorMessage': 'java.lang.NullPointerException - null',
 'httpCode': 500}
stboch commented 4 years ago

I noticed this same issue. I only have one car assigned to my account.