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

Teslamate 1.14 crash #336

Closed
ivaxdr opened this issue Jan 2, 2020 · 1 comment
Closed

Teslamate 1.14 crash #336

ivaxdr opened this issue Jan 2, 2020 · 1 comment
Labels
kind:bug Something isn't working

Comments

@ivaxdr
Copy link

ivaxdr commented Jan 2, 2020

On version 1.14 Teslamate crashed at start.

log:Attaching to teslamate_teslamate_1
teslamate_1  | waiting for postgres at db:5432 (2sec)
teslamate_1  | 21:20:32.181 [info] Already up
teslamate_1  | 21:20:57.287 [info] Version: 1.14.1
teslamate_1  | 21:21:07.161 [warn] Token refresh failed: %TeslaApi.Error{
teslamate_1  |   env: %Mojito.Response{
teslamate_1  |     body: %{
teslamate_1  |       "error" => "invalid_grant",
teslamate_1  |       "error_description" => "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
teslamate_1  |     },
teslamate_1  |     complete: true,
teslamate_1  |     headers: [
teslamate_1  |       {"server", "nginx"},
teslamate_1  |       {"date", "Thu, 02 Jan 2020 21:22:13 GMT"},
teslamate_1  |       {"content-type", "application/json; charset=utf-8"},
teslamate_1  |       {"transfer-encoding", "chunked"},
teslamate_1  |       {"connection", "keep-alive"},
teslamate_1  |       {"x-frame-options", "SAMEORIGIN"},
teslamate_1  |       {"x-xss-protection", "1; mode=block"},
teslamate_1  |       {"x-content-type-options", "nosniff"},
teslamate_1  |       {"cache-control", "no-store"},
teslamate_1  |       {"pragma", "no-cache"},
teslamate_1  |       {"www-authenticate",
teslamate_1  |        "Bearer realm=\"Doorkeeper\", error=\"invalid_grant\", error_description=\"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.\""},
teslamate_1  |       {"x-request-id", "6a8c587c-6758-415b-93ae-8c8c2a471ea3"},
teslamate_1  |       {"x-runtime", "0.006392"}
teslamate_1  |     ],
teslamate_1  |     status_code: 401
teslamate_1  |   },
teslamate_1  |   message: "Failed to authenticate.",
teslamate_1  |   reason: :authentication_failure
teslamate_1  | }
teslamate_1  | 21:21:07.164 [error] GenServer TeslaMate.Api terminating
teslamate_1  | ** (FunctionClauseError) no function clause matching in TeslaMate.Api.handle_info/2
teslamate_1  |     (teslamate) lib/teslamate/api.ex:109: TeslaMate.Api.handle_info({#Reference<0.1089146806.50331652.68977>, :ok}, %TeslaMate.Api{deps: %{auth: TeslaMate.Auth, vehicles: TeslaMate.Vehicles}, name: TeslaMate.Api})
teslamate_1  |     (stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
teslamate_1  |     (stdlib) gen_server.erl:711: :gen_server.handle_msg/6
teslamate_1  |     (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
teslamate_1  | Last message: {#Reference<0.1089146806.50331652.68977>, :ok}
teslamate_1  | 21:21:07.204 [info] Running TeslaMateWeb.Endpoint with cowboy 2.7.0 at :::4000 (http)
teslamate_1  | 21:21:07.212 [info] Access TeslaMateWeb.Endpoint at http://localhost
teslamate_1  | 21:21:07.260 [info] Application teslamate exited: TeslaMate.Application.start(:normal, []) returned an error: shutdown: failed to start child: TeslaMate.Vehicles
teslamate_1  |     ** (EXIT) an exception was raised:
teslamate_1  |         ** (ArgumentError) argument error
teslamate_1  |             (stdlib) :ets.lookup(TeslaMate.Api, :auth)
teslamate_1  |             (teslamate) lib/teslamate/api.ex:142: TeslaMate.Api.fetch_auth/1
teslamate_1  |             (teslamate) lib/teslamate/api.ex:30: TeslaMate.Api.list_vehicles/1
teslamate_1  |             (teslamate) lib/teslamate/vehicles.ex:77: TeslaMate.Vehicles.list_vehicles!/0
teslamate_1  |             (teslamate) lib/teslamate/vehicles.ex:51: TeslaMate.Vehicles.init/1
teslamate_1  |             (stdlib) supervisor.erl:295: :supervisor.init/1
teslamate_1  |             (stdlib) gen_server.erl:374: :gen_server.init_it/2
teslamate_1  |             (stdlib) gen_server.erl:342: :gen_server.init_it/6
teslamate_1  | {"Kernel pid terminated",application_controller,"{application_start_failure,teslamate,{{shutdown,{failed_to_start_child,'Elixir.TeslaMate.Vehicles',{badarg,[{ets,lookup,['Elixir.TeslaMate.Api',auth],[]},{'Elixir.TeslaMate.Api',fetch_auth,1,[{file,\"lib/teslamate/api.ex\"},{line,142}]},{'Elixir.TeslaMate.Api',list_vehicles,1,[{file,\"lib/teslamate/api.ex\"},{line,30}]},{'Elixir.TeslaMate.Vehicles','list_vehicles!',0,[{file,\"lib/teslamate/vehicles.ex\"},{line,77}]},{'Elixir.TeslaMate.Vehicles',init,1,[{file,\"lib/teslamate/vehicles.ex\"},{line,51}]},{supervisor,init,1,[{file,\"supervisor.erl\"},{line,295}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,374}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,342}]}]}}},{'Elixir.TeslaMate.Application',start,[normal,[]]}}}"}
teslamate_1  | Kernel pid terminated (application_controller) ({application_start_failure,teslamate,{{shutdown,{failed_to_start_child,'Elixir.TeslaMate.Vehicles',{badarg,[{ets,lookup,['Elixir.TeslaMate.Api',auth],[]
teslamate_1  | 
teslamate_1  | Crash dump is being written to: erl_crash.dump...done
teslamate_1  | 21:21:18.582 [info] Already up

If I downgrade to 1.13 it works but can't edit Geofences, I solved Geofences adding "phase_correction" to the database.

@adriankumpf adriankumpf added the kind:bug Something isn't working label Jan 3, 2020
@adriankumpf
Copy link
Collaborator

Apparently the token refresh failed but instead of prompting you to login again it fails. I'll fix it later.

To get it working quickly you can delete the entry from the database table tokens and restart the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants