#deploy failed on windows using v3.0.12

1 messages · Page 1 of 1 (latest)

cerulean moat
#

I am getting this error when running npm trigger.dev@v3 deploy --self-hosted with @beta the deployment was working. how every afer updating to v3 and updating the trigger.config.ts the deployment phase fails with the following error.
Config File:
import { defineConfig } from "@trigger.dev/sdk/v3";
import type { TriggerConfig } from "@trigger.dev/sdk/v3";
export default defineConfig({ project: "", logLevel: "log", retries: { enabledInDev: true, default: { maxAttempts: 3, minTimeoutInMs: 1000, maxTimeoutInMs: 10000, factor: 2, randomize: true, }, }, dirs: ["./trigger"], apiKey: "", apiUrl: "http://localhost:3040", secretKey: "", } as TriggerConfig);

#16 [final 1/3] WORKDIR /app #16 CACHED #17 [final 2/3] COPY --from=build --chown=node:node /app ./ #17 DONE 0.2s #15 [indexer 2/2] RUN node /app/Users/Administrator/AppData/Local/npm-cache/_npx/a3728c67b1b6726f/node_modules/trigger.dev/dist/esm/entryPoints/deploy-index-controller.mjs #15 8.543 Failed to index deployment { #15 8.543 name: 'Error', #15 8.543 message: 'Failed to fetch environment variables: Connection error.', #15 8.543 stack: 'Error: Failed to fetch environment variables: Connection error.\n' + #15 8.543 ' at indexDeployment (file:///app/Users/Administrator/AppData/Local/npm-cache/_npx/a3728c67b1b6726f/node_modules/trigger.dev/dist/esm/entryPoints/deploy-index-controller.mjs:419:13)\n' + #15 8.543 ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + #15 8.543 ' at async file:///app/Users/Administrator/AppData/Local/npm-cache/_npx/a3728c67b1b6726f/node_modules/trigger.dev/dist/esm/entryPoints/deploy-index-controller.mjs:461:1', #15 8.543 stderr: '' #15 8.543 } #15 ERROR: process "/bin/sh -c node /app/Users/Administrator/AppData/Local/npm-cache/_npx/a3728c67b1b6726f/node_modules/trigger.dev/dist/esm/entryPoints/deploy-index-controller.mjs" did not complete successfully: exit code: 1

magic bluff
desert junco
#

Oh right, you're running this locally. We changed how indexing works. It all happens while building the deployment image now and not after, so you will have to specify --network host when running locally. Otherwise, the process inside the build container won't be able to access the webapp at localhost:3040

lilac sundial
#

@atomic drum

mortal prism
#

@desert junco @magic bluff
im trying with this command and it still fails:
pnpm dlx trigger.dev@latest deploy --api-url http://localhost:3040 --network host

the error is still the same:

#20 7.763 Failed to index deployment {
#20 7.763   name: 'Error',
#20 7.763   message: 'Failed to fetch environment variables: Connection error.',
#20 7.763   stack: 'Error: Failed to fetch environment variables: Connection error.\n' +
#20 7.763     '    at indexDeployment (file:///app/.cache/pnpm/dlx/ydgrh2h7r7f2w2slwzu4areodq/19c4c1a2555-d448/node_modules/.pnpm/[email protected][email protected]/node_modules/trigger.dev/dist/esm/entryPoints/managed-index-controller.m
js:741:13)\n' +
#20 7.763     '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
#20 7.763     '    at async file:///app/.cache/pnpm/dlx/ydgrh2h7r7f2w2slwzu4areodq/19c4c1a2555-d448/node_modules/.pnpm/[email protected][email protected]/node_modules/trigger.dev/dist/esm/entryPoints/managed-index-controller.mjs:808:1',
#20 7.763   stderr: ''
#20 7.763 }
little nymph
#

It looks like during the build, the indexer runs inside a container and tries to reach your webapp at http://localhost:3040. Inside the container, localhost is the container, not your host, so it never reaches the webapp. Use a URL that points from inside the container to your host

mortal prism
magic bluff
#

I'm not an expert in this but for Docker to be able to access the network of your machine I think you need to use ⁨http://host.docker.internal:3040

#

localhost⁩ inside Docker is the local network inside the Docker network, which is not the same localhost as on your laptop

mortal prism
magic bluff
#

This is a bit confusing to be honest because during development we are all running everything on localhost and deploying locally as well.

It's possible it's something specific to Windows because we all run Mac or Linux

#

It's very unusual for a self-hoster to be running on localhost and deploying

#
  • windows
mortal prism
#

i use linux, the instance is accesible, it only works when i had a public instance deployed with a public IP

magic bluff
#

Oh this thread is about Windows, that was someone else

#

Can you give a load more info about what you're setup?

Where is your Trigger.dev service running? Where are you trying to deploy from?

mortal prism
#

trying to deploy from localhost to an instance running inside minikube, the service is port forwarded and accessible in localhost:3040

#

i also had setup an ingress with certificates using DNS challenge to the instance in trigger.iko.ai, then i logged in succecully and envs are updated successully, this domain is added in /etc/hosts

#

it points to my minikube loadbalancer (using minikube tunnel)

#

the idea is that it's accessible both using a DNS as well as port forwarded, both approaches do not seem to work