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.03k stars 323 forks source link

AWS-ConfigureAWSPackage returns invalid memory address or nil pointer dereference! #438

Closed jkroepke closed 2 years ago

jkroepke commented 2 years ago

Hi,

i'm trying to install the AmazonCloudWatchAgent on my ARM64 based Linux instance. I'm running v3.1.1188.0 on linux arm64

To install the AmazonCloudWatchAgent, I'm running:

aws ssm send-command --document-name "AWS-ConfigureAWSPackage" --instance-ids i-0b1615f6a27caa92f --parameters '{"action":["Install"],"name":["AmazonCloudWatchAgent"]}'

The systems manager UI returns

Plugin crashed with message runtime error: invalid memory address or nil pointer dereference!

Log files:

2022-04-07 15:24:38 INFO [ssm-agent-worker] [MessageService] [MGSInteractor] Sending reply {
  "additionalInfo": {
    "agent": {
      "lang": "en-US",
      "name": "amazon-ssm-agent",
      "os": "",
      "osver": "1",
      "ver": "3.1.1188.0"
    },
    "dateTime": "2022-04-07T15:24:38.692Z",
    "runId": "",
    "runtimeStatusCounts": {
      "Failed": 1,
      "Skipped": 1
    }
  },
  "documentStatus": "InProgress",
  "documentTraceOutput": "",
  "runtimeStatus": {
    "configurePackage": {
      "status": "Failed",
      "code": 1,
      "name": "aws:configurePackage",
      "output": "Plugin crashed with message runtime error: invalid memory address or nil pointer dereference!",
      "startDateTime": "2022-04-07T15:24:37.186Z",
      "endDateTime": "2022-04-07T15:24:38.691Z",
      "outputS3BucketName": "",
      "outputS3KeyPrefix": "",
      "stepName": "",
      "standardOutput": "",
      "standardError": ""
    }
  }
}

error.log:

2022-04-07 15:24:38 ERROR [WithError @ trace.go.223] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] failed to find platform: failed to collect data: unknown platform: flatcar
2022-04-07 15:24:38 ERROR [logTraceDone @ trace.go.106] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] done with download artifact - error: failed to find platform: failed to collect data: unknown platform: flatcar
2022-04-07 15:24:38 ERROR [WithError @ trace.go.223] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] failed to find platform: failed to collect data: unknown platform: flatcar
2022-04-07 15:24:38 ERROR [logTraceDone @ trace.go.106] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] done with download artifact - error: failed to find platform: failed to collect data: unknown platform: flatcar
2022-04-07 15:24:38 ERROR [WithError @ trace.go.223] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] failed to find platform: failed to collect data: unknown platform: flatcar
2022-04-07 15:24:38 ERROR [WithError @ trace.go.223] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] failed to find platform: failed to collect data: unknown platform: flatcar
2022-04-07 15:24:38 ERROR [logTraceDone @ trace.go.106] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] done with ensure package is locally available - error: failed to find platform: failed to collect data: unknown platform: flatcar
2022-04-07 15:24:38 ERROR [1 @ runpluginutil.go.327] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] Plugin crashed with message runtime error: invalid memory address or nil pointer dereference!
2022-04-07 15:24:38 ERROR [1 @ runpluginutil.go.329] [ssm-document-worker] [21a32c7d-a74a-40c0-bfca-a8a6b1d89006] [DataBackend] [pluginName=aws:configurePackage] Stacktrace:
goroutine 11 [running]:
runtime/debug.Stack()
    runtime/debug/stack.go:24 +0x88
github.com/aws/amazon-ssm-agent/agent/framework/runpluginutil.glob..func1.1(0x40005c5370, {0xffff7f864618, 0x400032e300})
    github.com/aws/amazon-ssm-agent/agent/framework/runpluginutil/runpluginutil.go:327 +0x184
panic({0xffff7f6db260, 0xffff7fd31860})
    runtime/panic.go:1038 +0x21c
github.com/aws/amazon-ssm-agent/agent/plugins/configurepackage/birdwatcher/birdwatcherservice.(*PackageService).ReportResult(0x400028e070, {0xffff7f85c4c0, 0x40004e5b80}, {{0x4000348330, 0x15}, {0x40003480f0, 0x11}, {0x0, 0x0}, {0x4000334480, ...}, ...})
    github.com/aws/amazon-ssm-agent/agent/plugins/configurepackage/birdwatcher/birdwatcherservice/birdwatcherservice.go:146 +0x2ec
github.com/aws/amazon-ssm-agent/agent/plugins/configurepackage.(*Plugin).execute(0x40002f49c0, {{0x0, 0x0}, {0xffff7f6cbd80, 0x4000383bc0}, {0x400039c1e0, 0x4c}, {0x0, 0x0}, 0x0, ...}, ...)
    github.com/aws/amazon-ssm-agent/agent/plugins/configurepackage/configurepackage.go:631 +0x1674
github.com/aws/amazon-ssm-agent/agent/plugins/configurepackage.(*Plugin).Execute(0x40002f49c0, {{0x0, 0x0}, {0xffff7f6cbd80, 0x4000383bc0}, {0x400039c1e0, 0x4c}, {0x0, 0x0}, 0x0, ...}, ...)
    github.com/aws/amazon-ssm-agent/agent/plugins/configurepackage/configurepackage.go:523 +0x6c
github.com/aws/amazon-ssm-agent/agent/framework/runpluginutil.executePlugin({0xffff7f83e120, 0x40002f49c0}, {0x400003ca50, 0x14}, {0x40000374c0, 0x10}, {{0x0, 0x0}, {0xffff7f6cbd80, 0x4000383bc0}, ...}, ...)
    github.com/aws/amazon-ssm-agent/agent/framework/runpluginutil/runpluginutil.go:407 +0x138
github.com/aws/amazon-ssm-agent/agent/framework/runpluginutil.glob..func1({0xffff7f852a28, 0x4000398900}, {0xffff7f8412e0, 0xffff7fdd2d10}, {0x400003ca50, 0x14}, {{0x0, 0x0}, {0xffff7f6cbd80, 0x4000383bc0}, ...}, ...)
    github.com/aws/amazon-ssm-agent/agent/framework/runpluginutil/runpluginutil.go:374 +0x510
github.com/aws/amazon-ssm-agent/agent/framework/runpluginutil.RunPlugins({0xffff7f852a28, 0x4000398900}, {0x40003d8000, 0x2, 0x4}, {{0x4000074a80, 0x63}, {0x0, 0x0}, {0x4000038e40, ...}, ...}, ...)
    github.com/aws/amazon-ssm-agent/agent/framework/runpluginutil/runpluginutil.go:209 +0x11f0
main.glob..func1({0xffff7f852a28, 0x4000398900}, {{{0x400003a3f0, 0x24}, {0x400003a420, 0x24}, {0x0, 0x0}, {0x400003c900, 0x13}, ...}, ...}, ...)
    github.com/aws/amazon-ssm-agent/agent/framework/processor/executer/outofproc/worker/main.go:33 +0x94
created by github.com/aws/amazon-ssm-agent/agent/framework/processor/executer/outofproc/messaging.(*WorkerBackend).Process.func1
    github.com/aws/amazon-ssm-agent/agent/framework/processor/executer/outofproc/messaging/backend.go:156 +0xb0