Question about weird deployment size on fly

I just deployed an simple elixir app. (no phoenix)
Just mix new --sup stuff

It calls telelgram api and uses ex_gram as dependency.

after fly launch, it uses heroku buildpack and later I get weird log message.

image: registry.fly.io/evenbot:deployment-1655462762
image size: 828 MB

_build folder on my machine is 5 MB. But in this image, it is 828 MB ?

It feels I have missed something. What could it be?


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

Failure #1

Instance
ID              PROCESS VERSION REGION  DESIRED STATUS  HEALTH CHECKS   RESTARTS        CREATED
c695904a                0       maa     run     running 1 total         2               1m10s ago

Recent Events
TIMESTAMP               TYPE            MESSAGE
2022-06-17T10:51:05Z    Received        Task received by client
2022-06-17T10:51:05Z    Task Setup      Building Task Directory
2022-06-17T10:51:34Z    Started         Task started by client
2022-06-17T10:51:42Z    Terminated      Exit Code: 0
2022-06-17T10:51:42Z    Restarting      Task restarting in 1.193302765s
2022-06-17T10:51:50Z    Started         Task started by client
2022-06-17T10:51:58Z    Terminated      Exit Code: 0
2022-06-17T10:51:58Z    Restarting      Task restarting in 1.038512743s
2022-06-17T10:52:05Z    Started         Task started by client




2022-06-17T10:52:11Z   [info]Interactive Elixir (1.13.4) - press Ctrl+C to exit (type h() ENTER for help)
2022-06-17T10:52:11Z   [info]10:52:11.825 [debug]
2022-06-17T10:52:11Z   [info]>>> REQUEST >>>
2022-06-17T10:52:11Z   [info](no query)
2022-06-17T10:52:11Z   [info]Content-Type: application/json
2022-06-17T10:52:11Z   [info]%{}
2022-06-17T10:52:11Z   [info]<<< RESPONSE <<<
2022-06-17T10:52:11Z   [info]server: nginx/1.18.0
2022-06-17T10:52:11Z   [info]date: Fri, 17 Jun 2022 10:52:11 GMT
2022-06-17T10:52:11Z   [info]content-type: application/json
2022-06-17T10:52:11Z   [info]content-length: 68
2022-06-17T10:52:11Z   [info]connection: keep-alive
2022-06-17T10:52:11Z   [info]strict-transport-security: max-age=31536000; includeSubDomains; preload
2022-06-17T10:52:11Z   [info]access-control-allow-origin: *
2022-06-17T10:52:11Z   [info]access-control-allow-methods: GET, POST, OPTIONS
2022-06-17T10:52:11Z   [info]access-control-expose-headers: Content-Length,Content-Type,Date,Server,Connection
2022-06-17T10:52:11Z   [info]%{description: "Webhook is already deleted", ok: true, result: true}
2022-06-17T10:52:11Z   [info]warning: variable "ans" is unused (if the variable is not meant to be used, prefix it with an underscore)
2022-06-17T10:52:11Z   [info]  .iex.exs:18: Testing.match_q_text/3
2022-06-17T10:52:11Z   [info]warning: variable "msgid" is unused (if the variable is not meant to be used, prefix it with an underscore)
2022-06-17T10:52:11Z   [info]  .iex.exs:18: Testing.match_q_text/3
2022-06-17T10:52:12Z   [info]Main child exited normally with code: 0
2022-06-17T10:52:12Z   [info]Reaped child process with pid: 557 and signal: SIGUSR1, core dumped? false
2022-06-17T10:52:12Z   [info]Starting clean up.
--> v0 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v1

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


the app crashed after starting.

Hey there! I’m sorry you’re running into some issues here, first off, that difference in size between what you’re seeing locally and in the logs is normal when using a buildpack. The buildpacks contain a lot of stuff that may not always be necessary for a lot of apps, but is useful to make just about any app work!

Secondly, can you try running LOG_LEVEL=debug fly deploy and share the output from that? That will just give us some more detailed logs so we an get more information on what’s going on here.

1 Like

output of LOG_LEVEL=debug fly deploy

Hey @zee , did you get a chance to look at the logs?

Hey, yes I did! Sorry for the delayed response. It looks like your app is is exiting with status code 0, usually this means it failed healthchecks (or didn’t pass them in time) I would recommend checking your grace_period in the healthcheck config.

I did increase grace period to “25s” , “git commit” fly.toml file and ran fly deploy

it got infinitely stuck at following step.

➜ fly deploy
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-falling-frost-8749 ready
==> Building image with Buildpacks
--> docker host: 20.10.12 linux x86_64
20: Pulling from heroku/buildpacks
Digest: sha256:0be6cf00687e3cca95da2cc1afe42bba5fc60453057b3b6c2c4cd6b72b7d2449
Status: Image is up to date for heroku/buildpacks:20
20-cnb: Pulling from heroku/heroku
Digest: sha256:5cfc72ccdb10b0c0e877f1baa5d336042a134a1f50ff2aec11a8644c464e5113
Status: Image is up to date for heroku/heroku:20-cnb
Downloading from https://cnb-shim.herokuapp.com/v1/hashnuke/elixir
1.81 MB/-1 B



Error failed to fetch an image or build from source: executing lifecycle: io: read/write on closed pipe

```

I am finally using Dockerfile - it is quick! (Kudos to fly)
and small size .

Finally, I don’t have to rely on buildpacks.
Thanks for your time. :slight_smile:

3 Likes