Failed to initialize analyzer on fly deploy with heroku/builder

I have a simple Sinatra app that I’ve been deploying with without issue for a long time. Today when I ran fly deploy I get the following error:

24: Pulling from heroku/builder
Digest: sha256:f9b9b5c586fc9e48671a72df13cf913576c08ed912e610e3ceae96a42aeb97d0
Status: Image is up to date for heroku/builder:24
24: Pulling from heroku/heroku
Digest: sha256:4f63a0b095cb839446e11dc7632c4dc3bb8b2ccbda7b1d02b23b166b7ff1f3fa
Status: Image is up to date for heroku/heroku:24
===> ANALYZING
ERROR: failed to initialize analyzer: getting previous image: Error response from daemon: client version 1.52 is too new. Maximum supported API version is 1.43
Error: failed to fetch an image or build from source: executing lifecycle: failed with status code: 1

I’ve tried fly deploy –no-cache fly deploy –local-only. Still the same issue. Any ideas what might be happening here?

Thanks.

Hi… It generally helps to post your full fly.toml and (if you have one) full Dockerfile.

Buildpacks (if that is what this is) are more or less deprecated these days, so it would be best to try to get things working with a Dockerfile instead (in that case)…

Here’s My fly.toml file. No Dockerfile.

# fly.toml file generated for [app-name] on 2022-09-14T21:50:36-05:00

app = "[app-name]"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  builder = "heroku/builder:24"

[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"

Thanks… Following the logic of that older thread, I would try a Dockerfile at this point. I don’t use Sinatra myself, but this one from a couple years ago might be a useful starting point:

https://community.fly.io/t/issue-deploying-new-sinatra-app/11355/2

(You will probably need to change RUBY_VERSION, as it says at the end there.)

Alright. I switched to a Dockerfile and the deploy seemed fine. Odd that this just started happening (last time I deployed was last week).

Thanks for your help.

2 Likes

I do think Dockerfiles are the way to go on Fly. From what I can tell, the system that kicks in is pretty clever: it applies all sorts of heuristics to essentially build a Dockerfile for you, based on the contents of your project. I think this is how the GitHub Fly Deploy works too.

However, when the heuristics are upgraded, there’s a chance it works for someone where it previously failed, and it breaks for someone where it previously worked. Locking it down is the right way to go.