Introduction
Problem
You deploy Terraform Enterprise FDO on Kubernetes/docker and the container starts and crashes without any error.
The logs for the Terraform Enterprise container show the following as the last lines.
[2024/06/06 06:44:52] [ info] [fluent bit] version=2.2.2, commit=, pid=62
[2024/06/06 06:44:52] [ info] [storage] ver=1.5.1, type=memory+filesystem, sync=normal, checksum=off, max_chunks_up=128
[2024/06/06 06:44:52] [ info] [storage] backlog input plugin: storage_backlog.1
[2024/06/06 06:44:52] [ info] [cmetrics] version=0.6.6
[2024/06/06 06:44:52] [ info] [ctraces ] version=0.4.0
[2024/06/06 06:44:52] [ info] [input:tail:tail.0] initializing
[2024/06/06 06:44:52] [ info] [input:tail:tail.0] storage_strategy='memory' (memory only)
[2024/06/06 06:44:52] [ info] [input:storage_backlog:storage_backlog.1] initializing
[2024/06/06 06:44:52] [ info] [input:storage_backlog:storage_backlog.1] storage_strategy='memory' (memory only)
[2024/06/06 06:44:52] [ info] [input:storage_backlog:storage_backlog.1] queue memory limit: 4.8M
[2024/06/06 06:44:52] [ info] [input:emitter:emitter_for_rewrite_tag.0] initializing
[2024/06/06 06:44:52] [ info] [input:emitter:emitter_for_rewrite_tag.0] storage_strategy='memory' (memory only)
[2024/06/06 06:44:52] [ info] [output:stdout:stdout.0] worker #0 started
[2024/06/06 06:44:52] [ info] [http_server] listen iface=0.0.0.0 tcp_port=2020
[2024/06/06 06:44:52] [ info] [sp] stream processor started
[2024/06/06 06:44:52] [ info] [input:tail:tail.0] inotify_fs_add(): inode=4129131 watch_fd=1 name=/var/log/terraform-enterprise/terraform-enterprise.log
[2024/06/06 06:44:52] [ info] [input:tail:tail.0] inotify_fs_add(): inode=4129128 watch_fd=2 name=/var/log/terraform-enterprise/supervisord.log
{"log":"2024-06-06 06:44:52,829 INFO success: terraform-enterprise entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)","component":"supervisord"}
{"log":"2024-06-06 06:44:52,892 INFO stopped: fluent-bit (exit status 0)","component":"supervisord"}
{"log":"2024-06-06 06:44:52,895 INFO spawned: 'fluent-bit' with pid 62","component":"supervisord"}
2024-06-06 06:44:54,868 INFO success: fluent-bit entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
{"log":"2024-06-06 06:44:54,868 INFO success: fluent-bit entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)","component":"supervisord"}
Prerequisites
- Terraform Enterprise FDO
Cause
The issue could be that the configured TFE_REDIS_HOST or TFE_DATABASE_HOST have an invalid DNS name. When the DNS name cannot be translated to an IP address the container exits without any additional messages.
Solutions:
-
Verify if the DNS names used are valid
Wrong:
nslookup this_does_not_exist.hashicorp.com
Server: 192.168.0.1
Address: 192.168.0.1#53
** server can't find this_does_not_exist.hashicorp.com: NXDOMAIN
Correct:
nslookup hashicorp.com
Server: 192.168.0.1
Address: 192.168.0.1#53
Non-authoritative answer:
Name: hashicorp.com
Address: 76.76.21.21
Outcome
After specifying valid DNS entries the container should continue with startup checks
{"log":"2024-06-12T06:18:48.718Z [INFO] terraform-enterprise: build info: release=v202405-1 sha=86aa5cb","component":"terraform-enterprise"}
{"log":"2024-06-12T06:18:48.718Z [INFO] terraform-enterprise: version: current=v202405-1","component":"terraform-enterprise"}
{"log":"2024-06-12T06:18:48.767Z [INFO] terraform-enterprise: check passed: name=config duration=\"83.938µs\"","component":"terraform-enterprise"}
{"log":"2024-06-12T06:18:48.767Z [INFO] terraform-enterprise: check passed: name=database duration=37.645442ms","component":"terraform-enterprise"}
{"log":"2024-06-12T06:18:48.767Z [INFO] terraform-enterprise: check passed: name=disk duration=\"40.342µs\"","component":"terraform-enterprise"}
{"log":"2024-06-12T06:18:48.767Z [INFO] terraform-enterprise: check passed: name=license duration=\"837.128µs\"","component":"terraform-enterprise"}
{"log":"2024-06-12T06:18:48.767Z [INFO] terraform-enterprise: check passed: name=redis duration=4.415006ms","component":"terraform-enterprise"}
{"log":"2024-06-12T06:18:48.767Z [INFO] terraform-enterprise: check passed: name=tls duration=\"143.678µs\"","component":"terraform-enterprise"}
{"log":"2024-06-12T06:18:48.767Z [INFO] terraform-enterprise: check passed: name=upgrade duration=48.915626ms","component":"terraform-enterprise"}
Additional Information
-
Parameters used for Terraform Enterprise can be found here