Error failed to fetch an image or build from source...Unknown desc = quay.io/evl.ms/fullstaq-ruby:3.0.1-jemalloc-bullseye-slim: not found

I just ran a test, and you also have to make one more change. Before:

COPY --from=gems /usr/lib/fullstaq-ruby/versions /usr/lib/fullstaq-ruby/versions

After:

COPY --from=gems /usr/local/lib/ruby/gems /usr/local/lib/ruby/gems

@rubys No problem. One would expect someone getting latest Ruby to know what they are doing. I am trying to upgrade a Rails app and thought Iā€™d just go for it.

Now getting other errors about Volta, so will hold off.

If the following post was for me, already have the added line, but not the After line.

Definitely time to hang it up and wait for now

Thatā€™s a bit harsh. There are plenty of experts on the Ruby language who are not also experts on Docker and Debian distributions. I want to make the Dockerfiles that flyctl launch produces work for more people. As such, I would be very much interested in hearing what problems you are having with volta.

You may be the first here to try Ruby 3.2, but there will be plenty of others joining you soon.

@rubys Hereā€™s the response. Glad youā€™re tackling this because it does need to get easier. Iā€™ve never dealt with Docker until fly.io, but it seems Dockerfile has to be manually updated. This is with my original Dockerfile. Will post using your suggestion separately.

āžœ node -v
v18.12.1
āžœ bundler -v
Bundler version 2.3.25
āžœ gem update --system --no-document
Latest version already installed. Done.

āžœ fly deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-solitary-wave-4007 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 57.0s (0/1)
[+] Building 0.9s (11/25)
 => CACHED [internal] load remote build context                                                                                                                     0.0s
 => CACHED copy /context /                                                                                                                                          0.0s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                                               0.1s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5                          0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2.0-slim                                                                                                  0.1s
 => [base 1/6] FROM docker.io/library/ruby:3.2.0-slim@sha256:8f243a374ec6820be6d883b8151452fe0a7f91d94e44e03a8270c9050a86f21e                                       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
 => ERROR [base 6/6] RUN volta install node@18.12.1 yarn@1.22.19 &&     gem update --system --no-document &&     gem install -N bundler -v 2.3.25                   0.4s
------
 > [base 6/6] RUN volta install node@18.12.1 yarn@1.22.19 &&     gem update --system --no-document &&     gem install -N bundler -v 2.3.25:
#11 0.348 /bin/sh: 1: volta: not found
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c volta install node@${NODE_VERSION} yarn@${YARN_VERSION} &&     gem update --system --no-document &&     gem install -N bundler -v ${BUNDLER_VERSION}]: exit code: 127

I have no clue what Volta is. But my node and yarn versions match the versions Iā€™m using. And I ran the gem update --system --no-document separately to no effect.

Dockerfile (removed initial comments which I noticed did say you have to manually update):

ARG RUBY_VERSION=3.2.0
ARG VARIANT=slim
FROM ruby:${RUBY_VERSION}-${VARIANT} as base


LABEL fly_launch_runtime="rails"

ARG NODE_VERSION=18.12.1
ARG YARN_VERSION=1.22.19
ARG BUNDLER_VERSION=2.3.25

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 's/ruby\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}

Response (at a glance, the same):

āžœ fly deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-solitary-wave-4007 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 56.5s (0/1)
[+] Building 4.7s (11/25)
 => [internal] load remote build context                                                                                                                               0.0s
 => copy /context /                                                                                                                                                    2.2s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                                                  0.1s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5                             0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2.0-slim                                                                                                     0.1s
 => [base 1/6] FROM docker.io/library/ruby:3.2.0-slim@sha256:8f243a374ec6820be6d883b8151452fe0a7f91d94e44e03a8270c9050a86f21e                                          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
 => ERROR [base 6/6] RUN volta install node@18.12.1 yarn@1.22.19 &&     gem update --system --no-document &&     gem install -N bundler -v 2.3.25                      0.4s
------
 > [base 6/6] RUN volta install node@18.12.1 yarn@1.22.19 &&     gem update --system --no-document &&     gem install -N bundler -v 2.3.25:
#11 0.367 /bin/sh: 1: volta: not found
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/sh -c volta install node@${NODE_VERSION} yarn@${YARN_VERSION} &&     gem update --system --no-document &&     gem install -N bundler -v ${BUNDLER_VERSION}]: exit code: 127

OK, I see whatā€™s happening. curl is not included in the ruby-slim image. The best fix is to move the install of volta until after the install of curl, and then to copy the results to the final image. Here are the changes, in diff form:

diff --git a/Dockerfile b/Dockerfile
index 431c96e..b0183cf 100755
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,8 +18,8 @@
 # performance.
 
 ARG RUBY_VERSION=3.2.0
-ARG VARIANT=jemalloc-slim
-FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base
+ARG VARIANT=slim
+FROM ruby:${RUBY_VERSION}-${VARIANT} as base
 
 LABEL fly_launch_runtime="rails"
 
@@ -42,11 +42,10 @@ 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 && \
+
+RUN gem update --system --no-document && \
     gem install -N bundler -v ${BUNDLER_VERSION}
 
 #######################################################################
@@ -79,6 +78,9 @@ RUN bundle install && rm -rf vendor/bundle/ruby/*/cache
 
 FROM build_deps as node_modules
 
+RUN curl https://get.volta.sh | bash
+RUN volta install node@${NODE_VERSION} yarn@${YARN_VERSION}
+
 COPY package*json ./
 COPY yarn.* ./
 RUN yarn install
@@ -101,10 +103,11 @@ RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \
 
 # 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/lib/ruby/gems /usr/local/lib/ruby/gems
 COPY --from=gems /usr/local/bundle /usr/local/bundle
 
 # copy installed node modules
+COPY --from=node_modules $VOLTA_HOME $VOLTA_HOME
 COPY --from=node_modules /app/node_modules /app/node_modules
 
 #######################################################################

Related reading: Preparations for Rails 7.1 ; the TL;DR version is that Rails 7.1 will also be producing Dockerfiles that can be used, Iā€™m working with DHH to ensure that they are suitable; and Iā€™m also working on a gem which can be used to regenerate the Dockerfiles on demand as your app changes.

Separately, I have started a draft of documentation introducing Dockerfiles to Rails developers. What you will find is that Dockerfiles are easy, but what you are doing is scripting what is likely an unfamiliar operating system, typically Debian, and that is where the learning curve.

Oh, and as to volta, you may be familiar with Ruby version managers like rvm or rbenv. Volta is that, but for node.js. It can be used to install the exact version of node and yarn that you use for development.

1 Like

I should have waited for 7.1, but who knew? The gem to keep the Dockerfile up to date will be helpful.

The discussion about 7.1 is beyond me. Glad you and DHH are on it.

@rubys That got me further. Ran into a couple of issues. One was migrations which I fixed.

But final message:

`v5 failed - Failed due to unhealthy allocations - not rolling back to stable job version 5 as current job has same specification and deploying as v6

--> Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/`

The wrt allocations the guide mentions fastily which Iā€™ve never heard of nor do I know where to put the recommended fix.

Hereā€™s the comment console output repeated after setting config.active_record.legacy_connection_handling = false:

āžœ fly deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-solitary-wave-4007 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 56.3s (0/1)
[+] Building 45.1s (28/28) FINISHED
 => [internal] load remote build context                                                                                                                               0.0s
 => copy /context /                                                                                                                                                    2.4s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                                                  0.3s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5                             0.0s
 => [internal] load metadata for docker.io/library/ruby:3.2.0-slim                                                                                                     0.1s
 => [base 1/5] FROM docker.io/library/ruby:3.2.0-slim@sha256:8f243a374ec6820be6d883b8151452fe0a7f91d94e44e03a8270c9050a86f21e                                          0.0s
 => CACHED [base 2/5] RUN mkdir /app                                                                                                                                   0.0s
 => CACHED [base 3/5] WORKDIR /app                                                                                                                                     0.0s
 => CACHED [base 4/5] RUN mkdir -p tmp/pids                                                                                                                            0.0s
 => CACHED [base 5/5] RUN gem update --system --no-document &&     gem install -N bundler -v 2.3.25                                                                    0.0s
 => CACHED [stage-4 1/9] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt     --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/  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,sharing=locked,target=  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/9] COPY --from=gems /app /app                                                                                                                    0.0s
 => CACHED [stage-4 3/9] COPY --from=gems /usr/local/lib/ruby/gems /usr/local/lib/ruby/gems                                                                            0.0s
 => CACHED [stage-4 4/9] COPY --from=gems /usr/local/bundle /usr/local/bundle                                                                                          0.0s
 => CACHED [node_modules 1/5] RUN curl https://get.volta.sh | bash                                                                                                     0.0s
 => CACHED [node_modules 2/5] RUN volta install node@18.12.1 yarn@1.22.19                                                                                              0.0s
 => CACHED [node_modules 3/5] COPY package*json ./                                                                                                                     0.0s
 => CACHED [node_modules 4/5] COPY yarn.* ./                                                                                                                           0.0s
 => CACHED [node_modules 5/5] RUN yarn install                                                                                                                         0.0s
 => CACHED [stage-4 5/9] COPY --from=node_modules /root/.volta /root/.volta                                                                                            0.0s
 => CACHED [stage-4 6/9] COPY --from=node_modules /app/node_modules /app/node_modules                                                                                  0.0s
 => [stage-4 7/9] COPY . .                                                                                                                                             0.9s
 => [stage-4 8/9] RUN chmod +x /app/bin/* &&     sed -i 's/ruby.exe\r*/ruby/' /app/bin/* &&     sed -i 's/ruby\r*/ruby/' /app/bin/* &&     sed -i '/^#!/aDir.chdir Fi  0.5s
 => [stage-4 9/9] RUN bin/rails fly:build                                                                                                                             35.5s
 => exporting to image                                                                                                                                                 3.3s
 => => exporting layers                                                                                                                                                3.2s
 => => writing image sha256:978d330c73899e426be7fca9449813e46f6bb5efb63f0561f7e01118f3189af0                                                                           0.0s
 => => naming to registry.fly.io/croatian-restaurants-la:deployment-01GNDN96GT850J4KAF6G8C4KJZ                                                                         0.0s
--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/croatian-restaurants-la]
dc6ec8a7f994: Pushed
214ba0ae334a: Pushed
802d454f59d0: Pushed
faa819e3b06d: Layer already exists
8113271d7d52: Layer already exists
2d8daf5b884e: Layer already exists
808714c73b85: Layer already exists
396b56734d6b: Layer already exists
a75278884dcd: Layer already exists
f0df26300d59: Layer already exists
eb413a3aeb91: Layer already exists
5f70bf18a086: Layer already exists
e5bd71cf4df2: Layer already exists
2abf105e6fbe: Layer already exists
4b245fbb5fdf: Layer already exists
279ae5329363: Layer already exists
e393900df832: Layer already exists
8a70d251b653: Layer already exists
deployment-01GNDN96GT850J4KAF6G8C4KJZ: digest: sha256:23286d2e2e4e9db2c9115750cedf85e7c6ac56c1b6b36b03c2e96ca0b3d3879d size: 4102
--> Pushing image done
image: registry.fly.io/croatian-restaurants-la:deployment-01GNDN96GT850J4KAF6G8C4KJZ
image size: 1.1 GB
==> Creating release
--> release v5 created

--> You can detach the terminal anytime without stopping the deployment
==> Release command detected: bin/rails fly:release

--> This release will not be available until the release command succeeds.
	 Starting instance
	 Configuring virtual machine
	 Pulling container image
	 Unpacking image
	 Preparing kernel init
	 Configuring firecracker
	 Starting virtual machine
	 Starting init (commit: f447594)...
	 Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
	 no label, UUID=f537845e-e2cf-4a02-95e7-9f442bc14485
	 Preparing to run: `bin/rails fly:release` as root
	 2022/12/29 00:45:18 listening on [fdaa:0:8ac5:a7b:bf88:799e:d345:2]:22 (DNS: [fdaa::3]:53)
	 Starting clean up.
	 Starting instance
	 Configuring virtual machine
	 Pulling container image
	 Unpacking image
	 Preparing kernel init
	 Configuring firecracker
	 Starting virtual machine
	 Starting init (commit: f447594)...
	 Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
	 no label, UUID=f537845e-e2cf-4a02-95e7-9f442bc14485
	 Preparing to run: `bin/rails fly:release` as root
	 2022/12/29 00:45:18 listening on [fdaa:0:8ac5:a7b:bf88:799e:d345:2]:22 (DNS: [fdaa::3]:53)
	 Starting clean up.
==> Monitoring deployment
Logs: https://fly.io/apps/croatian-restaurants-la/monitoring

 1 desired, 1 placed, 0 healthy, 1 unhealthy [restarts: 2] [health checks: 1 total, 1 critical]
Failed Instances

Failure #1

Instance
ID      	PROCESS	VERSION	REGION	DESIRED	STATUS 	HEALTH CHECKS      	RESTARTS	CREATED
153bbe38	app    	5      	lax   	run    	running	1 total, 1 critical	2       	25s ago

Recent Events
TIMESTAMP           	TYPE      	MESSAGE
2022-12-29T00:45:26Z	Received  	Task received by client
2022-12-29T00:45:26Z	Task Setup	Building Task Directory
2022-12-29T00:45:29Z	Started   	Task started by client
2022-12-29T00:45:35Z	Terminated	Exit Code: 1
2022-12-29T00:45:35Z	Restarting	Task restarting in 1.0603274s
2022-12-29T00:45:43Z	Started   	Task started by client
2022-12-29T00:45:49Z	Terminated	Exit Code: 1
2022-12-29T00:45:49Z	Restarting	Task restarting in 1.200745549s
2022-12-29T00:45:56Z	Started   	Task started by client

2022-12-29T00:45:59Z   [info]rails aborted!
2022-12-29T00:45:59Z   [info]Command failed with status (1): [bin/rails server...]
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/file_utils.rb:67:in `block in create_shell_runner'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/file_utils.rb:57:in `sh'
2022-12-29T00:45:59Z   [info]/app/lib/tasks/fly.rake:21:in `block (2 levels) in <main>'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-29T00:45:59Z   [info]/app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
2022-12-29T00:45:59Z   [info]Tasks: TOP => fly:server
2022-12-29T00:45:59Z   [info](See full trace by running task with --trace)
2022-12-29T00:46:00Z   [info]Starting clean up.
--> v5 failed - Failed due to unhealthy allocations - not rolling back to stable job version 5 as current job has same specification and deploying as v6

--> Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/
Error abort

Do flyctl logs show anything worth mentioning? The same information can be retrieved at https://fly.io/apps/croatian-restaurants-la/monitoring.

Hopefully they show more as all the output above says is that the server exited.

If, for example, you create a new rails application in a separate directory, run fly launch there and then replace the Dockerfile with the one from your application, you should see logs like the following:

2022-12-29T01:46:30Z runner[47fcbe1f] iad [info]Starting instance
2022-12-29T01:46:38Z runner[47fcbe1f] iad [info]Configuring virtual machine
2022-12-29T01:46:38Z runner[47fcbe1f] iad [info]Pulling container image
2022-12-29T01:46:38Z runner[47fcbe1f] iad [info]Unpacking image
2022-12-29T01:46:38Z runner[47fcbe1f] iad [info]Preparing kernel init
2022-12-29T01:46:39Z runner[47fcbe1f] iad [info]Configuring firecracker
2022-12-29T01:46:39Z runner[47fcbe1f] iad [info]Starting virtual machine
2022-12-29T01:46:40Z app[47fcbe1f] iad [info]Starting init (commit: f447594)...
2022-12-29T01:46:40Z app[47fcbe1f] iad [info]Preparing to run: `/bin/sh -c ${SERVER_COMMAND}` as root
2022-12-29T01:46:40Z app[47fcbe1f] iad [info]2022/12/29 01:46:40 listening on [fdaa:0:d445:a7b:93:47fc:be1f:2]:22 (DNS: [fdaa::3]:53)
2022-12-29T01:46:42Z app[47fcbe1f] iad [info]fallocate -l 512M /swapfile
2022-12-29T01:46:42Z app[47fcbe1f] iad [info]chmod 0600 /swapfile
2022-12-29T01:46:42Z app[47fcbe1f] iad [info]mkswap /swapfile
2022-12-29T01:46:42Z app[47fcbe1f] iad [info]Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2022-12-29T01:46:42Z app[47fcbe1f] iad [info]no label, UUID=ece5df2e-8a9f-4cd7-8dbb-639bac06f53f
2022-12-29T01:46:42Z app[47fcbe1f] iad [info]echo 10 > /proc/sys/vm/swappiness
2022-12-29T01:46:42Z app[47fcbe1f] iad [info]swapon /swapfile
2022-12-29T01:46:42Z app[47fcbe1f] iad [info]bin/rails server
2022-12-29T01:46:43Z app[47fcbe1f] iad [info]=> Booting Puma
2022-12-29T01:46:43Z app[47fcbe1f] iad [info]=> Rails 7.0.4 application starting in production
2022-12-29T01:46:43Z app[47fcbe1f] iad [info]=> Run `bin/rails server --help` for more startup options
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]W, [2022-12-29T01:46:44.403551 #532]  WARN -- : You are running SQLite in production, this is generally not recommended. You can disable this warning by setting "config.active_record.sqlite3_production_warning=false".
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]Puma starting in single mode...
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]* Puma version: 5.6.5 (ruby 3.2.0-p0) ("Birdie's Version")
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]*  Min threads: 5
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]*  Max threads: 5
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]*  Environment: production
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]*          PID: 532
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]* Listening on http://0.0.0.0:8080
2022-12-29T01:46:45Z app[47fcbe1f] iad [info]Use Ctrl-C to stop

Nothing that I can see. Was initially one warning about a model problem which I got rid of.

$ fly logs -a croatian-restaurants-la
Waiting for logs...
[stripped date time and app[e73d0137] lax [info]  from below]
from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:923:in `each'
from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:923:in `block in define_callbacks'
from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:920:in `each'
from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:920:in `define_callbacks'
from /app/vendor/bundle/ruby/3.2.0/gems/activemodel-7.0.4/lib/active_model/validations.rb:50:in `block in <module:Validations>'
from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4/lib/active_support/concern.rb:136:in `class_eval'
from /app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.4/lib/active_support/concern.rb:136:in `append_features'
from /app/app/models/concerns/my_document_validator.rb:1:in `include'
from /app/app/models/concerns/my_document_validator.rb:1:in `<main>'
from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:30:in `require'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `const_get'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:135:in `cget'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:169:in `block in actual_eager_load_dir'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:40:in `block in ls'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `each'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/helpers.rb:25:in `ls'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:164:in `actual_eager_load_dir'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:17:in `block (2 levels) in eager_load'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `each'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:16:in `block in eager_load'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `synchronize'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader/eager_load.rb:10:in `eager_load'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:296:in `block in eager_load_all'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `each'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/loader.rb:294:in `eager_load_all'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `instance_exec'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/initializable.rb:32:in `run'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/initializable.rb:61:in `block in run_initializers'
from /usr/local/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
from /usr/local/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /usr/local/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each'
from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `call'
from /usr/local/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
from /usr/local/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
from /usr/local/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/initializable.rb:60:in `run_initializers'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/application.rb:372:in `initialize!'
from /app/config/environment.rb:5:in `<main>'
from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /app/vendor/bundle/ruby/3.2.0/gems/zeitwerk-2.6.6/lib/zeitwerk/kernel.rb:38:in `require'
from config.ru:3:in `block in <main>'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `eval'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/builder.rb:116:in `new_from_string'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/builder.rb:105:in `load_file'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/builder.rb:66:in `parse_file'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/server.rb:349:in `build_app_and_options_from_config'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/server.rb:249:in `app'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/server.rb:422:in `wrapped_app'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/server.rb:312:in `block in start'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/server.rb:379:in `handle_profiling'
from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.4/lib/rack/server.rb:311:in `start'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:38:in `start'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
from <internal:kernel>:90:in `tap'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/server/server_command.rb:134:in `perform'
from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
from /app/vendor/bundle/ruby/3.2.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:in `perform'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/command.rb:48:in `invoke'
from /app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from /app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
from bin/rails:5:in `<main>'
rails aborted!
Command failed with status (1): [bin/rails server...]
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/file_utils.rb:67:in `block in create_shell_runner'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/file_utils.rb:57:in `sh'
/app/lib/tasks/fly.rake:21:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/command.rb:51:in `invoke'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in `<main>'
/app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
/app/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.13.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Tasks: TOP => fly:server
(See full trace by running task with --trace)
Starting clean up.

Not clear what I learn from this. BTW I do have another app or two that did deploy.

Try running fly logs in one window and fly deploy in another. I suspect that what we really want to see is before that output starts. I donā€™t see the name of the exception, for example, and that often is a big clue.

The only thing I can glean from the above is that it has something to do with app/models/concerns/my_document_validator.rb, which apparently has an include statement on line 1?

When we started, you couldnā€™t deploy any apps with Ruby 3.2. Now you can, and that means we can rule out a large class of potential causes for this error. We just need to identify why this app is different.

@rubys You found it. Fully deployed.

Now just have to fix all the problems with going to Rails 7 and changing the asset pipeline. Some comments in the log about this which may help debugging that.

I donā€™t think Iā€™m using app/models/concerns/my_document_validator.rb but was trying it out for a validation. But there was an error. But I donā€™t see what is unusual about the log for this file.

Thank you. And Happy New Year