fix(cli): disable OTel in depot child to prevent OTEL_EXPORTER_OTLP_ENDPOINT build failures - #4370
fix(cli): disable OTel in depot child to prevent OTEL_EXPORTER_OTLP_ENDPOINT build failures#4370eeshsaxena wants to merge 1 commit into
Conversation
If OTEL_EXPORTER_OTLP_ENDPOINT is set in the shell (e.g. via a .env file loaded by dotenv), the depot CLI inherits it because execa merges the env object onto process.env rather than replacing it. The depot CLI then tries to initialise its own OTel exporter using that endpoint: - a valid URL causes a Schema URL conflict and the build exits with 'cannot merge resource due to conflicting Schema URL' - an invalid value (e.g. an encrypted dotenvx blob) causes 'failed to build resolver: passthrough: received empty target in Build()' Both surface as 'Error building image', which looks like a depot outage rather than a local env variable problem, and --local-build is unaffected. Set OTEL_SDK_DISABLED=1 and clear OTEL_EXPORTER_OTLP_ENDPOINT in the env block passed to the depot child so ambient OTEL config can't reach it. Fixes #4321
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe image build flow now passes ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @eeshsaxena, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
| OTEL_SDK_DISABLED: "1", | ||
| OTEL_EXPORTER_OTLP_ENDPOINT: "", |
There was a problem hiding this comment.
🟡 Change to a published package is missing its release-notes entry
This change updates the published CLI package (packages/cli-v3/src/deploy/buildImage.ts:259-265) but no changeset was added to the pull request, so the fix will not be versioned or appear in user-visible release notes.
Impact: The bug fix ships without a version bump or changelog entry, so users won't see it in release notes and the package version won't be updated.
Missing changeset for a public package change
AGENTS.md states: "When modifying any public package (packages/* or integrations/*), add a changeset" via pnpm run changeset:add, and CONTRIBUTING.md states that PRs touching /packages "will need to add a changeset to your Pull Requests before they can be merged." packages/cli-v3 is the published trigger.dev package. The PR's only diff is in packages/cli-v3/src/deploy/buildImage.ts and no file was added under .changeset/.
Prompt for agents
This PR modifies the published package packages/cli-v3 (trigger.dev on npm) but does not include a changeset. Per AGENTS.md and CONTRIBUTING.md, any change to a public package under packages/* requires a changeset. Run pnpm run changeset:add and create a patch changeset describing the fix for users (e.g. that deploying no longer fails when OTEL_EXPORTER_OTLP_ENDPOINT is present in the shell environment). Write the description for users, not maintainers, and avoid naming internal tools/infra.
Was this helpful? React with 👍 or 👎 to provide feedback.
Fixes #4321.
OTEL_EXPORTER_OTLP_ENDPOINTis a standard env var that lots of projects set. If it's in the shell when you runtrigger deploy, the build fails before it starts - either withcannot merge resource due to conflicting Schema URL(valid URL) orfailed to build resolver: passthrough: received empty target in Build()(invalid value like an encrypted dotenvx blob). Both look like depot outages, not a local env problem.Why it happens
remoteBuildImageinbuildImage.tsspawns the depot CLI viaexeca. Execa's default isextendEnv: true, so theenvobject passed todepot()is merged ontoprocess.envrather than replacing it. Anything in the parent environment - includingOTEL_EXPORTER_OTLP_ENDPOINT- is inherited by the depot child. The depot CLI reads that variable to initialise its own OTel exporter and dies during telemetry init before the build starts.Fix
Add
OTEL_SDK_DISABLED: "1"andOTEL_EXPORTER_OTLP_ENDPOINT: ""to the env block passed todepot(). Since execa merges envs, these explicit values override whatever the parent shell has, keeping ambient OTEL config out of the depot child entirely.--local-buildis unaffected (it runsdocker buildxwhich tolerates the variable).