Skip to content

Debugging FAQ

E. Lynette Rayle edited this page May 12, 2022 · 5 revisions

Connecting with ssh to the AWS machine

Find ip for AWS machine

  • AWS -> Services -> Elastic Container Service
  • (left menu) Clusters (under Amazon ECS) - make sure on list view
  • Filter: search for qa or possibly lookup
  • Click list item: the cluster name
  • Click tab: ECS Instances tab (there will be two instances listed in the table)
  • Click on instance: the one that has Running tasks == 1
  • use Private IP for ssh

ssh into the machine

ssh -i _PATH_TO_SSH_PEM_ ec2-user@_PRIVATE_IP_

Connect to database

  • ssh to machine
  • list all docker containers
docker ps
  • copy container id for mariadb:latest
  • connect to the container
docker exec -it _CONTAINER_ID_ /bin/bash
  • startup MySQL CLI
mysql -h localhost -u root -p
Enter password: <get root password from _ENVIRONMENT_.env>
  • select the app database
show databases;
use _DB_NAME_ENV_;
show tables;

Connect to app

  • ssh to machine
  • list all docker containers
docker ps
  • copy container id for app:latest
  • connect to the container
docker exec -it _CONTAINER_ID_ /bin/bash
  • list files - should be in the app root directory
ls

Interactive debugging

You can run the rails console by executing:

bundle exec rails c

Restart application

TBD