Dockerfile deployment fails with "No such container"

I'm trying out Railway for the first time and having a weird issue with deployment. I connected to a GitHub repo with a Dockerfile, and Railway automatically tried to deploy the app. According to the logs, the Docker image was built and published. Then, the status changed to "Deploying" and it hung for about 5 minutes. After that, this appeared in the logs:
=========================
Container failed to start
=========================

/router.Router/StartDeployment UNKNOWN: Error response from daemon: No such container: 1fc1b54e43791d8ce2c26a2fbb146c16bb71207d1eff6f2f0474f334a306d034
=========================
Container failed to start
=========================

/router.Router/StartDeployment UNKNOWN: Error response from daemon: No such container: 1fc1b54e43791d8ce2c26a2fbb146c16bb71207d1eff6f2f0474f334a306d034
I already tried redeploying and got the same result.
25 Replies
Percy
Percy13mo ago
Project ID: 02d06474-014d-4110-a28f-e0e1b082aa06
atomicollection
atomicollection13mo ago
02d06474-014d-4110-a28f-e0e1b082aa06
Brody
Brody13mo ago
have you since tried removing that deployment and making a new one?
atomicollection
atomicollection13mo ago
no, but I can try that I've removed the deployment but I don't see a way to add a new one. Should I push an empty commit to the repo? Or should I just remove the whole service and re-add it?
Brody
Brody13mo ago
empty commit will do it
atomicollection
atomicollection13mo ago
okay, new deployment is building… same issue. The build failed about 5 minutes after the status changed to Deploying
Brody
Brody13mo ago
can you send the dockerfile?
Brody
Brody13mo ago
yeah looks fine to me, have you set any build or start commands in the settings
atomicollection
atomicollection13mo ago
No, just added the repo
Brody
Brody13mo ago
have you tested this dockerfile locally?
atomicollection
atomicollection13mo ago
I tested building but not running it, one moment running fails with an error about permissions on the start script. that's probably the issue I really wish that error would show up in the logs on Railway
Brody
Brody13mo ago
yeah that's odd for the script you'd likely need to do a chmod +x on it
atomicollection
atomicollection13mo ago
yeah, I'm trying that now and re-running locally
MantisInABox
MantisInABox13mo ago
Yeah, it definitely should have showed. Weird it went though and then was just liked “no container”
atomicollection
atomicollection13mo ago
it's probably a failure mode they haven't thought of. since it was an error from the docker daemon, not from the container.
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./start.sh": permission denied: unknown.
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./start.sh": permission denied: unknown.
that's the error. all on one line.
MantisInABox
MantisInABox13mo ago
Is the start script in your project prior to adding it to the container, or is it generated in your build? I can’t view your docker file on my phone
atomicollection
atomicollection13mo ago
the start script is in the project. and it wasn't executable, so that's probably the issue. I'm working on building and testing locally before I try again to push to Railway
Brody
Brody13mo ago
FROM node:lts-alpine as deps

WORKDIR /app

ADD package.json .npmrc ./
RUN npm install --include=dev

FROM node:lts-alpine as production-deps

WORKDIR /app

COPY --from=deps /app/node_modules /app/node_modules
ADD package.json .npmrc ./
RUN npm prune --omit=dev

FROM node:lts-alpine as build

WORKDIR /app

COPY --from=deps /app/node_modules /app/node_modules

ADD prisma .
RUN npx prisma generate

ADD . .
RUN npm run build

FROM node:lts-alpine

WORKDIR /app

COPY --from=production-deps /app/node_modules /app/node_modules
COPY --from=build /app/node_modules/.prisma /app/node_modules/.prisma

COPY --from=build /app/build /app/build
COPY --from=build /app/public /app/public
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/start.sh /app/start.sh
COPY --from=build /app/prisma /app/prisma

ENTRYPOINT [ "./start.sh" ]
FROM node:lts-alpine as deps

WORKDIR /app

ADD package.json .npmrc ./
RUN npm install --include=dev

FROM node:lts-alpine as production-deps

WORKDIR /app

COPY --from=deps /app/node_modules /app/node_modules
ADD package.json .npmrc ./
RUN npm prune --omit=dev

FROM node:lts-alpine as build

WORKDIR /app

COPY --from=deps /app/node_modules /app/node_modules

ADD prisma .
RUN npx prisma generate

ADD . .
RUN npm run build

FROM node:lts-alpine

WORKDIR /app

COPY --from=production-deps /app/node_modules /app/node_modules
COPY --from=build /app/node_modules/.prisma /app/node_modules/.prisma

COPY --from=build /app/build /app/build
COPY --from=build /app/public /app/public
COPY --from=build /app/package.json /app/package.json
COPY --from=build /app/start.sh /app/start.sh
COPY --from=build /app/prisma /app/prisma

ENTRYPOINT [ "./start.sh" ]
this is their dockerfile
MantisInABox
MantisInABox13mo ago
Thanks Brody!
Brody
Brody13mo ago
just needs +x on that script
MantisInABox
MantisInABox13mo ago
Yeah, more than likely
atomicollection
atomicollection13mo ago
it works now, thank you for the prompt to actually try it locally
Brody
Brody13mo ago
awesome
MantisInABox
MantisInABox13mo ago
Always best to test locally my dude