Description
Provide environment information
System:
OS: macOS 15.4.1
CPU: (10) arm64 Apple M1 Pro
Memory: 496.19 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
pnpm: 9.15.4 - ~/Library/pnpm/pnpm
bun: 1.0.22 - ~/.bun/bin/bun
Describe the bug
OpenTelemetry Schema URL conflict in Trigger.dev deployment
Description
When attempting to deploy a Trigger.dev project, the build fails with Error: cannot merge resource due to conflicting Schema URL
. This appears to be caused by conflicting OpenTelemetry versions or configurations between Trigger.dev and other dependencies.
Environment
- Trigger.dev Version: 3.3.17
- Node Version: v21
- Package Manager: pnpm
- Next.js Version: 15.3.0
- OpenTelemetry packages: Present in dependencies tree
Steps to Reproduce
- Run
pnpm trigger:deploy
in a project with OpenTelemetry-related dependencies - The deployment process fails during the container build phase
Error Message
Reproduction repo
n/a
To reproduce
Full logs show this error occurring during the build process when the indexer is running.
Troubleshooting Performed
We performed systematic testing of various OpenTelemetry environment variables to identify which setting resolves the conflict:
- Disabling the OpenTelemetry SDK with
OTEL_SDK_DISABLED=true
- Failed - Disabling Node integration with
OTEL_NODE_ENABLED=false
- Failed - Setting empty values for OpenTelemetry exporters:
- Setting
OTEL_EXPORTER_OTLP_ENDPOINT=""
- Failed - Setting
OTEL_EXPORTER_OTLP_HEADERS=""
- Failed - Setting
OTEL_EXPORTER_OTLP_PROTOCOL=""
- Failed - Setting
OTEL_TRACES_EXPORTER=none
- Success - Setting
OTEL_METRICS_EXPORTER=none
- Not tested individually - Setting
OTEL_LOGS_EXPORTER=none
- Not tested individually
- Setting
Solution
Setting the environment variable OTEL_TRACES_EXPORTER=none
when running the deployment resolves the issue.
This can be done by:
Running OTEL_TRACES_EXPORTER=none pnpm trigger:deploy
or setting the env var to none in .env.local
I had the following env vars before
OTEL_EXPORTER_OTLP_HEADERS=
OTEL_EXPORTER_OTLP_ENDPOINT=
# added to fix
OTEL_TRACES_EXPORTER=none
Additional Context
This issue appears to be related to conflicting OpenTelemetry versions or schemas between Trigger.dev and other dependencies (possibly Next.js). The conflict happens during resource merging when OpenTelemetry tries to set up the tracing. By disabling the traces exporter, the conflict is avoided while still allowing other OpenTelemetry functionality to operate.
Additional information
Potentially related issues #2044