Introduction
In certain cases, you may need to access the Rails console, a command-line interface for the application, to debug Terraform Enterprise issues or make changes to data.
Use Cases
Accessing the Rails console may be necessary in the following situations:
- You use SAML and have lost access to the local non-SSO Site Admin user.
- A user has lost access to the
ownersteam for an organization.
Prerequisites
Before you begin, review the following caveats:
- Access the application console only when directed by HashiCorp Support.
- Run only the commands provided by HashiCorp Support.
- If a command returns unexpected output, stop and do not proceed.
Procedure
Follow the instructions that match your Terraform Enterprise deployment method.
For Replicated Deployments
- Connect to the Terraform Enterprise instance using SSH.
-
Execute the command that corresponds to your Terraform Enterprise version to access the Rails console.
Note: In Terraform Enterprise v202205-1 and later, the container name
ptfe_atlaswas changed totfe-atlas.-
For versions before v202205-1:
$ sudo docker exec -it ptfe_atlas /usr/bin/init.sh /app/scripts/wait-for-token -- bash -i -c 'cd /app && ./bin/rails c'
-
For versions v202205-1 and later:
$ sudo docker exec -it tfe-atlas /usr/bin/init.sh /app/scripts/wait-for-token -- bash -i -c 'cd /app && ./bin/rails c'
-
For Consolidated Services on Docker
This procedure applies to Terraform Enterprise v202309-1 and later running in consolidated_services mode.
- Connect to the Terraform Enterprise instance using SSH.
-
Execute the following command to access the Rails console.
$ sudo docker exec -it terraform-enterprise tfectl support console
For Kubernetes (Flexible Deployment Option)
- Follow the instructions for connecting to the pod.
-
Execute the following command in the pod to access the Rails console.
$ tfectl support console
For Podman (Flexible Deployment Option)
- Connect to the Terraform Enterprise instance using SSH.
-
Execute the following command to access the Rails console.
$ podman exec -it terraform-enterprise-terraform-enterprise bash -c ". atlas-env && wait-for-token -- bash -c 'cd /app && ./bin/rails c'"