diff --git a/cleanup.go b/cleanup.go index 6fa072e..19cff8f 100644 --- a/cleanup.go +++ b/cleanup.go @@ -113,7 +113,7 @@ func (c *Cleaner) findStuckInstallations(ctx context.Context) ([]StuckRecord, er cutoffStr := cutoff.Format("2006-01-02 15:04:05") // Build filter: status='installing' AND created < cutoff - filter := url.QueryEscape(fmt.Sprintf("status='installing' && created<'%s'", cutoffStr)) + filter := url.QueryEscape(fmt.Sprintf("(status='installing' || status='configuring') && created<'%s'", cutoffStr)) var allRecords []StuckRecord page := 1 diff --git a/dashboard.go b/dashboard.go index a0c4bad..70ddebc 100644 --- a/dashboard.go +++ b/dashboard.go @@ -456,7 +456,7 @@ func aggregateRecords(records []TelemetryRecord, knownScripts map[string]ScriptI st.Failed++ case "aborted": st.Aborted++ - case "installing": + case "installing", "configuring": st.Installing++ } } @@ -622,7 +622,7 @@ func (s *ScriptStatsStore) IncrementalUpdate(ctx context.Context, repoSource str st.Failed++ case "aborted": st.Aborted++ - case "installing": + case "installing", "configuring": st.Installing++ } added++ @@ -867,8 +867,8 @@ func (p *PBClient) FetchScriptAnalysisData(ctx context.Context, days int, repoSo strings.Contains(strings.ToLower(r.Error), "aborted by user")) { r.Status = "aborted" } - // Reclassify failed+exit_code=0 - if r.Status == "failed" && r.ExitCode == 0 && (r.Error == "" || strings.ToLower(r.Error) == "success") { + // Reclassify failed+exit_code=0 — exit_code=0 is NEVER an error + if r.Status == "failed" && r.ExitCode == 0 { r.Status = "success" } @@ -886,7 +886,7 @@ func (p *PBClient) FetchScriptAnalysisData(ctx context.Context, days int, repoSo a.failed++ case "aborted": a.aborted++ - case "installing": + case "installing", "configuring": a.installing++ } @@ -1041,12 +1041,12 @@ func (p *PBClient) FetchErrorAnalysisData(ctx context.Context, days int, repoSou r.Status = "aborted" } - // Reclassify: status="failed" with exit_code=0 and no error text is actually success - if r.Status == "failed" && r.ExitCode == 0 && (r.Error == "" || strings.ToLower(r.Error) == "success") { + // Reclassify: exit_code=0 is NEVER an error — always reclassify as success + if r.Status == "failed" && r.ExitCode == 0 { r.Status = "success" } - if r.Status == "installing" { + if r.Status == "installing" || r.Status == "configuring" { stuckCount++ continue } @@ -1100,9 +1100,6 @@ func (p *PBClient) FetchErrorAnalysisData(ctx context.Context, days int, repoSou } if r.Error != "" && (appStats[key].topError == "" || len(r.Error) > len(appStats[key].topError)) { appStats[key].topError = r.Error - if len(appStats[key].topError) > 150 { - appStats[key].topError = appStats[key].topError[:150] + "..." - } } if cat != "uncategorized" && appStats[key].topCategory == "" { appStats[key].topCategory = cat @@ -1214,6 +1211,9 @@ func (p *PBClient) FetchErrorAnalysisData(ctx context.Context, days int, repoSou case 124: desc = "Command timed out (timeout command)" cat = "timeout" + case 125: + desc = "Docker daemon error (container failed to run)" + cat = "config" case 126: desc = "Command cannot execute (permission problem)" cat = "permission" @@ -1222,10 +1222,16 @@ func (p *PBClient) FetchErrorAnalysisData(ctx context.Context, days int, repoSou cat = "command_not_found" case 128: desc = "Invalid argument to exit" - cat = "unknown" + cat = "signal" + case 129: + desc = "Killed by SIGHUP (terminal closed)" + cat = "signal" case 130: desc = "Script terminated by Ctrl+C (SIGINT)" cat = "user_aborted" + case 131: + desc = "Killed by SIGQUIT (core dump)" + cat = "signal" case 134: desc = "Process aborted (SIGABRT)" cat = "signal" @@ -1402,8 +1408,8 @@ func (p *PBClient) FetchErrorAnalysisData(ctx context.Context, days int, repoSou desc = "npm/pnpm/yarn: Unknown fatal error" cat = "unknown" case 255: - desc = "Script error (set -e / errexit triggered or SSH error)" - cat = "unknown" + desc = "DPKG: Fatal internal error / set -e triggered" + cat = "apt" default: if code > 128 && code < 192 { sigNum := code - 128 @@ -1684,7 +1690,7 @@ func (p *PBClient) FetchDashboardData(ctx context.Context, days int, repoSource } case "aborted": data.AbortedCount++ - case "installing": + case "installing", "configuring": data.InstallingCount++ } @@ -2846,6 +2852,12 @@ func DashboardHTML() string { border-color: rgba(234, 179, 8, 0.3); } + .status-badge.configuring { + background: rgba(59, 130, 246, 0.15); + color: var(--accent-blue); + border-color: rgba(59, 130, 246, 0.3); + } + .status-badge.aborted { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); @@ -3973,6 +3985,7 @@ func DashboardHTML() string { +