Error failed to fetch an image or build from source...Unknown desc = not found

First time attempt to migrate basic Rails app (with postgres) from Heroku. fly launch succeeded. fly deploy fails. Could I have help to resolve please. Thanks Daniel

=> ERROR [internal] load metadata for Quay 0.3s

[internal] load metadata for Quay

Error failed to fetch an image or build from source: error building: failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = Quay not found

Hey Simbed. Sharing fly.toml may help spot the problem.

At first I’d say the tag 3.0.1-jemalloc-bullseye-slim for repository doesn’t exist. I couldn’t find it at Quay

# fly.toml file generated for bridge-scores on 2022-11-23T16:37:28Z

app = "bridge-scores"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

    BUILD_COMMAND = "bin/rails fly:build"
    SERVER_COMMAND = "bin/rails fly:server"

  release_command = "bin/rails fly:release"

  PORT = "8080"

  allowed_public_ports = []
  auto_rollback = true

  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
    hard_limit = 25
    soft_limit = 20
    type = "connections"

    force_https = true
    handlers = ["http"]
    port = 80

    handlers = ["tls", "http"]
    port = 443

    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

  guest_path = "/app/public"
  url_prefix = "/"

A friendly suggestion, use “preformatted text” to share code snippets in the forum, it eases readers’ life. TIP: You can edit a posted message, no need to add another reply.

Were you able to check whether the Quay image exists?

Yes sorry, I would love to, but it wasn’t obvious to me how to format text in my original post. In this reply I now see the options to do so.

ag 3.0.1-jemalloc-bullseye-slim for repository `Quay

means mothing to me. It was autogenerated as part of the fly launch yet seems to cause the fly deploy to fail?

I will check with the team about the autogenerated part, for now, try changing that to 3.0.1-jemalloc-slim and deploy

After second thoughts, 3.1.2-jemalloc-bullseye-slim seems better.

Pick your poison from tags.

The ruby version needs to match the one specified in the following locations: “Gemfile.lock”, “Gemfile”, “.ruby_version”. See: flyctl/rails.go at ae87986faaed792d1ea6153529306a0b2972bc52 · superfly/flyctl · GitHub

This was a recent regression introduced in flyctl: Update base Rails image to point to Debian 11 (from Debian 10) · superfly/flyctl@c3b42b6 · GitHub . See the pull request for more background information: Update base Rails image to point to Debian 11 (from Debian 10) by bradgessler · Pull Request #1462 · superfly/flyctl · GitHub . I was the one to merge the pull request, but likely will be reverting it while looking for a better solution.

It looks like the latest debian image for each ruby version is as follows:


I produced the above list with the following code:

require 'net/https'
require 'json'
tags = []

debian_releases = %w(stretch buster bullseye bookworm) 
Net::HTTP.start('', 443, use_ssl: true) do |http|
  (1..).each do |page|
    request = "/api/v1/repository/{page}&limit=100"
    response = http.request request
    body = JSON.parse(response.body)
    tags += body['tags'].map {|tag| tag['name']}.grep /jemalloc-\w+-slim/
    break unless body['has_additional']
ruby_releases = tags.group_by {|tag| tag.split('-').first}.
  map do |release, tags|
    [release, tags.max_by {|tag| debian_releases.find_index(tag[/jemalloc-(\w+)-slim/, 1]) || -1}]
1 Like

TIL. thanks for pointing that Sam.

I think we can avoid the mapping by pointing to ${RUBY_VERSION}-jemalloc-slim and ignore the debian distro name and any custom mapping that needs future version to also match.

@rubys wdyt about Use -jemalloc-slim as ruby stack variant that always point to existen… by dangra · Pull Request #1487 · superfly/flyctl · GitHub ?

Thanks both. I changed the Docker file to

ARG VARIANT=jemalloc-buster-slim

and that got me past the error. The deploy then progressed pretty far but again failed, but I think for an unrelated issue so I’ll ask that question separately. Thanks for your help. Daniel

1 Like