Please help me. I used to be able to deploy, but now I can’t.
The front end uses Vue.
Rails 6.1.6
yarn 1.22.17
Here is the error text
% flyctl deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-hidden-pond-1135 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 3.9s (0/1)
[+] Building 21.6s (25/25) FINISHED
=> CACHED [internal] load remote build context 0.0s
=> CACHED copy /context / 0.0s
=> resolve image config for docker.io/docker/dockerfile:experimental 1.6s
=> CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5 0.0s
=> [internal] load metadata for quay.io/evl.ms/fullstaq-ruby:3.0.4-jemalloc-slim 0.8s
=> [base 1/6] FROM quay.io/evl.ms/fullstaq-ruby:3.0.4-jemalloc-slim@sha256:a969fd121c1b46326d2555814aee7fd099a9bc8fbfa422862152abed611ee4b0 0.0s
=> CACHED [base 2/6] RUN mkdir /app 0.0s
=> CACHED [base 3/6] WORKDIR /app 0.0s
=> CACHED [base 4/6] RUN mkdir -p tmp/pids 0.0s
=> CACHED [base 5/6] RUN curl https://get.volta.sh | bash 0.0s
=> CACHED [base 6/6] RUN volta install node@16.13.0 yarn@1.22.17 && gem update --system --no-document && gem install -N bundler -v 2.3 0.0s
=> CACHED [stage-4 1/8] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt --mount=type=cache,id=prod-apt-lib,s 0.0s
=> CACHED [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt --mount=type=cache,id=dev-apt-lib, 0.0s
=> CACHED [gems 1/2] COPY Gemfile* ./ 0.0s
=> CACHED [gems 2/2] RUN bundle install && rm -rf vendor/bundle/ruby/*/cache 0.0s
=> CACHED [stage-4 2/8] COPY --from=gems /app /app 0.0s
=> CACHED [stage-4 3/8] COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions 0.0s
=> CACHED [stage-4 4/8] COPY --from=gems /usr/local/bundle /usr/local/bundle 0.0s
=> CACHED [node_modules 1/3] COPY package*json ./ 0.0s
=> CACHED [node_modules 2/3] COPY yarn.* ./ 0.0s
=> CACHED [node_modules 3/3] RUN yarn install 0.0s
=> CACHED [stage-4 5/8] COPY --from=node_modules /app/node_modules /app/node_modules 0.0s
=> CACHED [stage-4 6/8] COPY . . 0.0s
=> CACHED [stage-4 7/8] RUN chmod +x /app/bin/* && sed -i 's/ruby.exe\r*/ruby/' /app/bin/* && sed -i '/^#!/aDir.chdir File.expand_path 0.0s
=> ERROR [stage-4 8/8] RUN bin/rails fly:build 19.0s
------
> [stage-4 8/8] RUN bin/rails fly:build:
#25 5.669 yarn install v1.22.17
#25 5.773 [1/4] Resolving packages...
#25 6.224 [2/4] Fetching packages...
#25 16.19 error https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOSPC: no space left on device, mkdir '/usr/local/share/.cache/yarn/v6/npm-fast-glob-3.2.12-7f39ec99c2e6ab030337142da9e0c18f37afae80-integrity/node_modules/fast-glob/out/utils'"
#25 16.19 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
#25 18.44 rails aborted!
#25 18.44 Errno::ENOSPC: No space left on device @ rb_sysopen - /app/tmp/cache/assets/sprockets/v4.0.0/_q/_qeQSelryH_wPycaCqedOQpajvuutl9QRK6BTS-LbsI.cache.16000.1.821406
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/path_utils.rb:358:in `initialize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/path_utils.rb:358:in `open'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/path_utils.rb:358:in `atomic_write'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cache/file_store.rb:112:in `set'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cache.rb:227:in `set'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cache.rb:143:in `set'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:341:in `fetch_asset_from_dependency_cache'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:43:in `load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `block in load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `fetch'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/bundle.rb:32:in `block in call'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/bundle.rb:31:in `call'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/processor_utils.rb:84:in `call_processor'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/processor_utils.rb:65:in `reverse_each'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/processor_utils.rb:65:in `call_processors'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:182:in `load_from_unloaded'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:59:in `block in load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:337:in `fetch_asset_from_dependency_cache'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/loader.rb:43:in `load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `block in load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `fetch'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/cached_environment.rb:44:in `load'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/base.rb:81:in `find_asset'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/base.rb:88:in `find_all_linked_assets'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/manifest.rb:125:in `each'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/manifest.rb:125:in `to_a'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/sprockets-4.1.1/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `block in synchronize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `synchronize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:47:in `synchronize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:in `execute'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/promise.rb:564:in `block in realize'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:352:in `run_task'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:343:in `block (3 levels) in create_worker'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `loop'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:334:in `block (2 levels) in create_worker'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `catch'
#25 18.44 /app/vendor/bundle/ruby/3.0.0/gems/concurrent-ruby-1.1.10/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:333:in `block in create_worker'
#25 18.44 Tasks: TOP => fly:build => assets:precompile
#25 18.44 (See full trace by running task with --trace)
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -o pipefail -c ${BUILD_COMMAND}]: exit code: 1
Dockerfile
# syntax = docker/dockerfile:experimental
# Dockerfile used to build a deployable image for a Rails application.
# Adjust as required.
#
# Common adjustments you may need to make over time:
# * Modify version numbers for Ruby, Bundler, and other products.
# * Add library packages needed at build time for your gems, node modules.
# * Add deployment packages needed by your application
# * Add (often fake) secrets needed to compile your assets
#######################################################################
# Learn more about the chosen Ruby stack, Fullstaq Ruby, here:
# https://github.com/evilmartians/fullstaq-ruby-docker.
#
# We recommend using the highest patch level for better security and
# performance.
ARG RUBY_VERSION=3.0.4
ARG VARIANT=jemalloc-slim
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base
LABEL fly_launch_runtime="rails"
ARG NODE_VERSION=16.13.0
ARG YARN_VERSION=1.22.17
ARG BUNDLER_VERSION=2.3.6
ARG RAILS_ENV=production
ENV RAILS_ENV=${RAILS_ENV}
ENV RAILS_SERVE_STATIC_FILES true
ENV RAILS_LOG_TO_STDOUT true
ARG BUNDLE_WITHOUT=development:test
ARG BUNDLE_PATH=vendor/bundle
ENV BUNDLE_PATH ${BUNDLE_PATH}
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}
RUN mkdir /app
WORKDIR /app
RUN mkdir -p tmp/pids
RUN curl https://get.volta.sh | bash
ENV VOLTA_HOME /root/.volta
ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH
RUN volta install node@${NODE_VERSION} yarn@${YARN_VERSION} && \
gem update --system --no-document && \
gem install -N bundler -v ${BUNDLER_VERSION}
#######################################################################
# install packages only needed at build time
FROM base as build_deps
ARG BUILD_PACKAGES="git build-essential libpq-dev wget vim curl gzip xz-utils libsqlite3-dev"
ENV BUILD_PACKAGES ${BUILD_PACKAGES}
RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
apt-get update -qq && \
apt-get install --no-install-recommends -y ${BUILD_PACKAGES} \
&& rm -rf /var/lib/apt/lists /var/cache/apt/archives
#######################################################################
# install gems
FROM build_deps as gems
COPY Gemfile* ./
RUN bundle install && rm -rf vendor/bundle/ruby/*/cache
#######################################################################
# install node modules
FROM build_deps as node_modules
COPY package*json ./
COPY yarn.* ./
RUN yarn install
#######################################################################
# install deployment packages
FROM base
ARG DEPLOY_PACKAGES="postgresql-client file vim curl gzip libsqlite3-0"
ENV DEPLOY_PACKAGES=${DEPLOY_PACKAGES}
RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \
--mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt \
apt-get update -qq && \
apt-get install --no-install-recommends -y \
${DEPLOY_PACKAGES} \
&& rm -rf /var/lib/apt/lists /var/cache/apt/archives
# copy installed gems
COPY --from=gems /app /app
COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions
COPY --from=gems /usr/local/bundle /usr/local/bundle
# copy installed node modules
COPY --from=node_modules /app/node_modules /app/node_modules
#######################################################################
# Deploy your application
COPY . .
# Adjust binstubs to run on Linux and set current working directory
RUN chmod +x /app/bin/* && \
sed -i 's/ruby.exe\r*/ruby/' /app/bin/* && \
sed -i '/^#!/aDir.chdir File.expand_path("..", __dir__)' /app/bin/*
# The following enable assets to precompile on the build server. Adjust
# as necessary. If no combination works for you, see:
# https://fly.io/docs/rails/getting-started/existing/#access-to-environment-variables-at-build-time
ENV SECRET_KEY_BASE 1
# ENV AWS_ACCESS_KEY_ID=1
# ENV AWS_SECRET_ACCESS_KEY=1
# Run build task defined in lib/tasks/fly.rake
ARG BUILD_COMMAND="bin/rails fly:build"
RUN ${BUILD_COMMAND}
# Default server start instructions. Generally Overridden by fly.toml.
ENV PORT 8080
ARG SERVER_COMMAND="bin/rails fly:server"
ENV SERVER_COMMAND ${SERVER_COMMAND}
CMD ${SERVER_COMMAND}
fly.toml
# fly.toml file generated for nailier on 2022-12-12T11:00:08+09:00
app = "nailier"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
[build.args]
BUILD_COMMAND = "bin/rails fly:build"
SERVER_COMMAND = "bin/rails fly:server"
[deploy]
release_command = "bin/rails fly:release"
[env]
PORT = "8080"
[experimental]
allowed_public_ports = []
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
[[statics]]
guest_path = "/app/public"
url_prefix = "/"
[mounts]
source="nailier_active_storage_data"
destination="/data"
I added .yarnrc and listed networkConcurrency: 1, but cannot deploy.
I had fly deploy many times in a short period of time, could that be the cause?
Would increasing the amount of memory help?
Do you have any solutions to this problem?