Container Start Failure
I pushed my Go code to my repo and the auto-build failed with this error:
Project code:
69531a0b-78b7-4a71-9df4-3a8db9703b69
17 Replies
Mind sharing your Dockerfile?
I don't have one for this project
The build is completed successfully, though
So all going well?
Nope
After the build, it attempts to publish the image and then start the container
The latter returns an error
Same error or a different one? Can you paste the full log here?
Same
#16 [stage-0 9/9] RUN --mount=type=cache,id=s/20823280-db07-46f3-b4a3-1809ce497302-/root/cache/go-build,target=/root/.cache/go-build cd cmd && go build -o out
#16 sha256:b5ace5e2fe96e7e39627e0682fd78c3af90ec7890e459fe0e11b022d3e40900b
#16 DONE 5.6s
#6 [stage-1 2/5] WORKDIR /app/
#6 sha256:996a37cd4a3a1cd863331c12a30e283473e304ea5fb67665df750793d30e5ada
#6 CACHED
#17 [stage-1 3/5] COPY --from=0 /etc/ssl/certs /etc/ssl/certs
#17 sha256:38f61d9e8edf1d1eedf790028abcf8d97e5978e3855115cbce496466cb231048
#17 CACHED
#18 [stage-1 4/5] RUN true
#18 sha256:b63fab003d27755117cfb50a667cb0aa489fb39a2fb91993f78a27074c032dd7
#18 CACHED
#19 [stage-1 5/5] COPY --from=0 /app/ /app/
#19 sha256:cf8b137ddf1decdc183cc127619c9b1fd2ead44f0f681134aea0f32fc33942f8
#19 DONE 0.2s
#20 exporting to image
#20 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#20 exporting layers
#20 exporting layers 2.1s done
#20 writing image sha256:3f8c1c744ebd6443f27a66956c542da0716e78c96507ae35cdbce41c5529eab1
#20 writing image sha256:3f8c1c744ebd6443f27a66956c542da0716e78c96507ae35cdbce41c5529eab1 0.6s done
#20 naming to us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/69531a0b-78b7-4a71-9df4-3a8db9703b69/service/20823280-db07-46f3-b4a3-1809ce497302:5c1a5765-c8b3-4953-9816-7d0681e9251b 0.0s done
#20 DONE 2.7s
=== Successfully Built! ===
Run:
docker run -it us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/69531a0b-78b7-4a71-9df4-3a8db9703b69/service/20823280-db07-46f3-b4a3-1809ce497302:5c1a5765-c8b3-4953-9816-7d0681e9251b
Build time: 12.84 seconds
================
Publishing Image
================
The push refers to repository [us-west1-docker.pkg.dev/railway-infra/railway-docker-users/project/69531a0b-78b7-4a71-9df4-3a8db9703b69/service/20823280-db07-46f3-b4a3-1809ce497302]
Preparing 409b4250cf03
Preparing 9ee9bcc1b40f
Preparing 3269d6eeb88e
Waiting 409b4250cf03
Waiting 9ee9bcc1b40f
Preparing 6a24f82690cc
Preparing b45078e74ec9
Waiting 3269d6eeb88e
Waiting b45078e74ec9
Pushing [> ] 110.1kB/9.044MB 409b4250cf03
Layer already exists 9ee9bcc1b40f
Pushing [=======> ] 1.388MB/9.044MB 409b4250cf03
Layer already exists 3269d6eeb88e
Layer already exists 6a24f82690cc
Layer already exists b45078e74ec9
Pushing [==============> ] 2.666MB/9.044MB 409b4250cf03
Pushing [======================> ] 4.042MB/9.044MB 409b4250cf03
Pushing [===============================> ] 5.615MB/9.044MB 409b4250cf03
Pushing [=======================================> ] 7.188MB/9.044MB 409b4250cf03
Pushing [================================================> ] 8.761MB/9.044MB 409b4250cf03
Pushing [==================================================>] 9.082MB 409b4250cf03
Pushed 409b4250cf03
5c1a5765-c8b3-4953-9816-7d0681e9251b: digest: sha256:e0afa8c828b57baed0461da0fab4db7b5fc912171746f06786e782f7dbf95440 size: 1363
========================
Container Start Failure!
========================
rpc error: code = Unknown desc = Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "chmod +x ./cmd/out && ./cmd/out": stat chmod +x ./cmd/out && ./cmd/out: no such file or directory: unknown
Can you take an SS of your project structure and put it here?
Have you put any build or start command on Railway UI?
Nope. It's empty
This was a bug with our builder. Should be fixed. Are you still seeing this issue?
Yes, unfortunately. Exact same error once again.
Okay, so I was able to get the Build working by switching the build provider. Can you provide a start command for your application? In the meantime, I will raise this to the team.
I have no start command currently set on the Railway UI. However, I run my local instance using
go run cmd/main.go
Well, its better than failed!
I can't read your project's start command for ya. But I tried to configure it on your behalf
I think you have it from here
But this wasn't an issue before. This project ran fine until a month ago, after which I disabled it due to the execution hour limit
I ran it again yesterday and this issue popped up
I'm unsure how do I fix Railway not having
go
installed :/
Just saw that I have these in my ENV vars:
I did a little testing and it seems like the cmd
folder does exist in the root directory when the NIXPACKS_START_CMD
is run, the folder isn't detected
I replaced NIXPACKS_START_CMD
with dir cmd
and this is the error that shows up:
rpc error: code = Unknown desc = Failed to start container: "dir cmd" executable file not found in $PATH unknown
cc @Angelo @msrumon
hello?