Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where and how to read results of ebextensions execution?

I added .ebextensions/start.config file to the root folder of my WAR bundle (as suggested by AWS), deployed it to Elastic Beanstalk, but nothing happened. Where in the EC2 instance can I see log of this file processing? Or maybe I can see this information in TAIL report of EBT?

like image 469
yegor256 Avatar asked Oct 11 '12 09:10

yegor256


People also ask

How do I check my Ebextensions?

You can tail some logs in the web UI to see whether your . ebextensions worked (via Elastic Beanstalk → view an environment → Logs). You should see a success or fail message for each command you define. (For example, for a command named 01_setup you'll see a message like command 01_setup succeeded .)

Where is PHP INI in Elastic Beanstalk?

ini file to /etc/php. d/ on the instances in your environment. The main configuration file, php. ini , pulls in settings from files in this folder in alphabetical order.

What is Elastic Beanstalk config Yml?

Elastic Beanstalk supports two methods of saving configuration option settings. Configuration files in YAML or JSON format can be included in your application's source code in a directory named . ebextensions and deployed as part of your application source bundle. You create and manage configuration files locally.

What format can source files be in for Amazon Elastic Beanstalk?

Your source bundle must meet the following requirements: Consist of a single ZIP file or WAR file (you can include multiple WAR files inside your ZIP file) Not exceed 512 MB. Not include a parent folder or top-level directory (subdirectories are fine)


2 Answers

Snapshot the Logs for your Elastic Beanstalk environment through the online console.

When you view the logs, search for a section beginning "cfn-init.log".

In that section you'll see entries like

2013-08-30 10:25:13,517 [INFO] Command 01-ec2setcomputername-enable succeeded
2013-08-30 10:25:24,516 [INFO] Command 02-install-server-monitor succeeded
2013-08-30 10:25:30,115 [INFO] Command 03-install-agent succeeded

where 01-ec2setcomputername-enable, etc. are the names of the commands in my .config file. If the command fails, you should see the error message here too.

like image 79
Samuel Jack Avatar answered Oct 08 '22 11:10

Samuel Jack


You can tail some logs in the web UI to see whether your .ebextensions worked (via Elastic Beanstalk → view an environment → Logs). You should see a success or fail message for each command you define. (For example, for a command named 01_setup you'll see a message like command 01_setup succeeded.)

Viewing command output

Although the log snapshot will show that a command failed, it won't show the command output:

[ERROR] Command 01_setup (setup.cmd) failed
[ERROR] Error encountered during build of postbuild_0_server: Command 01_setup failed
Traceback (most recent call last):
   <irrelevant traceback>

You can connect to the underlying EC2 server and view the command output in the cfn-init-cmd.log file (that's c:\cfn\log\cfn-init-cmd.log in Windows, or /var/log/cfn-init-cmd.log in Linux). This provides more useful information:

[INFO] Running command "setup.cmd"
[INFO] -----------------------Command Output-----------------------
[INFO]  'setup.cmd' is not recognized as an internal or external command,
[INFO]  operable program or batch file.
[INFO] ------------------------------------------------------------
[ERROR] Exited with error code 1

For help connecting to an EC2 instance, see Windows instructions.

Further troubleshooting

The command output also lets you run arbitrary commands to figure out what's going on. For example, which directory are the commands being executed in?

Here's the .ebextensions file:

container_commands:
  where_am_i:
    command: dir

And here's the output in cfn-init-cmd.log:

[INFO] Running command "dir"
[INFO] -----------------------Command Output-----------------------
[INFO]   Volume in drive C has no label.
[INFO]   Volume Serial Number is 12A7-BAEB
[INFO]  
[INFO]   Directory of C:\inetpub\wwwroot
[INFO]  
[INFO]  05/29/2015  05:42 PM    <DIR>          .
[INFO]  05/29/2015  05:42 PM    <DIR>          ..
[INFO]  05/29/2015  05:42 PM    <DIR>          .ebextensions
[INFO]  05/29/2015  05:31 PM    <DIR>          bin
[INFO]  05/28/2015  05:20 PM               106 Global.asax
[INFO]  05/28/2015  05:20 PM               498 packages.config
[INFO]  05/28/2015  05:20 PM             2,054 README.md
[INFO]  05/29/2015  06:56 PM             3,064 Web.config
[INFO]                 4 File(s)          5,722 bytes
[INFO]                 4 Dir(s)   4,553,273,344 bytes free
[INFO] ------------------------------------------------------------
[INFO] Completed successfully.
like image 14
Pathoschild Avatar answered Oct 08 '22 11:10

Pathoschild