# Unable to deploy non-Phoenix Elixir app

**URL:** <https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164>\
**Category:** Questions / Help\
**Tags:** elixir\
**Created:** [August 11, 2021, 1:11pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164 "2021-08-11T13:11:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![agramichael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/agramichael/32/1028_2.png) [@agramichael](https://community.fly.io/u/agramichael)\
**Post date:** [August 11, 2021, 1:11pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/1 "2021-08-11T13:11:25Z")

</div>

Tried following the recommendation I found here: [Is it OK to run non HTTP apps in Fly?](https://community.fly.io/t/is-it-ok-to-run-non-http-apps-in-fly/157)

Removing the `[[services]]` section of my `fly.toml` didn’t do the trick, the deploy still gets stuck during my release command which is a `app/bin/app_name start` (mix release). I assume this is because the health checks fail.

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![denvaar](https://avatars.discourse-cdn.com/v4/letter/d/2acd7d/32.png) [@denvaar](https://community.fly.io/u/denvaar)\
**Post date:** [August 11, 2021, 1:16pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/2 "2021-08-11T13:16:41Z")

</div>

I recently did this, what does your fly.toml config look like?

---

<div class="post-metadata">

**Author:** ![agramichael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/agramichael/32/1028_2.png) [@agramichael](https://community.fly.io/u/agramichael)\
**Post date:** [August 11, 2021, 1:18pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/3 "2021-08-11T13:18:32Z")

</div>

After removing the [[services]] section:

```auto
app = "app_name"

kill_signal = "SIGTERM"
kill_timeout = 5

[env]

[deploy]
  release_command = "/app/bin/app_name start"

```

---

<div class="post-metadata">

**Author:** ![jerome](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jerome/32/17_2.png) [@jerome](https://community.fly.io/u/jerome)\
**Post date:** [August 11, 2021, 1:21pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/4 "2021-08-11T13:21:52Z")

</div>

Anything useful in the logs for your app (`flyctl logs -a app_name`)?

---

<div class="post-metadata">

**Author:** ![agramichael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/agramichael/32/1028_2.png) [@agramichael](https://community.fly.io/u/agramichael)\
**Post date:** [August 11, 2021, 1:25pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/5 "2021-08-11T13:25:21Z")

</div>

Just standard logs for the apps in the umbrella starting up. Last line:

`13:03:44.591 [info] Application processor started on node 'dharma-qa@fdaa:0:30cf:a7b:ab8:9c46:e5cc:2'`

---

<div class="post-metadata">

**Author:** ![jerome](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jerome/32/17_2.png) [@jerome](https://community.fly.io/u/jerome)\
**Post date:** [August 11, 2021, 1:43pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/6 "2021-08-11T13:43:54Z")

</div>

There should be logs for your release command failure during deploy.

Looking at our internal logs infra, for a previously failed release, I see a log near the end like:

```auto
Crash dump is being written to: erl_crash.dump...done

```

For the latest release (I think), it looks like it’s never ending. Spamming logs like:

```auto
13:42:58.299 [error] Error in fetch_changes with the
             following reason: connection refused

```

---

<div class="post-metadata">

**Author:** ![agramichael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/agramichael/32/1028_2.png) [@agramichael](https://community.fly.io/u/agramichael)\
**Post date:** [August 11, 2021, 1:46pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/7 "2021-08-11T13:46:34Z")

</div>

Yeah it does look like there were some errors but only quite some time after the deploy.  
What is considered a successful release command with a non-Phoenix app? There are no health checks to a port, so surely it should just be the apps starting up?

---

<div class="post-metadata">

**Author:** ![jerome](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jerome/32/17_2.png) [@jerome](https://community.fly.io/u/jerome)\
**Post date:** [August 11, 2021, 1:50pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/8 "2021-08-11T13:50:19Z")

</div>

Oh sorry, I just looked at your `fly.toml` and I don’t think it’s doing what you think it should 🙂

`deploy.release_command` is a command that runs _before_ actually deploying your new app version. These are meant to be short-lived. Usually migrations.

I assume you explicitly set a command there because your Dockerfile has a different one?

You can do:

```auto
[experimental]
cmd = ["/app/bin/app_name", "start"]

```

---

<div class="post-metadata">

**Author:** ![agramichael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/agramichael/32/1028_2.png) [@agramichael](https://community.fly.io/u/agramichael)\
**Post date:** [August 11, 2021, 1:52pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/9 "2021-08-11T13:52:05Z")

</div>

Ohhh okay that makes more sense!  
So the `deploy.release_command` is for release tasks.  
If I already have the command I want being set in my Dockerfile I don’t need to set anything?  
And if I don’t have the command set in the Dockerfile I can then use the `experimental.cmd`?

---

<div class="post-metadata">

**Author:** ![jerome](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/jerome/32/17_2.png) [@jerome](https://community.fly.io/u/jerome)\
**Post date:** [August 11, 2021, 1:53pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/10 "2021-08-11T13:53:35Z")

</div>

If you have the right CMD already in your Dockerfile, you don’t have to set anything.

If not, you do need the `experimental.cmd` to override whatever if set (if any) as the CMD in your Dockerfile.

---

<div class="post-metadata">

**Author:** ![agramichael](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/agramichael/32/1028_2.png) [@agramichael](https://community.fly.io/u/agramichael)\
**Post date:** [August 11, 2021, 1:54pm UTC](https://community.fly.io/t/unable-to-deploy-non-phoenix-elixir-app/2164/11 "2021-08-11T13:54:07Z")

</div>

Makes sense. Thank you!
