You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use the "three-step" auth method as documented: env var, ~/.aws profile, ecs/instance profile. This allows our code to run on a variety of platforms with a single configuration and it works perfectly.
Today, I installed said code as a systemctl-managed daemon and that failed:
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: 16:11:21.232 [info] Getting secret /dev1/rds/projections-user#host from region us-east-1
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: 16:11:21.233 [error] GenServer ExAws.Config.AuthCache terminating
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: ** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: (elixir 1.13.4) lib/io.ex:627: IO.chardata_to_string(nil)
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: (elixir 1.13.4) lib/path.ex:538: Path.join/2
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: (ex_aws 2.4.0) lib/ex_aws/credentials_ini/file.ex:187: ExAws.CredentialsIni.File.profile_from_config/1
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: (ex_aws 2.4.0) lib/ex_aws/credentials_ini/file.ex:13: ExAws.CredentialsIni.File.security_credentials/1
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: (ex_aws 2.4.0) lib/ex_aws/config.ex:158: ExAws.Config.awscli_auth_credentials/2
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: (ex_aws 2.4.0) lib/ex_aws/config/auth_cache.ex:65: ExAws.Config.AuthCache.refresh_awscli_config/3
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: (ex_aws 2.4.0) lib/ex_aws/config/auth_cache.ex:50: ExAws.Config.AuthCache.handle_call/3
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: (stdlib 4.0.1) gen_server.erl:1146: :gen_server.try_handle_call/4
Oct 27 16:11:21 ip-192-168-0-140 metrist-orchestrator[18820]: Last message (from Orchestrator.MonitorSupervisor): {:refresh_awscli_conf
The cause is clear: the code in file.ex uses System.user_home() which ends up basically reading the HOME environment variable.
The fix could be simple as well: System.user_home() || "/" would already do the trick and is sort of the expected behavior on Unix systems - if there is no home set, the root directory will do. In most cases, this should be invisible but I'm filing this as an issue rather than as a PR because it's likely to be one of these things that people want to discuss :)
The text was updated successfully, but these errors were encountered:
That's totally fine with me - any relatively sane behaviour is preferable to a crash :) A PR to that effect would be most welcome.
Apologies for the delay getting back to you.
Seems like this is related to #932. If there's not ongoing work to this effect I'd be happy to include this protection in my PR pending a review of the desirable changes with a maintainer.
We use the "three-step" auth method as documented: env var, ~/.aws profile, ecs/instance profile. This allows our code to run on a variety of platforms with a single configuration and it works perfectly.
Today, I installed said code as a systemctl-managed daemon and that failed:
The cause is clear: the code in
file.ex
usesSystem.user_home()
which ends up basically reading theHOME
environment variable.The fix could be simple as well:
System.user_home() || "/"
would already do the trick and is sort of the expected behavior on Unix systems - if there is no home set, the root directory will do. In most cases, this should be invisible but I'm filing this as an issue rather than as a PR because it's likely to be one of these things that people want to discuss :)The text was updated successfully, but these errors were encountered: