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 324 forks source link

dpkg-query": executable file not found in $PATH flooding errors logs on Amazon Linux (1 or 2) #301

Open sbailliez opened 4 years ago

sbailliez commented 4 years ago

Running ssm-agent 2.3.1569.0

I have a ton of errors logs related to dpkg-query not found while this is running exclusively on Amazon Linux 1 or 2 OSes

2020-08-16 19:43:15 ERROR [getApplicationData @ dataProvider_unix.go.268] [ssm-document-worker] [b3e80509-330a-4358-bcbb-2abe7853e7ed.2020-08-16T19-43-15.034Z] [DataBackend] [pluginName=aws:softwareInventory] [aws:softwareInventory] Failed to execute command : dpkg-query [-W -f={"Name":"<startd4c7284b>${Package}<end1a9c2edb>","Publisher":"<startd4c7284b>${Maintainer}<end1a9c2edb>","Version":"<startd4c7284b>${Version}<end1a9c2edb>","ApplicationType":"<startd4c7284b>${Section}<end1a9c2edb>","Architecture":"<startd4c7284b>${Architecture}<end1a9c2edb>","Url":"<startd4c7284b>${Homepage}<end1a9c2edb>","Summary":"<startd4c7284b>${Description}<end1a9c2edb>","PackageId":"<startd4c7284b>${Package}_${Version}_${Architecture}.deb<end1a9c2edb>"},] with error - exec: "dpkg-query": executable file not found in $PATH
2020-08-16 20:13:26 ERROR [getApplicationData @ dataProvider_unix.go.268] [ssm-document-worker] [b3e80509-330a-4358-bcbb-2abe7853e7ed.2020-08-16T20-13-26.043Z] [DataBackend] [pluginName=aws:softwareInventory] [aws:softwareInventory] Failed to execute command : dpkg-query [-W -f={"Name":"<startfbce1197>${Package}<endd09f3d92>","Publisher":"<startfbce1197>${Maintainer}<endd09f3d92>","Version":"<startfbce1197>${Version}<endd09f3d92>","ApplicationType":"<startfbce1197>${Section}<endd09f3d92>","Architecture":"<startfbce1197>${Architecture}<endd09f3d92>","Url":"<startfbce1197>${Homepage}<endd09f3d92>","Summary":"<startfbce1197>${Description}<endd09f3d92>","PackageId":"<startfbce1197>${Package}_${Version}_${Architecture}.deb<endd09f3d92>"},] with error - exec: "dpkg-query": executable file not found in $PATH
2020-08-16 20:43:45 ERROR [getApplicationData @ dataProvider_unix.go.268] [ssm-document-worker] [b3e80509-330a-4358-bcbb-2abe7853e7ed.2020-08-16T20-43-45.074Z] [DataBackend] [pluginName=aws:softwareInventory] [aws:softwareInventory] Failed to execute command : dpkg-query [-W -f={"Name":"<starta409580f>${Package}<end072d9fd7>","Publisher":"<starta409580f>${Maintainer}<end072d9fd7>","Version":"<starta409580f>${Version}<end072d9fd7>","ApplicationType":"<starta409580f>${Section}<end072d9fd7>","Architecture":"<starta409580f>${Architecture}<end072d9fd7>","Url":"<starta409580f>${Homepage}<end072d9fd7>","Summary":"<starta409580f>${Description}<end072d9fd7>","PackageId":"<starta409580f>${Package}_${Version}_${Architecture}.deb<end072d9fd7>"},] with error - exec: "dpkg-query": executable file not found in $PATH
2020-08-16 21:14:03 ERROR [getApplicationData @ dataProvider_unix.go.268] [ssm-document-worker] [b3e80509-330a-4358-bcbb-2abe7853e7ed.2020-08-16T21-14-03.037Z] [DataBackend] [pluginName=aws:softwareInventory] [aws:softwareInventory] Failed to execute command : dpkg-query [-W -f={"Name":"<start4b5eb859>${Package}<end8a95dc50>","Publisher":"<start4b5eb859>${Maintainer}<end8a95dc50>","Version":"<start4b5eb859>${Version}<end8a95dc50>","ApplicationType":"<start4b5eb859>${Section}<end8a95dc50>","Architecture":"<start4b5eb859>${Architecture}<end8a95dc50>","Url":"<start4b5eb859>${Homepage}<end8a95dc50>","Summary":"<start4b5eb859>${Description}<end8a95dc50>","PackageId":"<start4b5eb859>${Package}_${Version}_${Architecture}.deb<end8a95dc50>"},] with error - exec: "dpkg-query": executable file not found in $PATH
2020-08-16 21:44:06 ERROR [getApplicationData @ dataProvider_unix.go.268] [ssm-document-worker] [b3e80509-330a-4358-bcbb-2abe7853e7ed.2020-08-16T21-44-06.048Z] [DataBackend] [pluginName=aws:softwareInventory] [aws:softwareInventory] Failed to execute command : dpkg-query [-W -f={"Name":"<start5b1e1567>${Package}<end9bd7d425>","Publisher":"<start5b1e1567>${Maintainer}<end9bd7d425>","Version":"<start5b1e1567>${Version}<end9bd7d425>","ApplicationType":"<start5b1e1567>${Section}<end9bd7d425>","Architecture":"<start5b1e1567>${Architecture}<end9bd7d425>","Url":"<start5b1e1567>${Homepage}<end9bd7d425>","Summary":"<start5b1e1567>${Description}<end9bd7d425>","PackageId":"<start5b1e1567>${Package}_${Version}_${Architecture}.deb<end9bd7d425>"},] with error - exec: "dpkg-query": executable file not found in $PATH
2020-08-16 22:14:26 ERROR [getApplicationData @ dataProvider_unix.go.268] [ssm-document-worker] [b3e80509-330a-4358-bcbb-2abe7853e7ed.2020-08-16T22-14-26.034Z] [DataBackend] [pluginName=aws:softwareInventory] [aws:softwareInventory] Failed to execute command : dpkg-query [-W -f={"Name":"<started8e16bd>${Package}<end16e2ad87>","Publisher":"<started8e16bd>${Maintainer}<end16e2ad87>","Version":"<started8e16bd>${Version}<end16e2ad87>","ApplicationType":"<started8e16bd>${Section}<end16e2ad87>","Architecture":"<started8e16bd>${Architecture}<end16e2ad87>","Url":"<started8e16bd>${Homepage}<end16e2ad87>","Summary":"<started8e16bd>${Description}<end16e2ad87>","PackageId":"<started8e16bd>${Package}_${Version}_${Architecture}.deb<end16e2ad87>"},] with error - exec: "dpkg-query": executable file not found in $PATH
2020-08-16 22:44:45 ERROR [getApplicationData @ dataProvider_unix.go.268] [ssm-document-worker] [b3e80509-330a-4358-bcbb-2abe7853e7ed.2020-08-16T22-44-45.035Z] [DataBackend] [pluginName=aws:softwareInventory] [aws:softwareInventory] Failed to execute command : dpkg-query [-W -f={"Name":"<starta904cb2f>${Package}<end0900441e>","Publisher":"<starta904cb2f>${Maintainer}<end0900441e>","Version":"<starta904cb2f>${Version}<end0900441e>","ApplicationType":"<starta904cb2f>${Section}<end0900441e>","Architecture":"<starta904cb2f>${Architecture}<end0900441e>","Url":"<starta904cb2f>${Homepage}<end0900441e>","Summary":"<starta904cb2f>${Description}<end0900441e>","PackageId":"<starta904cb2f>${Package}_${Version}_${Architecture}.deb<end0900441e>"},] with error - exec: "dpkg-query": executable file not found in $PATH
lutel commented 4 years ago

I have the same problem, have you find any solution to this?

killrazor commented 4 years ago

I think this is coming from https://github.com/aws/amazon-ssm-agent/blob/fcd25443e49193c447cc1a8b4f9eb6207bc49705/agent/plugins/inventory/gatherers/application/dataProvider_unix.go#L90 and shouldn't be an issue, since it will use rpm right after failing.

criterion9 commented 3 years ago

I am also getting this error on CentOS. My Amazon Linux instances are not choking on this error, however, the CentOS instance appears to fail on that error.

criterion9 commented 3 years ago

I am also getting this error on CentOS. My Amazon Linux instances are not choking on this error, however, the CentOS instance appears to fail on that error.

Turns out in my case that the distribution has been repackaged as "Sangoma" so the SSM agent was not able to correctly identify that the OS was a CentOS base. I manually adjusted the /etc/os-release to work around the issue temporarily. Would it be reasonable for the agent to check the ID_LIKE section of os-release if the OS was not matched exactly?

gowthamakanthan commented 3 years ago

Getting similar error in the Amazon Linux2

tartc390f798>${Homepage}<end80052f37>","Summary":"<startc390f798>${Description}<end80052f37>","PackageId":"<startc390f798>${Package}_${Version}_${Architecture}.deb<end80052f37>"},] with error - exec: "dpkg-query": executable file not found in $PATH
2020-11-29 21:25:35 ERROR [getApplicationData @ dataProvider_unix.go.268] [ssm-document-worker] [13421e0a-78ec-458d-b5c7-32dc225ca8af.2020-11-29T21-25-35.027Z] [DataBackend] [pluginName=aws:softwareInventory] [aws:softwareInventory] Failed to execute command : dpkg-query [-W -f={"Name":"<startc69c7d9b>${Package}<endf9bb5805>","Publisher":"<startc69c7d9b>${Maintainer}<endf9bb5805>","Version":"<startc69c7d9b>${Version}<endf9bb5805>","ApplicationType":"<startc69c7d9b>${Section}<endf9bb5805>","Architecture":"<startc69c7d9b>${Architecture}<endf9bb5805>","Url":"<startc69c7d9b>${Homepage}<endf9bb5805>","Summary":"<startc69c7d9b>${Description}<endf9bb5805>","PackageId":"<startc69c7d9b>${Package}_${Version}_${Architecture}.deb<endf9bb5805>"},] with error - exec: "dpkg-query": executable file not found in $PATH
[root@ip-172-31-23-111 ssm]# cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
[root@ip-172-31-23-111 ssm]#