3

I am using Awslogs on Amazon Linux 2, but my awslogs agent does not seem to start successfully. I am using this documentation

When I look at the service journal systemctl -l status awslogsd

● awslogsd.service - awslogs daemon
   Loaded: loaded (/usr/lib/systemd/system/awslogsd.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Fri 2018-12-14 15:04:44 UTC; 1s ago
  Process: 32407 ExecStart=/usr/sbin/awslogsd (code=exited, status=255)
 Main PID: 32407 (code=exited, status=255)

Dec 14 15:04:44 ip-172-31-47-115.eu-central-1.compute.internal systemd[1]: awslogsd.service: main process exited, code=exited, status=255/n/a
Dec 14 15:04:44 ip-172-31-47-115.eu-central-1.compute.internal systemd[1]: Unit awslogsd.service entered failed state.
Dec 14 15:04:44 ip-172-31-47-115.eu-central-1.compute.internal systemd[1]: awslogsd.service failed.

When looking at /var/log/awslogs.log I have

2018-12-14 15:02:04,640 - cwlogs.push - INFO - 31514 - MainThread - Missing or invalid value for use_gzip_http_content_encoding config. Defaulting to use gzip encoding.
2018-12-14 15:02:04,640 - cwlogs.push - INFO - 31514 - MainThread - Missing or invalid value for queue_size config. Defaulting to use 10
2018-12-14 15:02:04,640 - cwlogs.push - INFO - 31514 - MainThread - Using default logging configuration.

unable to open database file

looping infinitely

Any help ?

Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164
  • After googling a bit, this sounds like a SQlite bug. Did they change the implementation of awslogs to use a database ? Maybe the database is missing in the Amazon Linux 2 packages ? how can I fix this ? – Cyril Duchon-Doris Dec 14 '18 at 15:14

1 Answers1

4

I have been using scripts from several years ago, seems like the aws config has changed since, and I had to review my /etc/awslogs/awslogs.conf

Especially, the default state file had changed. The new one being state_file = /var/lib/awslogs/agent-state (under /lib/). Previously this file was in a different folder, and therefore did not exist in Amazon Linux 2, hence generating the crash

Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164