Deploying takes so long time (almost 1 hour)

When I deploy my phoenix app with flyctl deploy, it takes almost 1 hour since the error a while back in fly.io.

--> Verified app config
==> Building image
Remote builder fly-builder-old-fog-1627 ready
==> Building image with Buildpacks
--> docker host: 20.10.12 linux x86_64
20: Pulling from heroku/buildpacks
Digest: sha256:b89b515316db1631d2927ada2ef5c8b4b9e6d7b807f1c4925f472720886342e9
Status: Image is up to date for heroku/buildpacks:20
20-cnb: Pulling from heroku/heroku
Digest: sha256:c9d053a463c7cd81672a3b0d5d5e26bdcbdffe2782565ccbedc15867b8cddfb9
Status: Image is up to date for heroku/heroku:20-cnb
Downloading from https://cnb-shim.herokuapp.com/v1/hashnuke/elixir
1.82 MB/-1 B

#############################
### takes so long time here
#############################

Warning: Platform requested deprecated API '0.6'
===> DETECTING
Warning: Buildpack 'hashnuke/elixir@0.1' requests deprecated API '0.4'
hashnuke/elixir 0.1
===> ANALYZING
Restoring metadata for "hashnuke/elixir:shim" from cache
===> RESTORING
Restoring data for "hashnuke/elixir:shim" from cache
...
### almost 1 hour
The last command took 3329.82 seconds.

Here’s the codebase.

Plz…

Hi @nallwhy! If its taking a long time at this specific point then those logs indicate its due to a really slow download from cnb-shim.herokuapp.com

Is this happening consistently on each deploy or was this potentially just a one-off issue?

I don’t think it’s a problem of cnb-shim.herokuapp.com, because those logs indicates downloading is finished. (1.82 MB is the size of the file)

Today, it tooks 30 min. not bad.

So I just searched on google for any possible issues with the Elixir buildpack and the first result that came back was an issue by @kurt himself (on our flyctl repo) from a couple of years ago…

It might be worth exploring using a Dockerfile for this rather than the buildpack to see if this is faster.

1 Like

Thanks!

I’ve change the build method to docker, and it’s super fast now.