Troubleshooting Applications on Kontainers

Overview

When your application experiences errors or unexpected behavior, there are a number of mechanisms you can use within Engine Yard Kontainers (EYK) to help troubleshoot the issue. These mechanisms include logs, inspection of your container by running commands using apps:run, and information in this article on common errors and their solutions.

 


Solution

Logging

Both the EYK Web Console and CLI provide direct access to your application's latest log activity. From the Logs tab, you can access your own instance of Kibana, which is used to collect your application log data.

  1. To view logs through the CLI 
    • Open a command line and make sure you have run eyk ssologin
    • Navigate to the directory of your application project
    • Run the command
      • eyk logs
  2. To view logs through the EYK Web Console
    • You will arrive on the Applications page:
      1. Click on the Application Tile of the Application that you want to Manage Releases for
    • You will arrive on the Application's Dashboard:
      1. Click the Logs tab at the top
        application_dash_1_1.png
    • On the Logs tab:
      1. App Logs: Displays the latest application logs from your application 
      2. View all Logs: Click the View all Logs button to open your instance of Kibana where you can perform queries and see your complete log data
      3. mceclip0.png

Inspection

You can use the eyk apps:run command to execute commands on your container. You do not get to choose which container the command is executed, so this is useful primarily if you want to verify your container image is setup the way you expected. For example, to see what files are in the /app directory, open a command line and run the following command:

eyk apps:run "ls -ltr /app"

For the sample Ruby Quiz application, the output is as follows:

Running 'ls -ltr /app'...
total 36
drwxrwxr-x  2 root root   19 Jan 12 11:52 vendor
drwxrwxr-x  9 root root  179 Jan 12 11:52 test
drwxrwxr-x  2 root root   19 Jan 12 11:52 storage
drwxrwxr-x  2 root root  159 Jan 12 11:52 public
-rw-rw-r--  1 root root   62 Jan 12 11:52 package.json
drwxrwxr-x  4 root root   33 Jan 12 11:52 lib
drwxrwxr-x  1 root root   23 Jan 12 11:52 db
-rw-rw-r--  1 root root  130 Jan 12 11:52 config.ru
drwxrwxr-x  5 root root  252 Jan 12 11:52 config
drwxrwxr-x  2 root root   98 Jan 12 11:52 bin
drwxrwxr-x 10 root root  124 Jan 12 11:52 app
-rw-rw-r--  1 root root  227 Jan 12 11:52 Rakefile
-rw-rw-r--  1 root root  374 Jan 12 11:52 README.md
-rw-rw-r--  1 root root   52 Jan 12 11:52 Procfile
-rw-rw-r--  1 root root 5369 Jan 12 11:52 Gemfile.lock
-rw-rw-r--  1 root root 2210 Jan 12 11:52 Gemfile
-rw-rw-r--  1 root root  479 Jan 12 13:28 Dockerfile
drwxrwxr-x  1 root root   19 Jan 12 13:28 tmp
drwxrwxr-x  1 root root   29 Jan 12 13:28 log

Common Errors

If a deployment fails, you will often see the error when you run the git push eyk command. In some cases, the git push succeeds but when you run 'eyk open', either your application is not visible or you see an error message. In these cases, the root cause can often be identified by looking at the most recent logs using the following command:

eyk logs

Port error for non-web applications

If you do not need a web process type, you may experience the following error:

Error running git receive hook [The controller returned an error when publishing
the release: Unknown Error (400): {"detail":"Expose a port or make the app non
routable by changing the process type"}]

To resolve this issue, navigate to the EYK Web Console and click on your application. Go to the Config tab and scroll down. Disable routing for your application by clicking the toggle control and hitting the apply button.

Routing.png

Error attempting to connect your Rails application to your Database

During a rails db:migrate command or other database interaction, you may see the following error.

Caused by: ArgumentError: key must be 16 bytes

This can occur because either the build process or the deployed container does not have your master key. You can follow the directions in Using a Database with your Kontainers Application to make sure it is properly configured. The relevant portion of that article is to ensure you have run the following commands. Note that the export commands are operating system shell commands and the format will vary based on your platform. 

eyk config:set RAILS_MASTER_KEY=avalue
eyk config:set DEIS_DOCKER_BUILD_ARGS_ENABLED=1
export DEIS_DOCKER_BUILD_ARGS_ENABLED=1
export RAILS_MASTER_KEY=avalue

Back to top


Related Articles

Back to top

Comments

Article is closed for comments.