claude-code - 💡(How to fix) Fix [BUG] .devcontainer/init-firewall.sh: statsig.anthropic.com fails DNS resolution, aborts container startup [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55623Fetched 2026-05-03 04:48:39
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

.devcontainer/init-firewall.sh includes statsig.anthropic.com in its allowlist (line 71 on main), but that hostname has no public DNS records. The script treats any unresolvable domain as fatal (exit 1), so the devcontainer's postStartCommand fails and VS Code reports container setup as failed.

Error Message

  • if [ -z "$ips" ]; then
  •    echo \"ERROR: Failed to resolve \$domain\"
  •    exit 1
  • fi
  • if [ -z "$ips" ]; then
  •    echo \"WARN: Failed to resolve \$domain — skipping\"
  •    continue
  • fi

Root Cause

.devcontainer/init-firewall.sh includes statsig.anthropic.com in its allowlist (line 71 on main), but that hostname has no public DNS records. The script treats any unresolvable domain as fatal (exit 1), so the devcontainer's postStartCommand fails and VS Code reports container setup as failed.

Code Example

$ dig +short statsig.anthropic.com
   (no output)

---

[ERROR] Failed to resolve statsig.anthropic.com
Stop (1035 ms): Run in container: /bin/sh -c sudo /usr/local/bin/init-docker-socket.sh && sudo /usr/local/bin/init-firewall.sh
postStartCommand from devcontainer.json failed with exit code 1. Skipping any further user-provided commands.

---

$ dig +short statsig.anthropic.com   # <empty>
$ dig +short statsig.com              # resolves
$ dig +short api.statsig.com          # resolves

---

-    if [ -z \"\$ips\" ]; then
-        echo \"ERROR: Failed to resolve \$domain\"
-        exit 1
-    fi
+    if [ -z \"\$ips\" ]; then
+        echo \"WARN: Failed to resolve \$domain — skipping\"
+        continue
+    fi
RAW_BUFFERClick to expand / collapse

Summary

.devcontainer/init-firewall.sh includes statsig.anthropic.com in its allowlist (line 71 on main), but that hostname has no public DNS records. The script treats any unresolvable domain as fatal (exit 1), so the devcontainer's postStartCommand fails and VS Code reports container setup as failed.

Reproduction

  1. Open the upstream .devcontainer (or any fork that uses the unmodified init-firewall.sh) in VS Code Dev Containers.
  2. Container builds, then postStartCommand runs init-firewall.sh.
  3. The resolution loop hits statsig.anthropic.com:
    $ dig +short statsig.anthropic.com
    (no output)
  4. Script logs ERROR: Failed to resolve statsig.anthropic.com and exits 1.
  5. VS Code reports: postStartCommand from devcontainer.json failed with exit code 1.

Relevant log excerpt:

[ERROR] Failed to resolve statsig.anthropic.com
Stop (1035 ms): Run in container: /bin/sh -c sudo /usr/local/bin/init-docker-socket.sh && sudo /usr/local/bin/init-firewall.sh
postStartCommand from devcontainer.json failed with exit code 1. Skipping any further user-provided commands.

Verification

$ dig +short statsig.anthropic.com   # <empty>
$ dig +short statsig.com              # resolves
$ dig +short api.statsig.com          # resolves

statsig.anthropic.com does not appear to be a public hostname (no A, no CNAME). It may be an internal-only DNS name that leaked into the public template, or a stale entry.

Suggested fix

Either:

  • Remove statsig.anthropic.com from the domain list (statsig.com is already present at line 72 of the same file), or
  • Make the resolution loop tolerant: log a warning and continue instead of exit 1, so a single unresolvable entry doesn't kill container startup.

A diff for the tolerant version:

-    if [ -z \"\$ips\" ]; then
-        echo \"ERROR: Failed to resolve \$domain\"
-        exit 1
-    fi
+    if [ -z \"\$ips\" ]; then
+        echo \"WARN: Failed to resolve \$domain — skipping\"
+        continue
+    fi

Environment

  • claude-code: 2.1.126
  • VS Code Dev Containers extension: 0.457.0
  • Host: macOS 26.3.1
  • File: .devcontainer/init-firewall.sh @ main, lines 71 (allowlist entry) and 108–113 (fatal-exit logic)

extent analysis

TL;DR

Remove statsig.anthropic.com from the domain list in .devcontainer/init-firewall.sh or make the resolution loop tolerant to unresolvable entries.

Guidance

  • Verify that statsig.anthropic.com is not a required hostname by checking the project's documentation or code.
  • Remove the statsig.anthropic.com entry from the allowlist in .devcontainer/init-firewall.sh if it's not necessary.
  • Alternatively, apply the suggested diff to make the resolution loop log a warning and continue instead of exiting when encountering an unresolvable domain.
  • Test the changes by rebuilding the container and checking the logs for any errors.

Example

The provided diff can be used to make the resolution loop tolerant:

-    if [ -z \"\$ips\" ]; then
-        echo \"ERROR: Failed to resolve \$domain\"
-        exit 1
-    fi
+    if [ -z \"\$ips\" ]; then
+        echo \"WARN: Failed to resolve \$domain — skipping\"
+        continue
+    fi

Notes

The statsig.anthropic.com hostname may be an internal-only DNS name that was accidentally included in the public template. Removing or tolerating this entry should resolve the issue.

Recommendation

Apply the workaround by making the resolution loop tolerant to unresolvable entries, as this will allow the container to start even if some domains cannot be resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] .devcontainer/init-firewall.sh: statsig.anthropic.com fails DNS resolution, aborts container startup [1 comments, 2 participants]