R
Railway16mo 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
Percy16mo ago
Project ID: 6b59c99d-f9d1-42bb-9733-67e02909cdc5
Brody
Brody16mo ago
please send full build logs
Brody
Brody16mo ago
this doesn't look like a user issue, will flag team
Duchess
Duchess16mo ago
Thread has been flagged to Railway team by @Brody.
nball
nballOP16mo ago
Whew! I assumed it was user error…
Brody
Brody16mo 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
nballOP16mo ago
6b59c99d-f9d1-42bb-9733-67e02909cdc5
Brody
Brody16mo 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
nballOP16mo 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
Brody16mo 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
nballOP16mo ago
Whoa. Why so huge? This is worse than the other one.
Brody
Brody16mo ago
haha i know, and that was a 2gb image made by nixpacks, its not even my fault this time lol
nball
nballOP16mo ago
😂 Well if it works it works!
Brody
Brody16mo ago
im working on a multistage nixpacks build, i wonder if i will succeed
nball
nballOP16mo ago
Thanks again!
Brody
Brody16mo ago
https://test-service2.up.railway.app/ it works, as a 2gb image
nball
nballOP16mo ago
The payload crew asked about a multi stage docker file My knowledge envelope tapers quickly with DevOps.
Brody
Brody16mo 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
nballOP16mo ago
Do I add that to the repo?
Brody
Brody16mo ago
indeed
nball
nballOP16mo ago
Right on Thank you again!
Brody
Brody16mo ago
no problem! the build has worked? and image is small again?
nball
nballOP16mo ago
No cache worked, pushing with .toml now
Brody
Brody16mo ago
ah okay
nball
nballOP16mo ago
Boom, 496Mb now, nicely done
Brody
Brody16mo ago
awsome
nball
nballOP16mo ago
Builds and deploys much faster too
Brody
Brody16mo ago
you can tweak the onlyIncludeFiles incase i missed something
nball
nballOP16mo ago
1000
jr
jr16mo 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