R
Railway

βœ‹ο½œhelp

Deployment issues in Golang project

CCodemunsta9/1/2023
Project id : 4e543459-a744-4198-970b-be420281426a
I am trying to deploy a go lang application, it's services where setup in a docker compose file but i noticed docker compose is not supported yet. So i created a redis and postgres service in my project but after building the deploy logs give this error : github.com/go-redis/redis/v8: /usr/local/go/pkg/tool/linux_amd64/compile: signal: killed

failed to build, error: exit status 1
Bbrody1929/1/2023
please do not use air when on railway
are you using a dockerfile?
CCodemunsta9/1/2023
hey brody, thanks for reaching out. yes i am using a docker file, along with a docker compose .yml file
i would remove air now and retry
Bbrody1929/1/2023
railway doesn't do anything with the compose file, so send me the Dockerfile please
CCodemunsta9/1/2023
Bbrody1929/1/2023
not very ideal tbh
CCodemunsta9/1/2023
i just tried to tweak it now to remove air and run with go run. however if u can suggest a better one, would be much appreciated
Bbrody1929/1/2023
working on it
CCodemunsta9/1/2023
thanks
how about the services on the docker compose, redis and postgres. that would mean i have to set that up manually? and how so.
Bbrody1929/1/2023
you said you already added them didnt you?
CCodemunsta9/1/2023
yhh i did, was just confirming if any relative setup would be required after
Bbrody1929/1/2023
have you added the service variables?
https://docs.railway.app/develop/variables#reference-variables
FROM golang:1.20-alpine

WORKDIR /app

COPY go.mod go.sum ./

RUN go mod download

COPY . ./

RUN go build -o main ./...

ENTRYPOINT ["/app/main"]

the COPY .env .env has been omitted on purpose, you should absolutely not commit your .env file to your repo
even if it is a private repo
CCodemunsta9/1/2023
Hello good morning, thanks for assisting. so i have updated the files, the build runs but it fails to connect to the db
CCodemunsta9/1/2023
Bbrody1929/1/2023
^
CCodemunsta9/1/2023
yes i have
Bbrody1929/1/2023
please show a screenshot of your service variables
CCodemunsta9/1/2023
Bbrody1929/1/2023
those are not reference variables, please remove the database related variables and look at the docs page I linked on how to add the reference variables for the database
CCodemunsta9/1/2023
hey, thanks brody. You where a massive help
the build works and connects to the db however when i go to the web url it says application failed to respond
CCodemunsta9/1/2023
but the build is working fine
CCodemunsta9/1/2023
hello
Bbrody1929/1/2023
I was sleeping lol
can you send another screenshot of your service variables
CCodemunsta9/1/2023
hey brody lol. yes sleep is very neccessary as developers
Bbrody1929/1/2023
sometimes
CCodemunsta9/1/2023
so fixed it now, something to do with having to make provisions for the port railway way listens for your app
but you have really been a humongous help. I am very grateful
my senior dev
Bbrody1929/1/2023
I'm glad it's working, but I'd like to make sure you do have the variables setup correctly, even if they are working
would you mind sending a screenshot of your service variables
CCodemunsta9/1/2023
alright, let me get a screenshot
CCodemunsta9/1/2023
Bbrody1929/1/2023
perfect!
I always want people to use reference variables because they will auto update if you where to for instance regen your database credentials, without reference variables you'd need to manually copy them back over
CCodemunsta9/1/2023
yayyyhh!!πŸ˜†
Bbrody1929/1/2023
well all solved then, happy coding fellow go dev!
CCodemunsta9/1/2023
you are very right. makes it more straightfoward instead of manually updating it
once again Thank you my senior Go dev
Bbrody1929/1/2023
no problem πŸ™‚

Looking for more? Join the community!

R
Railway

βœ‹ο½œhelp

Join Server
Recommended Posts
Using a custom domain with cloudflarehi! I'm ready to deploy my project to my domain, and now railway has detected my cname record, but icron job timezoneGreetings! I want to host a script which runs at a certain time relative to my time zone (GMT+3). Whtsc: Permission deniedI just subscribed to the Hobby Plan and am trying to deploy my first backend. It was working fine iPostgres MemoryIt is possible run commands like 'top' or 'pg_top'? I need check memory usage for my Postgres instanUpgrade to pro, how to "redeploy" postgres / redis to take advantage of the PRO infrastructure?I understand how to re-deploy my app to take advantage of the PRO infrastructure (after dragging it Railway states that my free trial is over, but I only used 2.5$My Railway deployment was paused, but I didn't use the 5$. Why is that?Sync service hostname to environment variable with VercelIs it possible to take the hostname of a given service and push it into an environment variable on aBot TelegramHi i want to ask if is possible to deploy a telegram bot in railway, because i read that mirrors/useApplication failed to respondHello, I just bought the Hobby Plan and I tried to deploy an Express app I made, the issue is the sevm.max_map_count [65530] is too low during deployementHi everyone, I currently try to deploy a SonarQube application on Railway and during deployement, I Errors Installing Cal.com TemplateHello, I am running into issues installing the cal template. Error: `ERROR: failed to solve: procIs private networking down?Hey is private networking down or something? Because currently all my builds are crashing because thHow to save a bit in MySQL database?I am trying to put data in my table in SQL, but whenever I come across bit, the table does not accepRunning Sqlite migrate with prisma in railwayHi, so im trying to use Sqlite database with prisma in railway, i got this error, any clue with thisAngular SSRI'm planning to deploy an angular app with server side rendering. Does Railway support it? At the moKilled Errorhello can somebody help me with this its not starting my projectTerrafoam thingyMy friend told me to learn terrafoarm(this sounds wrong i forgot what its called) Anyway what does iDocker Build Error``` ============== Using Nixpacks ============== context: 009fc5728ee64eb7a597ef6570e251a0 β•”making linux program available in nixpacksHi, I want to run a golang app on railway. Within this app i use the following dependency https://giIs it normal for a deployment to be initializing this long?https://cdn.fl1nt.dev/GAGE1/YAdogAtO61.png I don't think this is normal, none of my deployments tak