R
Railway•10mo ago
nball

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

Deployment ID dd25dd4a-51bd-489e-94a0-387b5ef51852 and github repo 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
#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
> [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.
GitHub
GitHub - ballermatic/nextjs-shadcn
Contribute to ballermatic/nextjs-shadcn development by creating an account on GitHub.
29 Replies
Percy
Percy•10mo ago
Project ID: dd25dd4a-51bd-489e-94a0-387b5ef51852,a4202936-edb2-4b30-8f88-d5d5dd20d757,a4202936-edb2-4b30-8f88-d5d5dd20d757,a4202936-edb2-4b30-8f88-d5d5dd20d757
nball
nball•10mo ago
Also note, NIXPACKS_NO_CACHE = 1 does not seem to help with this error.
Brody
Brody•10mo ago
scary looking error, think this one is out of our control tagging in @jr for this
nball
nball•10mo ago
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.
Brody
Brody•10mo ago
@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
Ray
Ray•10mo ago
Unrelated. JR's the expert 😉 He's currently out & will be back tomorrow
Brody
Brody•10mo ago
ah gotcha!
dayflare
dayflare•10mo ago
Just putting a message in here so if a response is made I'll be notified as experiencing the same issue.
nball
nball•10mo ago
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
nball
nball•10mo ago
My solution was to use @codydearkland's functioning template 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!!!
GitHub
GitHub - codyde/nextjs-approuter-shadcn: Railway Template - NextJS ...
Railway Template - NextJS using AppRouter with Shadcn UI Elements - GitHub - codyde/nextjs-approuter-shadcn: Railway Template - NextJS using AppRouter with Shadcn UI Elements
Brody
Brody•10mo ago
so the nixpacks.toml i did was causing issues?
jr
jr•10mo ago
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
nball
nball•10mo ago
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.
Brody
Brody•10mo ago
oh wow downgrading the ts version solved the issue? thats interesting
nball
nball•10mo ago
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.
Brody
Brody•10mo ago
awh shucks, thanks
nball
nball•10mo ago
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.
Brody
Brody•10mo ago
hey I did the template for payload
codydearkland
codydearkland•10mo ago
App Router has all kinds of these weird little quirks with it. It’s been a journey for me too, let me tell ya.
nball
nball•10mo ago
Finally have a working solution. Sure enough, it was a client/server error!
nball
nball•10mo ago
GitHub
GitHub - ballermatic/nextjs-approuter-shadcn
Contribute to ballermatic/nextjs-approuter-shadcn development by creating an account on GitHub.
nball
nball•10mo ago
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.
nball
nball•10mo ago
nball
nball•10mo ago
Rudimentary but a nice basis for more.
Brody
Brody•10mo ago
the nav doesn't work 😦
nball
nball•10mo ago
It's set to home, only one page
Brody
Brody•10mo ago
that's no fun 🤣
nball
nball•10mo ago
Should probably add those routes so its obvious lol
Brody
Brody•10mo ago
yeah!!