Self hosting: Error: Build failed: 401 "No authorization header provided"
Hi, I'm getting this issue when self hosting with Coolify (I have tried the latest versions of each package, but rolled back to see if that was the issue) - I have successfully logged in, initialised, and set my local env vars. I have had trigger.dev running locally without Coolify, but their template is a bit scuffed at the moment. Thanks
TRIGGER_ACCESS_TOKEN=tr_pat_ov....... TRIGGER_API_URL=https://t..... TRIGGER_SECRET_KEY=tr_dev_i.....
npx trigger.dev dev
Trigger.dev (3.3.10 -> 3.3.11)
------------------------------------------------------
│
▲ Warning: You're not running the latest CLI version, please consider updating ASAP
│
│ Current: 3.3.10
│ Latest: 3.3.11
│
│ Run latest: npx trigger.dev@latest
------------------------------------------------------
Key: Version | Task | Run
------------------------------------------------------
○ Building background worker…
│
■ Error: Build failed: 401 "No authorization header provided"
│
│ Error: 401 "No authorization header provided"
│ at DevWorkerRuntime.initializeWorker (file:///C:/Users/node_modules/trigger.dev/dist/esm/dev/workerRuntime.js:153:19)
│ at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
│ at async updateBundle (file:///C:/Users/node_modules/trigger.dev/dist/esm/dev/devSession.js:49:13)
│ at async runBundle (file:///C:/Users/node_modules/trigger.dev/dist/esm/dev/devSession.js:119:9)
│ at async startDevSession (file:///C:/Users/node_modules/trigger.dev/dist/esm/dev/devSession.js:122:26)
│ at async startDev (file:///C:/Users/node_modules/trigger.dev/dist/esm/commands/dev.js:115:23)
│ at async devCommand (file:///C:/Users/node_modules/trigger.dev/dist/esm/commands/dev.js:55:29)
│ at async file:///C:/Users/node_modules/trigger.dev/dist/esm/commands/dev.js:31:13
│ at async file:///C:/Users/node_modules/trigger.dev/dist/esm/cli/common.js:54:28
│ at async wrapCommandAction (file:///C:/Users/node_modules/trigger.dev/dist/esm/cli/common.js:40:12)
Had the same issue but just fixed it.
I changed two things, so not 100% which of them solved it:
1: I changed TRIGGER_PROTOCOL to https (was http before, even though I'm on https)
2: I added REGISTRY_HOST and REGISTRY_NAMESPACE env vars
Hope this helps 😊
We're going to be releasing v4 self-hosting in the next couple of weeks. The Coolify templates have always been unofficial but @Mortalife has added some great instructions for v3 in this repo: https://github.com/Mortalife/trigger-dev-coolify
Hope you were able to resolve the issue, I'll close this for now.