# HG changeset patch
# User Michael Kozono <mkozono@gitlab.com>
# Date 1730491810 0
#      Fri Nov 01 20:10:10 2024 +0000
# Node ID fafcf5e8caa3e767ace63a4c785fe4c48633c893
# Parent  bdf42e64f7c1c2fd25706f18a1cef7f07a8ad9bf
Document troubleshooting env var not set

diff --git a/doc/settings/environment-variables.md b/doc/settings/environment-variables.md
--- a/doc/settings/environment-variables.md
+++ b/doc/settings/environment-variables.md
@@ -19,8 +19,8 @@
 
 ```ruby
 gitlab_rails['env'] = {
-    "http_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
-    "https_proxy" => "http://USERNAME:PASSWORD@example.com:8080"
+    "http_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080",
+    "https_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080"
 #    "no_proxy" => ".yourdomain.com"  # Wildcard syntax if you need your internal domain to bypass proxy
 }
 ```
@@ -31,24 +31,24 @@
 ```ruby
 # Needed for proxying Git clones
 gitaly['env'] = {
-    "http_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
-    "https_proxy" => "http://USERNAME:PASSWORD@example.com:8080"
+    "http_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080",
+    "https_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080"
 }
 
 gitlab_workhorse['env'] = {
-    "http_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
-    "https_proxy" => "http://USERNAME:PASSWORD@example.com:8080"
+    "http_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080",
+    "https_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080"
 }
 
 gitlab_pages['env'] = {
-    "http_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
-    "https_proxy" => "http://USERNAME:PASSWORD@example.com:8080"
+    "http_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080",
+    "https_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080"
 }
 
 # If you use the docker registry
 registry['env'] = {
-    "http_proxy" => "http://USERNAME:PASSWORD@example.com:8080",
-    "https_proxy" => "http://USERNAME:PASSWORD@example.com:8080"
+    "http_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080",
+    "https_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080"
 }
 ```
 
@@ -59,7 +59,7 @@
 Proxy URL values should generally be `http://` only, unless
 your proxy has its own SSL certificate and SSL enabled. This means, even for
 the `https_proxy` value, you should usually specify a value as
-`http://USERNAME:PASSWORD@example.com:8080`.
+`http://<USERNAME>:<PASSWORD>@example.com:8080`.
 
 NOTE:
 DNS rebind protection is disabled when either the HTTP_PROXY or the HTTPS_PROXY environment variable is set,
@@ -75,3 +75,19 @@
 ```shell
 sudo gitlab-ctl reconfigure
 ```
+
+## Troubleshooting
+
+### An environment variable is not being set
+
+Check that you don't have multiple entries for the same `['env']`. The last one will override
+previous entries. In this example, `NTP_HOST` will not be set:
+
+```ruby
+gitlab_rails['env'] = { 'NTP_HOST' => "<DOMAIN_OF_NTP_SERVICE>" }
+
+gitlab_rails['env'] = {
+    "http_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080",
+    "https_proxy" => "http://<USERNAME>:<PASSWORD>@example.com:8080"
+}
+```