ember-troubleshoot
GitHub用于诊断和修复 Ember CLI(Caddy/FrankenPHP 终端仪表板)的常见问题,如连接失败、指标缺失或数据异常。通过执行状态检查和配置调整解决故障。
Trigger Scenarios
Install
npx skills add alexandre-daubois/ember --skill ember-troubleshoot -g -y
SKILL.md
Frontmatter
{
"name": "ember-troubleshoot",
"description": "Diagnose and fix common Ember CLI issues. Use this skill whenever a user reports problems with ember: connection errors, missing metrics, empty dashboards, FrankenPHP tab not showing, CPU\/RSS stuck at zero, missing latency percentiles, 401 errors on the metrics endpoint, high memory usage, or any 'ember is not working' situation. Also trigger when users see 'UNREACHABLE', 'connection refused', or describe metrics that are all zeros, even if they don't explicitly say 'troubleshoot'."
}
Ember Troubleshooting
This skill helps diagnose and resolve common issues with Ember, the real-time Caddy/FrankenPHP terminal dashboard. Work through the relevant section based on the user's symptoms.
Diagnostic approach
When a user reports a problem, start by identifying which symptom matches. If unclear, ask them to run:
ember status
This gives a one-line summary that reveals whether Caddy is reachable, metrics are flowing, and FrankenPHP is detected. If they get Caddy UNREACHABLE, start with the connection section. If they get OK but the dashboard looks wrong, move to the metrics sections.
Ember cannot connect to Caddy
Symptoms: Caddy UNREACHABLE | http://localhost:2019 or connection refused
Diagnostic steps:
-
Check if the Caddy admin API responds:
curl -s http://localhost:2019/config/ | head -c 100 -
If no response, the issue is one of:
- Admin API disabled, add
admin localhost:2019to the Caddyfile global block:{ admin localhost:2019 metrics } - Different address, Caddy might be on a non-default port. Check with
caddy environor inspect the Caddyfile, then use--addr:ember --addr http://your-host:2019 - Docker networking, Ember and Caddy are on different networks. Fix with either:
# Option A: share network namespace network_mode: "service:caddy" # Option B: use service name # ember --addr http://caddy:2019 - Firewall, port 2019 is blocked. Check with
nc -z localhost 2019.
- Admin API disabled, add
No HTTP traffic metrics (RPS, latency, status codes all zero)
Symptoms: The Caddy tab shows hosts but all numbers are zero.
Diagnostic steps:
-
Check if the metrics directive is enabled:
curl -s http://localhost:2019/metrics | grep caddy_http_requests_total -
If no output, the
metricsdirective is missing. Two ways to fix it:- Quick fix (no restart): run
ember init, it enables metrics via the admin API automatically - Permanent fix: add
metricsto the Caddyfile global block:{ admin localhost:2019 metrics }
- Quick fix (no restart): run
-
If the grep returns results but numbers are still zero in Ember: no HTTP requests have been made yet. Metrics appear only after the first request hits Caddy. Try
curl http://localhostto generate some traffic.
All traffic under a single * host
Symptoms: Instead of per-host rows, a single * row aggregates everything.
Cause: Caddy only adds the host label to metrics when routes use host matchers.
Fix: Replace port-only site blocks with hostname-based blocks:
# Bad: no host label in metrics
:80 {
respond "Hello"
}
# Good: per-host metrics
example.com {
respond "Hello"
}
After changing the Caddyfile, reload Caddy (caddy reload). Historical metrics under * will age out as new per-host metrics come in.
FrankenPHP tab does not appear
Symptoms: Ember starts in Caddy-only mode even though FrankenPHP is running.
Diagnostic steps:
-
Check the FrankenPHP admin endpoint:
curl -s http://localhost:2019/frankenphp/threads | head -c 100 -
If no response:
- Old version: the
/frankenphp/threadsendpoint was added in FrankenPHP 1.4. Upgrade if needed. - Not ready yet: Ember re-checks every 30 seconds. Wait a moment, or restart ember.
- Admin API disabled in the FrankenPHP configuration.
- Old version: the
-
If the endpoint returns JSON with thread states, FrankenPHP is detectable. Ember should show the tab within 30 seconds.
Thread metrics are empty (Method, URI, Mem, Reqs columns)
Symptoms: FrankenPHP tab shows threads but the Method, URI, Time, Mem, and Reqs columns are blank.
Cause: These per-thread metrics require FrankenPHP 1.12.2 or later. Older versions only expose thread index and state.
Fix: Upgrade FrankenPHP to 1.12.2+.
CPU and RSS stuck at 0%
Symptoms: Process metrics (CPU, RSS) never change from zero.
Diagnostic steps:
-
In containers, process scanning is restricted. Ember falls back to Prometheus
process_*metrics. Check they exist:curl -s http://localhost:2019/metrics | grep process_cpu_seconds_total curl -s http://localhost:2019/metrics | grep process_resident_memory_bytesThese are part of Go's default Prometheus collector and should be present unless explicitly disabled.
-
Manual PID, if process scanning fails, pass the PID directly:
ember --frankenphp-pid $(pgrep frankenphp)
Latency percentiles missing (P50/P90/P95/P99 show "no data")
Symptoms: The host detail panel shows "no data" for percentiles.
Causes and fixes:
-
Missing metrics directive: percentiles come from
caddy_http_request_duration_secondshistogram buckets, which require themetricsdirective. Runember initto enable it. -
First poll: percentiles need two consecutive polls to compute a delta. Wait a couple of seconds.
-
Single snapshot mode:
ember --json --oncealways shows empty percentiles because there's no previous poll. Useember --json(streaming) for percentiles.
Metrics endpoint returns 401 Unauthorized
Symptoms: Prometheus scrapes fail with 401 after enabling --metrics-auth.
Fix: The Prometheus scrape config needs matching credentials:
scrape_configs:
- job_name: ember
basic_auth:
username: admin
password: secret
static_configs:
- targets: ["localhost:9191"]
Make sure the username:password matches what was passed to --metrics-auth.
High memory usage
Symptoms: Ember's RSS is higher than expected (~15 MB is normal with 100 threads and 10 hosts).
Diagnostic steps:
- Check the number of unique hosts: each host maintains its own metrics history.
- In graph mode, Ember stores 300 samples per metric. This is normal.
- Measure a snapshot size:
If very large, there may be an unusually high number of hosts or workers.ember --json --once | wc -c
General diagnostic checklist
When none of the above fits, walk through this checklist:
ember version --check: Is Ember up to date?ember status: Can Ember reach Caddy at all?ember init: Does the validation pass all checks?curl http://localhost:2019/config/: Is the admin API responding?curl http://localhost:2019/metrics | head -20: Are metrics being generated?- Check the Caddyfile for
adminandmetricsdirectives in the global block.
Version History
- 2e1a953 Current 2026-07-25 08:04


