R
Railway10mo ago
nball

Simple next.js build fail

deployment ID 6b59c99d-f9d1-42bb-9733-67e02909cdc5 Repo: https://github.com/ballermatic/nextjs-shadcn Error:
#12 0.524 runc run failed: unable to start container process: error during container init: error mounting "/var/lib/docker/overlay2/e5otij3fmo9s1ewupul8502po/diff" to rootfs at "/app/tsconfig.tsbuildinfo": mount /var/lib/docker/overlay2/e5otij3fmo9s1ewupul8502po/diff:/app/tsconfig.tsbuildinfo (via /proc/self/fd/6), flags: 0x5000: not a directory

#12 ERROR: process "/bin/bash -ol pipefail -c yarn run build" did not complete successfully: exit code: 1
#12 0.524 runc run failed: unable to start container process: error during container init: error mounting "/var/lib/docker/overlay2/e5otij3fmo9s1ewupul8502po/diff" to rootfs at "/app/tsconfig.tsbuildinfo": mount /var/lib/docker/overlay2/e5otij3fmo9s1ewupul8502po/diff:/app/tsconfig.tsbuildinfo (via /proc/self/fd/6), flags: 0x5000: not a directory

#12 ERROR: process "/bin/bash -ol pipefail -c yarn run build" did not complete successfully: exit code: 1
I'm stumped. This is using nixpacks, builds fine locally. Any ideas?
GitHub
GitHub - ballermatic/nextjs-shadcn
Contribute to ballermatic/nextjs-shadcn development by creating an account on GitHub.
31 Replies
Percy
Percy10mo ago
Project ID: 6b59c99d-f9d1-42bb-9733-67e02909cdc5
Brody
Brody10mo ago
please send full build logs
Brody
Brody10mo ago
this doesn't look like a user issue, will flag team
Duchess
Duchess10mo ago
Thread has been flagged to Railway team by @Brody.
nball
nball10mo ago
Whew! I assumed it was user error…
Brody
Brody10mo ago
thats a good assumption, but nah would you happen to have the deployment id for that failed deployment? if you open the deployment you will see a ?id= query string param in the url, that would be the deployment id
nball
nball10mo ago
6b59c99d-f9d1-42bb-9733-67e02909cdc5
Brody
Brody10mo ago
in the mean time, dont touch that service if possible, if you create a new service in the same project, it shouldnt have this problem
nball
nball10mo ago
Ok, will do! Hmmm, deployment failed however no error in build logs. They just stop. #10 0.711 yarn install v1.22.19  #10 0.816 [1/4] Resolving packages...  #10 1.093 [2/4] Fetching packages...  #10 25.92 [3/4] Linking dependencies...  #10 30.29 [4/4] Building fresh packages... @project: 8c545066-0015-4ef3-9a41-591f9f242a2d @environment: 261e9b2a-29ea-4b26-a38c-b30a818ca8bc @service: 9af16dbf-1a02-417f-baee-b2a3694f6e04 @snapshot: c9ead65c-3b52-405b-b50a-1b95529df0c4
Brody
Brody10mo ago
try again lol once back at my computer I'll be trying to deploy your repo too got it to build with the variable NIXPACKS_NO_CACHE = 1 however, it produced a 2gb image
nball
nball10mo ago
Whoa. Why so huge? This is worse than the other one.
Brody
Brody10mo ago
haha i know, and that was a 2gb image made by nixpacks, its not even my fault this time lol
nball
nball10mo ago
😂 Well if it works it works!
Brody
Brody10mo ago
im working on a multistage nixpacks build, i wonder if i will succeed
nball
nball10mo ago
Thanks again!
Brody
Brody10mo ago
https://test-service2.up.railway.app/ it works, as a 2gb image
nball
nball10mo ago
The payload crew asked about a multi stage docker file My knowledge envelope tapers quickly with DevOps.
Brody
Brody10mo ago
yeah im trying to do the same, but with nixpacks got the image down to ~480mb with this nixpacks.toml file
[variables]
NEXT_TELEMETRY_DISABLED = '1'
NPM_CONFIG_UPDATE_NOTIFIER = 'false'
NPM_CONFIG_FUND = 'false'

[phases.prune]
dependsOn = ['build']
cmds = ['npm prune --production']

[start]
runImage = 'node:18.17.1-slim'
onlyIncludeFiles = ['./package.json', './next.config.mjs', './public', './.next', './node_modules']
cmd = 'npm run start'
[variables]
NEXT_TELEMETRY_DISABLED = '1'
NPM_CONFIG_UPDATE_NOTIFIER = 'false'
NPM_CONFIG_FUND = 'false'

[phases.prune]
dependsOn = ['build']
cmds = ['npm prune --production']

[start]
runImage = 'node:18.17.1-slim'
onlyIncludeFiles = ['./package.json', './next.config.mjs', './public', './.next', './node_modules']
cmd = 'npm run start'
those two npm variables dont do anything for the size, they just disable annoyances still need NIXPACKS_NO_CACHE = 1 for some reason though
nball
nball10mo ago
Do I add that to the repo?
Brody
Brody10mo ago
indeed
nball
nball10mo ago
Right on Thank you again!
Brody
Brody10mo ago
no problem! the build has worked? and image is small again?
nball
nball10mo ago
No cache worked, pushing with .toml now
Brody
Brody10mo ago
ah okay
nball
nball10mo ago
Boom, 496Mb now, nicely done
Brody
Brody10mo ago
awsome
nball
nball10mo ago
Builds and deploys much faster too
Brody
Brody10mo ago
you can tweak the onlyIncludeFiles incase i missed something
nball
nball10mo ago
1000
jr
jr10mo ago
The first issue seems to be due to a bad docker state on one of the builders. I've cycled it so you should be good to remove the NIXPACKS_NO_CACHE variable if you would like
Want results from more Discord servers?
Add your server
More Posts