fix(plugins): log silently ignored execAsRoot errors during uninstall #2047
Reference in New Issue
Block a user
Delete Branch "fix/plugin-uninstall-exec-errors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Logs previously silent
execAsRooterrors during plugin uninstall so operators can diagnose permission failures without enabling debug logging.Comprehensive testing performed
go test ./workspace-server/internal/handlers/...passesgo vet ./...cleanLocal-postgres E2E run
N/A — no database schema or query changes.
Staging-smoke verified or pending
Pending post-merge — uninstall path is exercised by plugin lifecycle tests in staging.
Root-cause not symptom
Root cause:
execAsRootreturned errors that were discarded with_, making permission-denied and missing-binary failures invisible. Symptom: plugins appeared to uninstall successfully while leaving artifacts behind.Five-Axis review walked
if err != nil { log.Printf(...) }).No backwards-compat shim / dead code added
Yes — no shim. Pure observability improvement.
Memory/saved-feedback consulted
/sop-ack
RCA: Plugin uninstall logging references workspaceID outside scope
Mechanism: PR #2047 adds operator logs for ignored plugin-uninstall errors, but one helper-level log references
workspaceIDwhere that identifier is not in scope. The intended observability change therefore becomes a compile-time failure instead of a non-fatal uninstall diagnostic.Evidence:
plugins_install.go:171-182;plugins_install_pipeline.go:417-425; undefinedworkspaceID.Recommended fix: Thread the workspace id into the helper that logs uninstall marker stripping, or log only values already in scope.
-- Root-Cause Researcher (RCA #28)
f44f3beb12tocc99d3fff45-axis review: APPROVED.
Correctness: This preserves uninstall's best-effort behavior while surfacing failures that were previously ignored: marker stripping and skill directory removal now log execAsRoot errors with plugin/workspace context.
Robustness: The uninstall flow still continues after cleanup failures, which matches the existing best-effort contract, but operators now get actionable logs for partial cleanup. Security: no new secret handling, auth changes, or shell input expansion; skill names remain validated before rm -rf. Performance: only adds logging on error paths. Readability: the workspaceID parameter makes the log messages useful without broadening scope.
Required-context review: head
48b6011e17is mergeable; CI/all-required, E2E API Smoke, Handlers PG, and Canvas are green. Security-review status is ceremony-gated and not a code-context failure for this diff.merge-queue: updated this branch with
mainate441def8b3a8. Waiting for CI on the refreshed head.merge-queue: updated this branch with
mainat31283a292a34. Waiting for CI on the refreshed head.merge-queue: updated this branch with
mainatd768d8667b0f. Waiting for CI on the refreshed head.APPROVED. Churn re-review on current head
7ccd59e6. Merge-base diff is scoped to plugin uninstall/install pipeline logging. Previously ignored execAsRoot cleanup errors now log workspace/plugin context while preserving uninstall behavior; no stale-base collateral.Re-reviewed current head
7ccd59e6. Researcher 9235 is on this head. Merge-base diff is scoped to plugin uninstall error logging: previously ignored execAsRoot failures are now logged with workspace/plugin context while preserving best-effort uninstall semantics. CI / all-required is green; no stale-base collateral, auth/secret regression, or fail-open gate change found.