0

I have installed agent on Ubuntu 14.04... It was working fine before but then it stopped suddenly and now getting following error while starting

sudo service aws-kinesis-agent start
 * Starting aws-kinesis-agent
[ OK ] 

2016-07-10 18:46:40.373+0530 prod-api-ip-10-0-0-48 (main) com.amazon.kinesis.streaming.agent.Agent [INFO] Reading configuration from file: /etc/aws-kinesis/agent.json
2016-07-10 18:46:40.404+0530 prod-api-ip-10-0-0-48 (main) com.amazon.kinesis.streaming.agent.Agent [INFO] null: Agent will use up to 96 threads for sending data.
2016-07-10 18:46:40.411+0530 prod-api-ip-10-0-0-48 (main) com.amazon.kinesis.streaming.agent.Agent [ERROR] Unhandled error.
java.lang.RuntimeException: Failed to create or connect to the checkpoint database.
        at com.amazon.kinesis.streaming.agent.tailing.checkpoints.SQLiteFileCheckpointStore.connect(Unknown Source)
        at com.amazon.kinesis.streaming.agent.tailing.checkpoints.SQLiteFileCheckpointStore.<init>(Unknown Source)
        at com.amazon.kinesis.streaming.agent.Agent.<init>(Unknown Source)
        at com.amazon.kinesis.streaming.agent.Agent.main(Unknown Source)
Caused by: java.nio.file.AccessDeniedException: /var/run/aws-kinesis-agent
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
        at java.nio.file.Files.createDirectory(Files.java:674)
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
        at java.nio.file.Files.createDirectories(Files.java:767)
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Deepak Singhal
  • 10,568
  • 11
  • 59
  • 98
  • From the [javadoc](https://docs.oracle.com/javase/7/docs/api/java/nio/file/AccessDeniedException.html): "Checked exception thrown when a file system operation is denied, typically due to a file permission or other access check.". – Krease Jul 12 '16 at 06:58

2 Answers2

0

Add the aws-kinesis-agent-user to the sudoers group:

sudo usermod -aG sudo aws-kinesis-agent-user

Additional configurations for a working agent: https://stackoverflow.com/a/71584852/5697992

Leon Africa
  • 509
  • 6
  • 11
-1

I have personally found that Kinesis Agent is really not stable. Above problem got resolved by just restarting the agent ! But then again after 30 mins again some other exception started happening.

I would recommend to try some other agent like Clodwatch agent which can keep sending logs to CloudWatch logs ( though I have not tested that also ).

I am going with approach of using logrotate and then copying log files to S3 bucket. I know here; there can be max. lag of 1 hour.

Deepak Singhal
  • 10,568
  • 11
  • 59
  • 98