Introduction
In certain cases, it may be necessary to access the Rails console, a form of command-line interface, to debug Terraform Enterprise issues or, even more rarely, make changes to data.
Use Case
It may be essential to access the Rails console in the following situations.
-
If using SAML and access to the local non-SSO Site Admin user is lost.
-
If a user has lost access to the
owners
team of a given organization.
NOTE: For Terraform Enterprise v202205-1 or later the container names have changed as the "p" has been dropped, and the underscore has been changed to a dash, such as for example in comparison pre v202205-1 container names would suggest ptfe_atlas where v202205-1 and above would reflect tfe-atlas.
Procedure
Please be aware of the following caveats before continuing.
-
Do not access the application console unless directed by HashiCorp Support.
-
Only run the commands provided.
-
If any command returns unexpected output, do not proceed further.
Terraform Enterprise
To access the Rails console in Terraform Enterprise, perform the following.
-
SSH into the Terraform Enterprise instance.
-
Execute the following command to access the Rails console.
sudo docker exec -it ptfe_atlas /usr/bin/init.sh /app/scripts/wait-for-token -- bash -i -c 'cd /app && ./bin/rails c'
For TFE v202205-1 and above:
sudo docker exec -it tfe-atlas /usr/bin/init.sh /app/scripts/wait-for-token -- bash -i -c 'cd /app && ./bin/rails c'