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
Percy2y ago
Project ID: 02d06474-014d-4110-a28f-e0e1b082aa06
atomicollection
atomicollectionOP2y ago
02d06474-014d-4110-a28f-e0e1b082aa06
Brody
Brody2y ago
have you since tried removing that deployment and making a new one?
atomicollection
atomicollectionOP2y 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
Brody2y ago
empty commit will do it
atomicollection
atomicollectionOP2y ago
okay, new deployment is building… same issue. The build failed about 5 minutes after the status changed to Deploying
Brody
Brody2y ago
can you send the dockerfile?
Brody
Brody2y ago
yeah looks fine to me, have you set any build or start commands in the settings
atomicollection
atomicollectionOP2y ago
No, just added the repo
Brody
Brody2y ago
have you tested this dockerfile locally?
atomicollection
atomicollectionOP2y 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
Brody2y ago
yeah that's odd for the script you'd likely need to do a chmod +x on it
atomicollection
atomicollectionOP2y ago
yeah, I'm trying that now and re-running locally
MantisInABox
MantisInABox2y ago
Yeah, it definitely should have showed. Weird it went though and then was just liked “no container”
atomicollection
atomicollectionOP2y 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
MantisInABox2y 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
atomicollectionOP2y 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
Brody2y 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
MantisInABox2y ago
Thanks Brody!
Brody
Brody2y ago
just needs +x on that script
MantisInABox
MantisInABox2y ago
Yeah, more than likely
atomicollection
atomicollectionOP2y ago
it works now, thank you for the prompt to actually try it locally
Brody
Brody2y ago
awesome
MantisInABox
MantisInABox2y ago
Always best to test locally my dude
Want results from more Discord servers?
Add your server