Currently using the Amazon web services, I successfully deployed multiple applications on Elastic Beanstalk ( with green cluster health) as Docker containers.
The problem however arises when I try to get the logs with the console; when I do "request logs", no log is found. When I then return in on the dashboard after having requested the logs, a new event/error has appeared:
[Instance: i-123456789] Command failed on instance. Return code: 1 Output: bundleLogs.py --conf-path '/opt/elasticbeanstalk/tasks/bundlelogs.d/*' --location-prefix 'resources/environments/logs/bundle/' Unable to execute method publish_contents_from_filename on any of the target objects. For more detail, check /var/log/eb-activity.log using console or EB CLI.
Trying to solve the problem, I SSHed into my cluster and used the following command to find the logs into my Docker container:
sudo docker exec myinstance cat /var/log/logstash_activity.log
My logs are found as expected.
Trying to learn more about the error, I gave a peek into the /var/log/eb-activity.log and found the following lines:
[2015-07-06T12:54:30.137Z] INFO [26993] - [CMD-BundleLogs] : Starting activity...
[2015-07-06T12:54:30.363Z] INFO [26993] - [CMD-BundleLogs/AddonsBefore] : Starting activity...
[2015-07-06T12:54:30.363Z] INFO [26993] - [CMD-BundleLogs/AddonsBefore] : Completed activity.
[2015-07-06T12:54:30.363Z] INFO [26993] - [CMD-BundleLogs/BundleLogs] : Starting activity...
[2015-07-06T12:54:30.364Z] INFO [26993] - [CMD-BundleLogs/BundleLogs/BundleLogs] : Starting activity...
[2015-07-06T12:54:30.627Z] INFO [26993] - [CMD-BundleLogs/BundleLogs/BundleLogs] : Activity execution failed, because: bundleLogs.py --conf-path '/opt/elasticbeanstalk/tasks/bundlelogs.d/*' --location-prefix 'resources/environments/logs/bundle/'
Unable to execute method publish_contents_from_filename on any of the target objects (Executor::NonZeroExitStatus)
[2015-07-06T12:54:30.627Z] INFO [26993] - [CMD-BundleLogs/BundleLogs/BundleLogs] : Activity failed.
[2015-07-06T12:54:30.627Z] INFO [26993] - [CMD-BundleLogs/BundleLogs] : Activity failed.
[2015-07-06T12:54:30.627Z] INFO [26993] - [CMD-BundleLogs] : Completed activity. Result:
Command CMD-BundleLogs failed.
The error message didn't help me much however.
In the "Logging" field of my Dockerrun.aws.json, I gave the path "/var/log" since it is the folder that contains my app logs, among others. I also tried the value "/var/log/logstash_activity.log" without more success.
Why can't the Beanstalk console find my apps' logs?