Remote deploys were working for me up until a few hours ago. Now I keep getting these type of errors:
“Error failed to fetch an image or build from source: error building: failed to solve with frontend dockerfile.v0: failed to read dockerfile: Error processing tar file(exit status 1): write /frontend/.next/cache/next-babel-loader/8b9549e70fb7562fd0d5dc568552dcdd.json: no space left on device”.
I looked up the community forum and found the advice of deleting the builder app, which I did, but unfortunately I’m still unable to deploy, and getting the same error. I’d love some help here!
This may happen because you have large directories locally that are being unnecessarily added to your build. Can you try adding this to .dockerignore in your project root?
Oops, looks like I might have spoken too soon. That solved deploys for two of my services, but one of them (pastel-frontend) is still failing from an out of disk space issue. I also don’t see the builder in my dashboard or from fly list apps so I can’t go in and free some space up. Any ideas here?
Pasting the output from fly deploy here:
❯ fly deploy -c fly.frontend.toml
Update available 0.0.353 -> v0.0.362.
Run "fly version update" to upgrade.
==> Verifying app config
--> Verified app config
==> Building image
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux aarch64
[+] Building 28.1s (0/1)
[+] Building 272.3s (9/11)
=> [internal] load remote build context 0.0s
=> copy /context / 4.9s
=> [internal] load metadata for docker.io/library/node:16.14.0-alpine3.15 0.7s
=> [1/7] FROM docker.io/library/node:16.14.0-alpine3.15@sha256:2eafdff61134201bb13e452ae5515ac181126d28d91d548b048dab66140adbe6 0.0s
=> CACHED [2/7] RUN apk add dumb-init 0.0s
=> [3/7] WORKDIR /usr/src/app/frontend 0.1s
=> CACHED copy /context / 0.0s
=> [4/7] COPY --chown=node:node /frontend/package*.json ./ 0.3s
=> ERROR [5/7] RUN npm ci 257.9s
------
> [5/7] RUN npm ci:
#9 87.97 npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
#9 92.07 npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
#9 96.78 npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
#9 201.2 npm WARN deprecated har-validator@5.1.5: this library is no longer supported
#9 209.7 npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
#9 244.6 npm WARN deprecated mkdirp@0.5.3: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
#9 254.7 npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
#9 256.7 npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
#9 257.3 npm WARN tar TAR_ENTRY_ERROR ENOSPC: no space left on device, write
#9 257.4 npm WARN tar TAR_ENTRY_ERROR ENOSPC: no space left on device, write
#9 257.5 npm notice
#9 257.5 npm notice New minor version of npm available! 8.3.1 -> 8.15.1
#9 257.5 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.15.1>
#9 257.5 npm notice Run `npm install -g npm@8.15.1` to update!
#9 257.5 npm notice
#9 257.6 npm ERR! code ENOSPC
#9 257.6 npm ERR! syscall write
#9 257.6 npm ERR! errno -28
#9 257.6 npm ERR! nospc ENOSPC: no space left on device, write
#9 257.6 npm ERR! nospc There appears to be insufficient space on your system to finish.
#9 257.6 npm ERR! nospc Clear up some disk space and try again.
#9 257.6
#9 257.6 npm ERR! A complete log of this run can be found in:
#9 257.6 npm ERR! /root/.npm/_logs/2022-07-28T16_12_27_024Z-debug-0.log
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c npm ci]: exit code: 228
I believe the command is fly apps list (but that may have been a typo and is what you ran). Fly used to show remote builder apps in there and if an old one has a full disk, a temporary fix/hack is to destroy it (so that a new one is created on the next deploy).
But it would be better not to need to. So … the question is why your npm is installing either so many files or such big files. Maybe try npm ci --production ? If your NODE_ENV is production that flag shouldn’t be needed but it can’t hurt as it should simply ignore it and make no difference. If it’s installing dev dependencies (like testing/e2e stuff) that could certainly be taking up a load of space and resulting in that error.
And while at it, can’t hurt to fly version update too Using the latest CLI can fix random issues.
Thanks for the help folks! Things seem to be working now, I now see a new builder both from fly apps list and in the UI, and now the disk space issues are no longer happening.