SSM 代理更新后,AWS 实例从 SSM 托管实例中删除

问题描述

我能够启动一个实例并让它由系统管理员管理。也就是说,直到它自动更新 SSM 代理。更新成功,从3.0.161.0更新到3.0.854.0。操作系统为 Ubuntu 20.04。

我仍然可以使用会话管理器连接到实例,尽管它没有出现在托管实例列表中。

不确定这是否相关,但这里是 /var/log/amazon/ssm/errors.log

2021-03-21 03:56:50 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [MessagingDeliveryService] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b
2021-03-21 03:56:50 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [Offlineservice] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b
2021-03-21 03:56:51 ERROR [Process @ backend.go.139] [ssm-document-worker] [28785d7e-bfaf-414b-bd02-fc3a1746610b] [DataBackend] Failed to unmarshal plugin config: json: cannot unmarshal object into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type string
2021-03-21 03:56:51 ERROR [Messaging @ messaging.go.145] [ssm-document-worker] [28785d7e-bfaf-414b-bd02-fc3a1746610b] messaging pipeline process datagram encountered error: json: cannot unmarshal object into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditionsof type string
2021-03-21 03:56:50 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [MessageGatewayService] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b
2021-03-21 03:56:50 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [MessagingDeliveryService] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b
2021-03-21 03:56:50 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [Offlineservice] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b
2021-03-21 03:56:50 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [MessageGatewayService] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b
2021-03-21 03:56:51 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [MessagingDeliveryService] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b
2021-03-21 03:56:51 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [Offlineservice] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b
2021-03-21 03:56:51 ERROR [GetDocumentState @ docmanager.go.147] [ssm-agent-worker] [MessageGatewayService] encountered error with message json: cannot unmarshal string into Go struct field Configuration.InstancePluginsinformation.Configuration.Preconditions of type contracts.PreconditionArgument while reading Interim state of command from file - 28785d7e-bfaf-414b-bd02-fc3a1746610b

知道这个问题的原因是什么吗?

解决方法

我相信这是来自 AWS 的错误。我使用 Terraform 并使用与我昨天测试的完全相同的配置,现在可以按预期工作。