Troubleshooting

Debugging via SSH

How to log in to your instance(s) via SSH to assist with debugging errors.

In some extreme cases, you may want or need to debug your instance(s) via SSH (e.g., to manually check syslogs, restart your app process, or install dependencies). If you need to access your app via SSH, you have two options:

  1. Use an existing SSH key that you've uploaded to your host.
  2. Use the SSH key Push provides for your deployment.

If you do not have an existing SSH key that you'd like to use, you can download the SSH key Push has generated for your deployment from your deployment's dashboard. To download it, navigate to the deployment you'd like to access via SSH and click the "SSH Key" tab. This will download your SSH key to your local computer.

Keep This Key In a Secure Location

It permits direct root access to your instances via SSH. It's recommended that you store it securely using a password manager, or, delete it from your computer after you've completed your debugging.

Download SSH Key
Locating the SSH Key tab.

Once you've downloaded your SSH key, in your terminal, you can SSH into your server via the ssh command line tool:

ssh -i /path/to/downloaded/key root@<instance_ip_address>

For example, if you're on MacOS and downloaded your SSH key for an app at the domain myapp.com to your ~/Downloads directory and your instance IP address was 555.555.555.555, you'd write:

ssh -i ~/Downloads/myapp.com.key root@555.555.555.555

Above, you'd replace myapp.com.key with the name of the downloaded key file's name for your deployment's domain.

By default, Push disables password-based login via root to your server (no root password is generated). An SSH key is required to access your instance.

Common SSH Debugging Techniques

Once you've SSH'd into your server, the following debugging techniques can be used to assess issues.

Checking logs

To check the raw logs for your server, run:

cat /var/log/syslog

This will print out the raw systemlog that includes the logs for your entire instance (including your Joystick app's logging). It's best to inspect these logs for any obvious issues or startup errors with your app to identify a fix.

Checking the app process

Under the hood, Push uses systemd to manage your app's lifecycle. To check the status of your app process, run:

systemctl status app

This will print the current systemd status for your app along with the most recent 5-10 lines of system logs for your app. If the status for the service does not appear to be active, you can restart the process with the following command:

systemctl restart app

This will restart the systemd service that controls your Joystick app process on the instance.