# Error on deploying Phoenix app

**URL:** <https://community.fly.io/t/error-on-deploying-phoenix-app/6034>\
**Category:** Build debugging\
**Tags:** elixir\
**Created:** [July 18, 2022, 1:36pm UTC](https://community.fly.io/t/error-on-deploying-phoenix-app/6034 "2022-07-18T13:36:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoedsoupe](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/zoedsoupe/32/15824_2.png) [@zoedsoupe](https://community.fly.io/u/zoedsoupe)\
**Post date:** [July 18, 2022, 1:36pm UTC](https://community.fly.io/t/error-on-deploying-phoenix-app/6034/1 "2022-07-18T13:36:34Z")

</div>

Last week I started this discussion: [Can't connect to internal postgres](https://community.fly.io/t/cant-connect-to-internal-postgres/6011), which was solved, however, I’m still having some issues with deploy.

This is my `fly.toml`:

```auto
app = "fuschia"

kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[env]

[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 = "30s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

```

Increasing my `grae_period` let my app to be started, although the issue is the same:

```auto
2022-07-18T13:10:44.736 runner[0d9731af] gru [info] Starting instance

2022-07-18T13:10:44.946 runner[0d9731af] gru [info] Configuring virtual machine

2022-07-18T13:10:44.948 runner[0d9731af] gru [info] Pulling container image

2022-07-18T13:10:50.848 runner[0d9731af] gru [info] Unpacking image

2022-07-18T13:10:51.583 runner[0d9731af] gru [info] Preparing kernel init

2022-07-18T13:10:53.429 runner[0d9731af] gru [info] Configuring firecracker

2022-07-18T13:10:53.566 runner[0d9731af] gru [info] Starting virtual machine

2022-07-18T13:10:53.730 app[0d9731af] gru [info] Starting init (commit: c86b3dc)...

2022-07-18T13:10:53.748 app[0d9731af] gru [info] Preparing to run: `sh start.sh` as nobody

2022-07-18T13:10:53.774 app[0d9731af] gru [info] 2022/07/18 13:10:53 listening on [fdaa:0:7774:a7b:1f60:d97:31af:2]:22 (DNS: [fdaa::3]:53)

2022-07-18T13:10:56.663 app[0d9731af] gru [info] 13:10:56.659 [info] Migrations already up

2022-07-18T13:10:56.761 app[0d9731af] gru [info] Reaped child process with pid: 565 and signal: SIGUSR1, core dumped? false

2022-07-18T13:10:56.762 app[0d9731af] gru [info] Reaped child process with pid: 568 and signal: SIGUSR1, core dumped? false

2022-07-18T13:10:56.763 app[0d9731af] gru [info] Reaped child process with pid: 601, exit code: 0

2022-07-18T13:10:59.616 app[0d9731af] gru [info] 13:10:59.616 [info] Running FuschiaWeb.Endpoint with cowboy 2.9.0 at :::4000 (http)

2022-07-18T13:10:59.618 app[0d9731af] gru [info] 13:10:59.618 [info] Access FuschiaWeb.Endpoint at http://fuschia.fly.dev:443

2022-07-18T13:10:59.767 app[0d9731af] gru [info] Reaped child process with pid: 622 and signal: SIGUSR1, core dumped? false

2022-07-18T13:11:05.249 app[0d9731af] gru [info] 13:11:05.248 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Wed, 16 Mar 2022 13:36:02 GMT.

2022-07-18T13:11:06.641 app[0d9731af] gru [info] 13:11:06.639 [info] Tzdata has updated the release from 2021e to 2022a

2022-07-18T13:15:57.793 runner[0d9731af] gru [info] Shutting down virtual machine

2022-07-18T13:15:58.182 app[0d9731af] gru [info] Sending signal SIGINT to main child process w/ PID 515

```

I also tried to generate the release locally and build the docker image and it worked.

I then searched about and found these discussions:

- [Error deploying Phoenix/Elixir app: "Reaped child process with pid"](https://community.fly.io/t/error-deploying-phoenix-elixir-app-reaped-child-process-with-pid/5060) (which was having memory issues)
- [Deploy Health Check fails for Elixir Phoenix app - #5 by kaygee](https://community.fly.io/t/deploy-health-check-fails-for-elixir-phoenix-app/2637/5) (endpoint configuration made for the wrong module)

But these don’t seem to be what I’m facing

---

<div class="post-metadata">

**Author:** ![lubien](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/lubien/32/41919_2.png) [@lubien](https://community.fly.io/u/lubien)\
**Post date:** [July 18, 2022, 1:40pm UTC](https://community.fly.io/t/error-on-deploying-phoenix-app/6034/2 "2022-07-18T13:40:47Z")

</div>

Hi @zoedsoupe ! Thanks for sharing logs and fly.toml, that’s very helpful

> [@zoedsoupe](#):
>
> `Running FuschiaWeb.Endpoint with cowboy 2.9.0 at :::4000 (http)`

I can see that your app listens to port 4000 however your fly.toml tells us it expects something listening to port 8080

```auto
[[services]]
  http_checks = []
  internal_port = 8080

```

Can you try to change either one? Maybe changing the fly.toml to 4000 is the easiest way.

If that doesn’t work, can you share your `config/runtime.exs` so we can take a look?

---

<div class="post-metadata">

**Author:** ![zoedsoupe](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/zoedsoupe/32/15824_2.png) [@zoedsoupe](https://community.fly.io/u/zoedsoupe)\
**Post date:** [July 18, 2022, 1:46pm UTC](https://community.fly.io/t/error-on-deploying-phoenix-app/6034/3 "2022-07-18T13:46:36Z")

</div>

Oh, well, that was fast and was a basic misconfiguration. As `fly.toml` was generated automatically I confess I didn’t inspect from that point of view. Thank you 😊
