aws / amazon-ssm-agent

An agent to enable remote management of your EC2 instances, on-premises servers, or virtual machines (VMs).
https://aws.amazon.com/systems-manager/
Apache License 2.0
1.06k stars 325 forks source link

amazon-ssm-agent-3.2.582.0_2 failing to start on FreeBSD #515

Open sustephen opened 1 year ago

sustephen commented 1 year ago

Update amazon-ssm-agent from 2.3.1205.0_1 to latest 3.2.582.0_2, the agent is failing with failed to read runtime config 'identity_config.json'.

root@ip-10-1-200-164 : /var/log/amazon/ssm > cat errors.log 2023-03-21 23:11:34 ERROR [newAgentIdentityInner @ identity_selector.go.99] [ssm-agent-worker] Agent failed to assume any identity 2023-03-21 23:11:34 ERROR [NewAgentIdentity @ identity_selector.go.112] [ssm-agent-worker] failed to find identity, retrying: failed to find agent identity 2023-03-21 23:11:34 ERROR [newAgentIdentityInner @ identity_selector.go.99] [ssm-agent-worker] Agent failed to assume any identity 2023-03-21 23:11:34 ERROR [NewAgentIdentity @ identity_selector.go.112] [ssm-agent-worker] failed to find identity, retrying: failed to find agent identity

root@ip-10-1-200-164 : /var/log/amazon/ssm > cat amazon-ssm-agent.log | tail -n 5 2023-03-21 23:15:42 WARN [ssm-agent-worker] failed to read runtime config 'identity_config.json': open /var/run/amazon/ssm/runtimeconfig/identity_config.json: no such file or directory 2023-03-21 23:15:42 INFO [ssm-agent-worker] Checking if agent identity type CustomIdentity can be assumed 2023-03-21 23:15:42 WARN [ssm-agent-worker] failed to read runtime config 'identity_config.json': open /var/run/amazon/ssm/runtimeconfig/identity_config.json: no such file or directory 2023-03-21 23:15:42 ERROR [ssm-agent-worker] Agent failed to assume any identity 2023-03-21 23:15:42 ERROR [ssm-agent-worker] error occurred when starting ssm-agent-worker: failed to find agent identity

sustephen commented 1 year ago

For FreeBSD, we've change a couple paths.

[root@ss-bsd11 /usr/ports/sysutils/amazon-ssm-agent/files]# cat patch-agent_appconfig_constants__unix.go --- agent/appconfig/constants_unix.go.orig 2023-02-07 10:44:36.000000000 -0800 +++ agent/appconfig/constants_unix.go 2023-03-21 11:41:05.278740000 -0700 @@ -29,7 +29,7 @@ var (

    // AgentExtensions specified the root folder for various kinds of downloaded content