nerves-hub / nerves_hub_link

Connect devices to NervesHub via a Phoenix channel
https://hex.pm/packages/nerves_hub_link
Apache License 2.0
36 stars 18 forks source link

NervesHub API image crashing #59

Closed mrkkhattak closed 3 years ago

mrkkhattak commented 3 years ago

I am trying to setup a custom instance of NervesHub on AWS. Via the terraform repo, I am able to setup but getting issues on running the api.

nerves-hub-ca - running nerves-hub-device - running nerves-hub-www - running nerves-hub-api - crashing

The nerves-hub-api task is throwing these errors:

Crash dump is being written to: erl_crash.dump...done942d30302e5849de81cd99c590efc743 Crash dump is being written to: erl_crash.dump...done init terminating in doboot ({,[{Elixir.File,read!,1,[{},{}]},{Elixir.Enum,-map/2-lists^map/1-0-,2,[{},{_}]},{erl_eval,doapply,6,[{},{_}]},{erl_eval,exprlist,6,[{},{_}]},{erleval,expr,5,[{},{942d30302e5849de81cd99c590efc743 init terminating in doboot ({,[{Elixir.File,read!,1,[{},{}]},{Elixir.Enum,-map/2-lists^map/1-0-,2,[{},{_}]},{erl_eval,doapply,6,[{},{_}]},{erl_eval,exprlist,6,[{},{_}]},{erleval,expr,5,[{},{ 942d30302e5849de81cd99c590efc743 {"init terminating in do_boot",{#{'exception'=>true,'struct'=>'Elixir.File.Error',action=><<"read file">>,path=><<"/etc/ssl/user-root-ca.pem">>,reason=>enoent},[{'Elixir.File','read!',1,[{file,"lib/file.ex"},{line,353}]},{'Elixir.Enum','-map/2-lists^map/1-0-',2,[{file,"lib/enum.ex"},{line,1396}]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},{erl_eval,expr_list,6,[{file,"erl_eval.erl"},{line,888}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,411}]},{erl_eval,expr_list,6,[{file,"erl_eval.erl"},{line,888}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,411}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,449}]}]}}942d30302e5849de81cd99c590efc743 {"init terminating in do_boot",{#{'exception'=>true,'struct'=>'Elixir.File.Error',action=><<"read file">>,path=><<"/etc/ssl/user-root-ca.pem">>,reason=>enoent},[{'Elixir.File','read!',1,[{file,"lib/file.ex"},{line,353}]},{'Elixir.Enum','-map/2-lists^map/1-0-',2,[{file,"lib/enum.ex"},{line,1396}]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},{erl_eval,expr_list,6,[{file,"erl_eval.erl"},{line,888}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,411}]},{erl_eval,expr_list,6,[{file,"erl_eval.erl"},{line,888}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,411}]},{erl_eval,expr,5,[{file,"erl_eval.erl"},{line,449}]}]}} (File.Error) could not read file "/etc/ssl/user-root-ca.pem": no such file or directory942d30302e5849de81cd99c590efc743 (File.Error) could not read file "/etc/ssl/user-root-ca.pem": no such file or directory (elixir 1.10.4) lib/file.ex:353: File.read!/1942d30302e5849de81cd99c590efc743 (elixir 1.10.4) lib/file.ex:353: File.read!/1 (elixir 1.10.4) lib/enum.ex:1396: Enum."-map/2-lists^map/1-0-"/2942d30302e5849de81cd99c590efc743 (elixir 1.10.4) lib/enum.ex:1396: Enum."-map/2-lists^map/1-0-"/2 (stdlib 3.13.1) erl_eval.erl:680: :erl_eval.do_apply/6942d30302e5849de81cd99c590efc743 (stdlib 3.13.1) erl_eval.erl:680: :erl_eval.do_apply/6 (stdlib 3.13.1) erl_eval.erl:888: :erl_eval.expr_list/6942d30302e5849de81cd99c590efc743 (stdlib 3.13.1) erl_eval.erl:888: :erl_eval.expr_list/6 (stdlib 3.13.1) erl_eval.erl:411: :erl_eval.expr/5942d30302e5849de81cd99c590efc743 (stdlib 3.13.1) erl_eval.erl:411: :erl_eval.expr/5 (stdlib 3.13.1) erl_eval.erl:888: :erl_eval.expr_list/6942d30302e5849de81cd99c590efc743 (stdlib 3.13.1) erl_eval.erl:888: :erl_eval.expr_list/6 (stdlib 3.13.1) erl_eval.erl:411: :erl_eval.expr/5942d30302e5849de81cd99c590efc743 (stdlib 3.13.1) erl_eval.erl:411: :erl_eval.expr/5 (stdlib 3.13.1) erl_eval.erl:449: :erl_eval.expr/5942d30302e5849de81cd99c590efc743 (stdlib 3.13.1) erl_eval.erl:449: :erl_eval.expr/5 ERROR! Config provider Config.Reader failed with:942d30302e5849de81cd99c590efc743 ERROR! Config provider Config.Reader failed with: 2020-12-28 11:39:52nerves_hub_device@10.10.1.202 nerves_hub_www@10.10.2.186 nerves_hub_api@10.10.2.82942d30302e5849de81cd99c590efc743 nerves_hub_device@10.10.1.202 nerves_hub_www@10.10.2.186 nerves_hub_api@10.10.2.82 % Total % Received % Xferd Average Speed Time Time Time Current942d30302e5849de81cd99c590efc743 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed942d30302e5849de81cd99c590efc743 Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 956 100 956 0 0 933k 0 --:--:-- --:--:-- --:--:-- 933k942d30302e5849de81cd99c590efc743 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 100 956 100 956 0 0 933k 0 --:--:-- --:--:-- --:--:-- 933k download: s3://se-nh-staging-staging-ca/ssl/.empty to ../etc/ssl/.empty942d30302e5849de81cd99c590efc743 download: s3://se-nh-staging-staging-ca/ssl/.empty to ../etc/ssl/.empty

I am using _api_image = "nerveshub/nerves_hubapi:latest" in terraform.tfvars file. I don't know if this latest docker image is having issue or there is some configuration change I might be missing.

mobileoverlord commented 3 years ago

Looks like there are no certificates in your s3 bucket

download: s3://se-nh-staging-staging-ca/ssl/.empty to ../etc/ssl/.empty942d30302e5849de81cd99c590efc743
download: s3://se-nh-staging-staging-ca/ssl/.empty to ../etc/ssl/.empty

Essentially this folder needs to be populated with ssl certificates you generate https://github.com/nerves-hub/terraform/blob/main/ssl/README.md