Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Awslogs awslogsd - unable to open database file

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 ?

like image 354
Cyril Duchon-Doris Avatar asked Dec 08 '25 06:12

Cyril Duchon-Doris


1 Answers

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

like image 119
Cyril Duchon-Doris Avatar answered Dec 10 '25 00:12

Cyril Duchon-Doris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!