How to avoid truncating log lines in greengrass component logs

0

I'm having a problem with starting SystemManagerAgent after a full system OTA upgrade. I can see in the logs that it attempts to run a command when the component starts up - and that it fails, but I can't see the full command that it attempted to run as it appears that the log line is truncated (Ending in SystemsManage...") How can I view the complete log line to debug this issue ?

for example:

*2022-09-20T08:24:19.663Z [INFO] (Copier) aws.greengrass.SystemsManagerAgent: stdout. INFO Starting agent installation. {scriptName=services.aws.greengrass.SystemsManagerAgent.lifecycle.Install.Script, serviceName=aws.greengrass.SystemsManagerAgent, currentState=NEW}

2022-09-20T08:24:20.345Z [INFO] (Copier) aws.greengrass.SystemsManagerAgent: stdout. ERROR Failed to install agent: snap install: Failed to install snap with output '' and error: exit status 10. {scriptName=services.aws.greengrass.SystemsManagerAgent.lifecycle.Install.Sc ript, serviceName=aws.greengrass.SystemsManagerAgent, currentState=NEW}

2022-09-20T08:24:20.349Z [WARN] (pool-2-thread-20) aws.greengrass.SystemsManagerAgent: shell-runner-error. {scriptName=services.aws.greengrass.SystemsManagerAgent.lifecycle.Install.Script, serviceName=aws.greengrass.SystemsManagerAgent, currentState=NEW, command=["/data/greengrass/v2/packages/artifacts-unarchived/aws.greengrass.SystemsManage..."]}

2022-09-20T08:24:20.358Z [INFO] (pool-2-thread-20) aws.greengrass.SystemsManagerAgent: shell-runner-start. {scriptName=services.aws.greengrass.SystemsManagerAgent.lifecycle.Install.Script, serviceName=aws.greengrass.SystemsManagerAgent, currentState=NEW, command=["/data/greengrass/v2/packages/artifacts-unarchived/aws.greengrass.SystemsManage..."]}*

majh
asked 2 months ago26 views
2 Answers
0

Hi @MichaelDombrowski-AWS

Here is the other information requested - I can't see how to post this as a comment in any useful way formatting wise. I can't see any obvious problem - Also, please note, that when i manuall run the command

"snap install /data/greengrass/v2/packages/artifacts-unarchived/aws.greengrass.SystemsManagerAgent/1.0.0/artifacts/amazon-ssm-agent.snap --classic"

This is works, and SystemsManagerAgent comes up sucessfully. But I can't see why it doesn't work correctly when running in the component.

# tail -F aws.greengrass.SystemsManagerAgent.
2022-09-28T05:57:42.576Z [INFO] (Copier) aws.greengrass.SystemsManagerAgent: stdout. INFO Starting agent installation. {scriptName=services.aws.greengrass.SystemsManagerAgent.lifecycle.Install.Script, serviceName=aws.greengrass.SystemsMa}
2022-09-28T05:57:43.508Z [INFO] (Copier) aws.greengrass.SystemsManagerAgent: stdout. ERROR Failed to install agent: snap install: Failed to install snap with output '' and error: exit status 10. {scriptName=services.aws.greengrass.System}
2022-09-28T05:57:43.511Z [WARN] (pool-2-thread-23) aws.greengrass.SystemsManagerAgent: shell-runner-error. {scriptName=services.aws.greengrass.SystemsManagerAgent.lifecycle.Install.Script, serviceName=aws.greengrass.SystemsManagerAgent, }

root@jeteye:/data/greengrass/v2/logs# date
Wed Sep 28 06:00:39 UTC 2022
root@jeteye:/data/greengrass/v2/logs# snap refresh --time
timer: 00:00~24:00/4
last: n/a
hold: today at 07:55 UTC
next: today at 05:59 UTC (but held)
root@jeteye:/data/greengrass/v2/logs# snap changes
ID   Status  Spawn               Ready               Summary
1    Done    today at 05:55 UTC  today at 05:55 UTC  Initialize system state
2    Done    today at 05:57 UTC  today at 05:59 UTC  Install "amazon-ssm-agent" snap from file "/data/greengrass/v2/packages/artifacts-unarchived/aws.greengrass.SystemsManagerAgent/1.0.0/artifacts/amazon-ssm-agent.snap"
3    Done    today at 05:57 UTC  today at 05:57 UTC  Initialize device
root@jeteye:/data/greengrass/v2/logs# snap change 2
Status  Spawn               Ready               Summary
Done    today at 05:57 UTC  today at 05:57 UTC  Ensure prerequisites for "amazon-ssm-agent" are available
Done    today at 05:57 UTC  today at 05:59 UTC  Prepare snap "/var/lib/snapd/snaps/.local-install-620492052" (5103)
Done    today at 05:57 UTC  today at 05:59 UTC  Mount snap "amazon-ssm-agent" (5103)
Done    today at 05:57 UTC  today at 05:59 UTC  Copy snap "amazon-ssm-agent" data
Done    today at 05:57 UTC  today at 05:59 UTC  Setup snap "amazon-ssm-agent" (5103) security profiles
Done    today at 05:57 UTC  today at 05:59 UTC  Make snap "amazon-ssm-agent" (5103) available to the system
Done    today at 05:57 UTC  today at 05:59 UTC  Automatically connect eligible plugs and slots of snap "amazon-ssm-agent"
Done    today at 05:57 UTC  today at 05:59 UTC  Set automatic aliases for snap "amazon-ssm-agent"
Done    today at 05:57 UTC  today at 05:59 UTC  Setup snap "amazon-ssm-agent" aliases
Done    today at 05:57 UTC  today at 05:59 UTC  Run install hook of "amazon-ssm-agent" snap if present
Done    today at 05:57 UTC  today at 05:59 UTC  Start snap "amazon-ssm-agent" (5103) services
Done    today at 05:57 UTC  today at 05:59 UTC  Run configure hook of "amazon-ssm-agent" snap if present
Done    today at 05:57 UTC  today at 05:59 UTC  Run health check of "amazon-ssm-agent" snap
Done    today at 05:57 UTC  today at 05:59 UTC  Ensure prerequisites for "core18" are available
Done    today at 05:57 UTC  today at 05:59 UTC  Download snap "core18" (2570) from channel "stable"
Done    today at 05:57 UTC  today at 05:59 UTC  Fetch and check assertions for snap "core18" (2570)
Done    today at 05:57 UTC  today at 05:59 UTC  Mount snap "core18" (2570)
Done    today at 05:57 UTC  today at 05:59 UTC  Copy snap "core18" data
Done    today at 05:57 UTC  today at 05:59 UTC  Setup snap "core18" (2570) security profiles
Done    today at 05:57 UTC  today at 05:59 UTC  Make snap "core18" (2570) available to the system
Done    today at 05:57 UTC  today at 05:59 UTC  Automatically connect eligible plugs and slots of snap "core18"
Done    today at 05:57 UTC  today at 05:59 UTC  Set automatic aliases for snap "core18"
Done    today at 05:57 UTC  today at 05:59 UTC  Setup snap "core18" aliases
Done    today at 05:57 UTC  today at 05:59 UTC  Run install hook of "core18" snap if present
Done    today at 05:57 UTC  today at 05:59 UTC  Start snap "core18" (2570) services
Done    today at 05:57 UTC  today at 05:59 UTC  Run health check of "core18" snap
Done    today at 05:57 UTC  today at 05:57 UTC  Ensure prerequisites for "snapd" are available
Done    today at 05:57 UTC  today at 05:58 UTC  Download snap "snapd" (17032) from channel "stable"
Done    today at 05:57 UTC  today at 05:58 UTC  Fetch and check assertions for snap "snapd" (17032)
Done    today at 05:57 UTC  today at 05:58 UTC  Mount snap "snapd" (17032)
Done    today at 05:57 UTC  today at 05:58 UTC  Copy snap "snapd" data
Done    today at 05:57 UTC  today at 05:58 UTC  Setup snap "snapd" (17032) security profiles
Done    today at 05:57 UTC  today at 05:59 UTC  Make snap "snapd" (17032) available to the system
Done    today at 05:57 UTC  today at 05:59 UTC  Automatically connect eligible plugs and slots of snap "snapd"
Done    today at 05:57 UTC  today at 05:59 UTC  Set automatic aliases for snap "snapd"
Done    today at 05:57 UTC  today at 05:59 UTC  Setup snap "snapd" aliases
Done    today at 05:57 UTC  today at 05:59 UTC  Run install hook of "snapd" snap if present
Done    today at 05:57 UTC  today at 05:59 UTC  Start snap "snapd" (17032) services
Done    today at 05:57 UTC  today at 05:59 UTC  Run health check of "snapd" snap

......................................................................
Make snap "snapd" (17032) available to the system

2022-09-28T05:59:03Z INFO Requested daemon restart (snapd snap).

......................................................................
Automatically connect eligible plugs and slots of snap "snapd"

2022-09-28T05:59:03Z INFO Waiting for automatic snapd restart...
2022-09-28T05:59:03Z INFO Waiting for automatic snapd restart...
majh
answered 2 months ago
  • @MichaelDombrowski-AWS,

    I was wondering if it was waiting for a snapd restart - perhaps this didn't happen automatically ??, so I did "systemctl restart snapd", then "systemctl restart greengrass", and it then came up successfully. Is it possible these restarts are missing from the component somehow ?

0

Hello @majh,

Seeing the command will not help you to debug the issue. The error log is never truncated. The log is ERROR Failed to install agent: snap install: Failed to install snap with output '' and error: exit status 10.

SSM is trying to install using snap. Please provide the full SSM component log and the following information

snap refresh --time

snap changes

snap change <change-id> <change-id> should be the number of the ID from snap changes which is the ID associated with installing SSM.

Cheers,

Michael

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions