Existing Ruby app update, deploy error

I have a running app on Fly that I don’t update very often. Tonight I went to run a fly deploy and I’m getting the following

==> Verifying app config
Validating /path/toml.toml
✓ Configuration is valid
--> Verified app config
==> Building image
Remote builder fly-builder-quiet-violet-8462 ready
==> Building image with Buildpacks
--> docker host: 24.0.7 linux x86_64
base: Pulling from paketobuildpacks/builder
Digest: sha256:17ea21162ba8c7717d3ead3ee3836a368aced7f02f2e59658e52029bd6d149e7
Status: Image is up to date for paketobuildpacks/builder:base
==> Building image
✓ compatible remote builder found
INFO Override builder host with: https://fly-builder-quiet-violet-8462.fly.dev (was tcp://[fdaa:1:1cc0:a7b:409:dc20:a112:2]:2375)

Remote builder fly-builder-quiet-violet-8462 ready
==> Building image with Buildpacks
--> docker host: 24.0.7 linux x86_64
base: Pulling from paketobuildpacks/builder
Digest: sha256:17ea21162ba8c7717d3ead3ee3836a368aced7f02f2e59658e52029bd6d149e7
Status: Image is up to date for paketobuildpacks/builder:base
base-cnb: Pulling from paketobuildpacks/run
Digest: sha256:1af9935d8987fd52b2266d288200c9482d1dd5529860bbf5bc2d248de1cb1a38
Status: Image is up to date for paketobuildpacks/run:base-cnb
Error: failed to fetch an image or build from source: downloading buildpack: extracting from registry gcr.io/paketo-buildpacks/ruby: fetching image: Error response from daemon: Head "https://gcr.io/v2/paketo-buildpacks/ruby/manifests/latest": denied: Caller does not have permission or the resource may not exist 'read'. To configure permissions, follow instructions at: https://cloud.google.com/container-registry/docs/access-control

Here’s the TOML file, which hasn’t been changed since the initial deploy.

app = 'app'
kill_signal = 'SIGINT'
kill_timeout = '5s'

[build]
  builder = 'paketobuildpacks/builder:base'
  buildpacks = ['gcr.io/paketo-buildpacks/ruby']

[[services]]
  protocol = 'tcp'
  internal_port = 9292

  [[services.ports]]
    port = 80
    handlers = ['http']

  [[services.ports]]
    port = 443
    handlers = ['tls', 'http']

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20

  [[services.tcp_checks]]
    interval = '10s'
    timeout = '2s'

It seems to me the paketo ruby pack might be out of date or has some issue - no new commits or activity in the repo for over a year now but I’ve tried creating an issue there as well just in case. Persmission issues and GCR · Issue #1211 · paketo-buildpacks/ruby · GitHub

This looks like it would fail to build locally as well. What do you get if you build using Docker locally?

I’m not sure I know how to build it locally. This is a simple sinatra app for a local business and its the only thing I have deployed to Fly.io. Regardless I was able to fix the issue by creating a new app from the same git repo and then overwriting my TOML file with what was generated for the new app, which is completely different. Would be good if whatever is “verifying” the TOML files would tell you they’re out of date. Here’s the freshly generated TOML contents

app = 'app'
primary_region = 'iad'

[build]

[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = 'stop'
  auto_start_machines = true
  min_machines_running = 0
  processes = ['app']

[[vm]]
  memory = '1gb'
  cpu_kind = 'shared'
  cpus = 1

It also generated a new Dockerfile which was completely different (I’m not sure if the old Dockerfile was being used, I don’t remember looking at it previously)

ARG RUBY_VERSION=3.2.4
FROM ruby:$RUBY_VERSION-slim as base

# Rack app lives here
WORKDIR /app

# Update gems and bundler
RUN gem update --system --no-document && \
    gem install -N bundler


# Throw-away build stage to reduce size of final image
FROM base as build

# Install packages needed to build gems
RUN apt-get update -qq && \
    apt-get install --no-install-recommends -y build-essential

# Install application gems
COPY Gemfile* .
RUN bundle install


# Final stage for app image
FROM base

# Run and own the application files as a non-root user for security
RUN useradd ruby --home /app --shell /bin/bash
USER ruby:ruby

# Copy built artifacts: gems, application
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY --from=build --chown=ruby:ruby /app /app

# Copy application code
COPY --chown=ruby:ruby . .

# Start the server
EXPOSE 8080
CMD ["bundle", "exec", "rackup", "--host", "0.0.0.0", "--port", "8080"]

Likely just cd /my/project/dir then docker build -t image-name .. Of course, Docker needs to be installed and available at the command line.