Nextjs build fail - runc run failed: unable to start container process

Deployment ID dd25dd4a-51bd-489e-94a0-387b5ef51852 and [github repo](https://github.com/ballermatic/nextjs-shadcn) using Nixpacks with nixpacks.toml courtesy of @Brody on an earlier iteration. Note, build randomly worked once out of dozens of attempts today. Error logs attached. Two key errors appear to be:
#14 0.442 runc run failed: unable to start container process: error during container init: error mounting "/var/lib/docker/overlay2/ylv4o55u3eenxetp8t9mxexop/diff" to rootfs at "/app/tsconfig.tsbuildinfo": mount /var/lib/docker/overlay2/ylv4o55u3eenxetp8t9mxexop/diff:/app/tsconfig.tsbuildinfo (via /proc/self/fd/6), flags: 0x5000: not a directory

#14 ERROR: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

As well as
> [stage-0 8/11] RUN --mount=type=cache,id=s/a4202936-edb2-4b30-8f88-d5d5dd20d757-next/cache,target=/app/.next/cache --mount=type=cache,id=s/a4202936-edb2-4b30-8f88-d5d5dd20d757-node_modules/cache,target=/app/node_modules/.cache --mount=type=cache,id=s/a4202936-edb2-4b30-8f88-d5d5dd20d757-tsconfigtsbuildinfo,target=/app/tsconfig.tsbuildinfo npm run build:

0.442 runc run failed: unable to start container process: error during container init: error mounting "/var/lib/docker/overlay2/ylv4o55u3eenxetp8t9mxexop/diff" to rootfs at "/app/tsconfig.tsbuildinfo": mount /var/lib/docker/overlay2/ylv4o55u3eenxetp8t9mxexop/diff:/app/tsconfig.tsbuildinfo (via /proc/self/fd/6), flags: 0x5000: not a directory

I am way out of my depth on this one.
Also note, NIXPACKS_NO_CACHE = 1 does not seem to help with this error.
scary looking error, think this one is out of our control
tagging in @jr for this
I wondered if that was the case. Earlier failures were definitely my doing until this one began to persist. I switched to npm due to yarn berry issues, then started re-adding the service fresh.
@rayofbytes - while your at it, this thread needs some attention too 🙂
don't know if it's running on the same host that just experienced this issue or not
Unrelated. JR's the expert 😉 He's currently out & will be back tomorrow
ah gotcha!
Just putting a message in here so if a response is made I'll be notified as experiencing the same issue.
Adding a little wrinkle… although this project remains dead due to the build error, I created a new one which replicates it almost verbatim and that one works. 4e14523a-53bd-46f8-85c7-9d34ed06fb93
My solution was to use @codydearkland's functioning template [nextjs-approuter-shadcn
](https://github.com/codyde/nextjs-approuter-shadcn) and then migrate my customizations over. That worked perfectly. As always, I appreciate everyone's help learning Railway! Thank you so much!!!
so the nixpacks.toml i did was causing issues?
Just having a look at this now. Is there a project/repo that currently fails to deploy?
It looks like it is an issue with caching the tsbuildinfo
Whups, spoke too soon… rolling back now. I found something.
I don't think it was that
It may have been typescript version. 5.1.6 works, 5.2.2 does not. Unclear about the tsbuildinfo cache.
oh wow downgrading the ts version solved the issue? thats interesting
There may have been a bad component also, still checking on that
Wouldn't expect that to be the case as it builds fine locally, no errors, etc. Will know more soon.
It seems 'use client' is not working for the nav component. That may have been the culprit. Tried other versions or next and node, no luck.
Yup. Closing this out due to app router learning on my end. If anyone finds this thread, I will post the solution when I find it. Thank you for helping me but this problem seems to be Next.js, not Railway.
For reference: tested node v 18.x-20.x (especially 18 --lts) and Next 13.4.9-13.4.19. It's the app router and my lack of understanding. I cannot convey how important @Brody is with this process. Holy shit.
Thank you.
awh shucks, thanks
Nesting 'get client' into a component didn't do it. I'm still processing the documentation for a millionth time and debating moving back to page router.
If you're not already in touch, the payload CMS crew are stone cold badass, in the best way.
hey I did the template for payload
App Router has all kinds of these weird little quirks with it. It’s been a journey for me too, let me tell ya.
Finally have a working solution. Sure enough, it was a client/server error!
Methodically went through the ringer and finally sorted it out. Context and hooks are a bear with RSC.
Oops, need to push yet, just a moment.
Rudimentary but a nice basis for more.
the nav doesn't work 😦
It's set to home, only one page
that's no fun 🤣
Should probably add those routes so its obvious lol

Looking for more? Join the community!

Recommended Posts
SSH tunnelingHi all, I'm deploying a django project with ssh tunneling to connect to a remote database. For this PR environments are not being deployed for the project ownerI have created a PR on my repo but I dont see any ephemeral deployment being createdGetting deployment error:11.24 error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`. Tried difEstimated usage very similar to current cost?Is the estimate usage working properly, or does it take a while to provide accurate estimates? I aCloudflare for Saas domains compatible with Railway?Hi! We'd love to use Railway but custom domains are holding us back so far. We use Cloudflare for cuCustom domain with A record (not CNAME record)Hi, I want to add a custom domain in one of my projects. Docs says I need to add a CNAME record in Very slow connectionHey, I've built an app that uses Remix, Prisma and Postgres and is hosted in vercel and railway. LoPostgres sql update query inserting "$1" instead of "?"I have a Postgres server and I runned the query: update "Table_name" set("column_name") = ("Column_nInquiry about Next.js SSR and ISR Support on RailwayHello Railway Community 👋, I'm currently exploring the possibility of migrating my Next.js projectPerformance questionsHi all! Does performance between Hobby and Pro plan differs? I'm mostly curious about initial connHow to specify deployment strategy?Hey, previously i'm a fly io user and I want to migrate to Railway. Is it possible to define the deI do not scroll rightWhen I access log and view it but I do not scroll right to sell full logs. Is it a bug of you?Build failed directus api templateI tried to deploy directus app using railway template (Directus api) and it failed every time. Does Network Error While sending a file.I have uploaded my telegram bot on a Railway Pro plan. The bot sends file back to users through Telego-cron jobs not running in railwayHello, so I'm using the go-cron(https://github.com/go-co-op/gocron) library for managing my cron jobpnpm not foundHi! I'm having trouble building my app, and haven't had success with any of the suggestions with othDo you guys have prepaid options?Say I pay 5$ once and I get to use those 5$ worth of resources all year round. I'd rather do that thChange Heroku to RailwayI need more info because I have a problem with Heroku with my hosted proyect there WebSocket doesnt I am getting this error on my deployment```console GET failed with status code 403 (a proxy could be disallowing the use of 'Upgrade: derp')Flask app wont work with port not responding