Application Troubleshooting

Basic troubleshooting guide for application recovery assistance

Logging

Lens AppIQ aggregates stdout and stderr from every individual application process, making it easier to troubleshoot potential problems.

On its default installation, Lens AppIQ has all logs available using the app log command. This command can be used, as shown below:

$ lapps app log -a <appname>
2014-12-11 16:36:17 -0200 [shipa][api]:  ---> Removed route from unit 1d913e0910
2014-12-11 16:36:17 -0200 [shipa][api]: ---- Removing 1 old unit ----
2014-12-11 16:36:22 -0200 [app][11f863b2c14b]: Starting gunicorn 18.0
2014-12-11 16:36:22 -0200 [app][11f863b2c14b]: Listening at: http://0.0.0.0:8100 (51)
2014-12-11 16:36:22 -0200 [app][11f863b2c14b]: Using worker: sync
2014-12-11 16:36:22 -0200 [app][11f863b2c14b]: Booting worker with pid: 60
2014-12-11 16:36:28 -0200 [shipa][api]:  ---> Removed old unit 1/1

By default, Lens AppIQ shows the last ten log lines. To see more lines, use the -l/--lines parameter.

lapps app log -a <appname> --lines 200

Logs can be filtered by unit and by source. To filter by unit, use the -u/โ€“unit parameter.

$ lapps app log -a <appname> --unit 12f834b2c61c
2014-12-11 16:36:22 -0200 [app][11f863b2c14b]: Starting gunicorn 18.0
2014-12-11 16:36:22 -0200 [app][11f863b2c14b]: Listening at: http://0.0.0.0:8100 (51)
2014-12-11 16:36:22 -0200 [app][11f863b2c14b]: Using worker: sync

๐Ÿ“˜

Application Unit ID

To find the unit id of an application, run the lapps app-info -a command.

Lens AppIQ also supports real-time logging, where the app log command has a -f/--follow option that prevents the log from stopping and waiting for the new log data.

This option allows observing the real-time behavior of the application, which is quite helpful when debugging issues:

lapps app log -a <appname> --follow

Application Restart

A simple restart solves some application issues. For example, the application may need to be restarted after a schema change to the database.

Restarting can be done by running the command below:

lapps app restart -a appname

Application Units

To find the status of the application units, run the app info command as shown below:

lapps app info -a appname

Shell Into Application

To open a remote shell to one of the application units, run the app shell command.

lapps app shell -a appname

To open the shell session to a specific unit ID, use the example below.

lapps app shell -a appname <unit-id>

Unlocking Applications

Sometimes an Application might be stuck due to a Lens AppIQ Event or locked for other reasons.

lapps app unlock -a AppName

If locked by a specific Event outside of the scope of the application, you can cancel the associated Lens AppIQ Event by running the command below (look up the Event ID in the UI under the Events page).

lapps event cancel [eventID] "Cancelation Reason Message"

Whatโ€™s Next