Skip to content

fix(jobs): hide internal build artifact errors from deployment logs - #13856

Merged
ChiragAgg5k merged 7 commits into
mainfrom
fix/jobs-internal-artifact-errors
Sep 23, 2026
Merged

ChiragAgg5k merged 7 commits into
mainfrom
fix/jobs-internal-artifact-errors

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

When a jobs-service build fails on a platform-side artifact error, the raw orchestrator message was appended to the deployment's build logs. For example, a build cache download that timed out showed users:

Failed to download file: Get "https://fra1.digitaloceanspaces.com/<bucket>/storage/builds/app-<project>/cache/<key>.sqfs": dial tcp 10.102.15.254:443: i/o timeout

That exposes bucket URLs and internal addresses, and there is nothing the user can do about it.

Workers/Jobs.php::onArtifact() now sends failed artifacts through a new artifactFailure() method:

  • User-fixable codes (archive_empty, archive_unknown_format, archive_corrupt, archive_path_invalid, archive_layout_mismatch, clone_failed) map to a fixed, safe message in USER_ARTIFACT_ERRORS. The raw orchestrator message is never shown, because it can contain internal paths.
  • Every other code, an unknown code, or a failure with no error: the build log shows Internal server error. Please try again.
  • Sentry reporting: after the callback is fully applied (finalize, realtime, webhooks) and the per-deployment lock is released, action() throws a Utopia\Queue\PermanentFailure (code 500) carrying the raw error. The worker's error() hook finishes the span with it, so it is reported to Sentry. PermanentFailure sends the message to the dead-letter list instead of retrying it, and a redelivery would be a no-op anyway because events are deduplicated by ID. The handler itself only calls Span::add(). Cache upload and manifest failures don't fail the build, so they aren't reported.
  • A failed output upload, which used to show Build output upload failed: <raw error>, goes through the same path.
  • A failed cache upload still does not fail the build.

Test Plan

  • composer lint and PHPStan pass on the changed file.
  • No automated test was added. I have not run this end to end.

Orchestrator artifact failures such as a timed-out build cache download carried raw storage URLs and internal addresses straight into the user's build logs. Platform-side failures now show a generic internal error and are reported to Sentry as a 500 on the worker span.
@greptile-apps

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the current implementation preserves user-facing redaction while retaining internal failure reporting.

Summary

This PR prevents internal build-artifact errors from leaking through deployment logs while preserving actionable, fixed messages for user-correctable failures.

  • Maps known archive and clone failures to safe user-facing messages.
  • Uses a generic message for unknown, missing, or platform-side errors.
  • Reports unexpected failures after callback side effects complete and the deployment lock is released.
  • Preserves cache and manifest artifacts as non-fatal cases.

Reviews (5) · Last reviewed commit: "style(jobs): drop redundant comments"

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/jobs-internal-artifact-errors (after).

Metric Before After Change
🚀 Requests/sec 199.41 203.2 ⚪ +1.9%
⏱️ Latency P50 86.36 ms 86.36 ms ⚪ 0%
⏱️ Latency P95 204.37 ms 195.59 ms ⚪ -4.3%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 86.36 195.59 12,540 203.2 -8.78
Account 157.36 298.33 660 11.23 -42.04
TablesDB 83.38 153.08 6,820 112.18 -21.7
Storage 81 176.37 3,300 56.31 +13.32
Functions 121.38 230.21 1,760 30.75 -2.01

Top API waits (after)

API request Max wait (ms)
account.name.update 407.11
tablesdb.rows.delete 400.27
functions.variables.update 393.49
account.prefs.update 392.9
functions.create 387.77

@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@greptile review

@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@greptile review

@ChiragAgg5k
ChiragAgg5k merged commit e3b4308 into main Sep 23, 2026
95 of 96 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/jobs-internal-artifact-errors branch September 23, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants