R
Railway12mo ago
maddsua

build fails on redeploy from ui

So I use a dockerfile to deploy my service using cli, the entire image only consist of a single js file and it seems like railway grabs the entire directory anyway and then tries to build the the thing from the wrong files and fails. Is it time to use .railwayignore?
Solution:
tl;dr dont let railway's ui redeploy your service, cancel it and use the bookmarklet
Jump to solution
33 Replies
Percy
Percy12mo ago
Project ID: 1f0944a2-14bd-447c-bb7f-2d7bedb23ed1
maddsua
maddsuaOP12mo ago
1f0944a2-14bd-447c-bb7f-2d7bedb23ed1 dockerfile for the reference:
FROM denoland/deno:alpine

WORKDIR /app/

COPY ./.build/run.js /app/

RUN deno cache -r run.js

EXPOSE 8080

CMD deno run --allow-env --allow-read --allow-net run.js
FROM denoland/deno:alpine

WORKDIR /app/

COPY ./.build/run.js /app/

RUN deno cache -r run.js

EXPOSE 8080

CMD deno run --allow-env --allow-read --allow-net run.js
Brody
Brody12mo ago
yes railway would gzip the entire directory as long as the file / folder is not in either a .gitignore or a .railwayignore
maddsua
maddsuaOP12mo ago
I'll try that oh great now it doesn't see the files kekw I just make it use the same commands as in dockerfile?
Brody
Brody12mo ago
not really how that works
maddsua
maddsuaOP12mo ago
thonk foolery intensifies well I guess I can fix it in cicd
Brody
Brody12mo ago
run.js is going to be the only file copied into the image, what does it matter if the rest of the directory is uploaded?
maddsua
maddsuaOP12mo ago
because railway tries to run index.ts that is also copied and that big boi won't run without being bundled first this is all happening on redeploy
Brody
Brody12mo ago
then railway may be running old code, and thats another issue
maddsua
maddsuaOP12mo ago
thonk
Brody
Brody12mo ago
or you have a start command set in the service settings
maddsua
maddsuaOP12mo ago
nope I don't
Brody
Brody12mo ago
then its the first option use this to do your redeploys https://bookmarklets.up.railway.app/service-redeploy/
maddsua
maddsuaOP12mo ago
railway does it automatically each time an env variable is changed
maddsua
maddsuaOP12mo ago
actually the problematic part is "build" step
No description
maddsua
maddsuaOP12mo ago
where does it even take it from 😁 it just uses the default step for deno which is not required here
Brody
Brody12mo ago
i know, its a bug that im going to be pressing the team to fix it caused a lot of issues when people went to redeploy their services after they went down yesterday
maddsua
maddsuaOP12mo ago
so it shouldn't redeploy when that happens? Im confused (just a bit)
Brody
Brody12mo ago
railways auto redeploy on variable change can deploy old code
maddsua
maddsuaOP12mo ago
oh got it but there's no "old" code per say
Brody
Brody12mo ago
there is somewhere old deployment, same same
maddsua
maddsuaOP12mo ago
you mean like parts of the deploy it takes as the base or one before it? because here it never had that index.ts as the input
Brody
Brody12mo ago
railways auto redeploy on variable change can deploy your very first deployment
maddsua
maddsuaOP12mo ago
okay, got it but I don't think it's related the actual build is handled by gitlab railway just gets the js file
Brody
Brody12mo ago
😐
maddsua
maddsuaOP12mo ago
thonk
Brody
Brody12mo ago
this thread is titled "build fails on redeploy from ui" so yes it is related
maddsua
maddsuaOP12mo ago
it's 11 pm I may be dumb rn yeah but it fails due to railway trying to execute that "build" step, not the old code
Solution
Brody
Brody12mo ago
tl;dr dont let railway's ui redeploy your service, cancel it and use the bookmarklet
maddsua
maddsuaOP12mo ago
okay fair
Brody
Brody12mo ago
trust, auto redeploy is bugged in likely more ways then im describing here
maddsua
maddsuaOP12mo ago
well I'll do more stuff with ci to make it more smooth anyway to give it absolutely zero chances I'm too lazy to cancel =)
Brody
Brody12mo ago
gotta cancel or theres only going to be more head aches nearly everyone who didnt use the bookmarklet and wasn’t deploying an image had issues yesterday
Want results from more Discord servers?
Add your server