Deployment issue (probably a settings issue)
Anonymous
TRIALOP

2 years ago

Go Project is building but the deployment gives an error:

/bin/bash: line 1: ./out: No such file or directory

could a brave soul lend me a hand?

28 Replies

2 years ago

build logs please -


Anonymous
TRIALOP

2 years ago

7a1d3284-12a9-43fa-8d00-f0d4bff60434


Anonymous
TRIALOP

2 years ago

[Region: us-west1]

Using Nixpacks

context: d8d1dc40cb7d7ec83b41a303743833b0

╔════════════ Nixpacks v1.21.2 ════════════╗

║ setup │ go ║

║──────────────────────────────────────────║

║ install │ go mod download ║

║──────────────────────────────────────────║

║ build │ go build cmd/server/main.go ║

║──────────────────────────────────────────║

║ start │ ./out ║

╚══════════════════════════════════════════╝

#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile

#1 transferring dockerfile: 2.36kB done

#1 DONE 0.1s

#2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1707782610

#2 ...

#3 [internal] load metadata for docker.io/library/ubuntu:jammy

#3 DONE 0.3s

#2 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1707782610

#2 DONE 0.5s

#4 [stage-0 1/11] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1707782610@sha256:8f4b0fd95dc3311cf9a59f236d8d7d7f956fe21a2a1d64b53c82f12c4e859f09

#4 DONE 0.0s

#5 [stage-0 2/11] WORKDIR /app/

#5 CACHED

#6 [stage-1 1/5] FROM docker.io/library/ubuntu:jammy@sha256:a6d2b38300ce017add71440577d5b0a90460d0e57fd7aec21dd0d1b0761bbfb2

#6 DONE 0.0s

#7 [internal] load .dockerignore

#7 transferring context: 2B done

#7 DONE 0.1s

#8 [internal] load build context

#8 transferring context: 118.90kB 0.1s done

#8 DONE 0.2s


Anonymous
TRIALOP

2 years ago

im having a boomer moment let me figure out how to bookmark the thing


Anonymous
TRIALOP

2 years ago


Anonymous
TRIALOP

2 years ago

there u go


Anonymous
TRIALOP

2 years ago

i can share my screen if it's faster


2 years ago

have you changed your build command?


Anonymous
TRIALOP

2 years ago

yes


Anonymous
TRIALOP

2 years ago

go build cmd/server/main.go


Anonymous
TRIALOP

2 years ago

it didnt build with default settings because my go file is in a subdir


Anonymous
TRIALOP

2 years ago

i tried setting my start command to go run cmd/server/main.go but it didnt fix the issue


2 years ago

try changing it to go build -o out cmd/server/main.go


Anonymous
TRIALOP

2 years ago

the deployment is succesful, thank you very much

i'm trying to connect to the postgresdb do you know what env variables i should use? i'm currently using these ones:

1240304920880484403


2 years ago

you would use the variables that your code uses


2 years ago

what variables does your code use?


Anonymous
TRIALOP

2 years ago

connectionString := "host=localhost port=5432 user=postgres password=pass dbname=gira sslmode=disable"


Anonymous
TRIALOP

2 years ago

i've set it up like this, but i'm not sure what variable to use for dbname:

1240305404550844447


2 years ago

PGDATABASE


Anonymous
TRIALOP

2 years ago

sry pop up on image

1240305526022078515


Anonymous
TRIALOP

2 years ago

ok perfect


Anonymous
TRIALOP

2 years ago

thank you


2 years ago

you can hover your mouse to the right of the hidden text to show you an eye icon that will temporarily show you the value


Anonymous
TRIALOP

2 years ago

do these values change per instance? or are they consistent across db deployments?


Anonymous
TRIALOP

2 years ago

it works


Anonymous
TRIALOP

2 years ago

i love you


Anonymous
TRIALOP

2 years ago

bye


2 years ago

the database name would be the same across all deployments of postgres, but you should still use an environment variable for it


Welcome!

Sign in to your Railway account to join the conversation.

Loading...