Heroku Deployment Woes

In mix.exs:

def project do
      app: :my_app,
      version: "0.1.0",
      elixir: "~> 1.7",
      elixirc_paths: elixirc_paths(Mix.env()),
      compilers: [:phoenix, :gettext] ++ Mix.compilers(),
      start_permanent: Mix.env() == :prod,
      aliases: aliases(),
      deps: deps()

And in elixir_buildpack.config:


Hmmm, what buildpack are you using and how did you set it?

try and flip the always_rebuild=false to true - so you get a (re!)build with the changes made to elixir_buildpack…

=== floating-dawn-11111 Buildpack URLs
1. https://github.com/HashNuke/heroku-buildpack-elixir.git
2. https://github.com/gjaldon/heroku-buildpack-phoenix-static.git

Set both via the CLI and in the Pipeline interface on Heroku.

The really strange thing is that during the build it says Elixir 1.7.2, but when trying to run mix commands (or start the app) it won’t work with an error innate to Elixir 1.5 and specifies Elixir 1.5 when running the command I linked above.

you are checking the mix version heroku run "mix --version" try and check the elixir version heroku run "elixir --version"

does your app run correctly in dev with the same erlang/elixir version?
(eg try and bump elixir to 1.7.4… think there was some incompatibilities recently against specific early 1.7.x versions…)

(and make sure to have always_rebuild=true when debugging heroku builds…)

If mix --version differs from elixir --version something even worse is going wrong.

oh yeah, my bad(didn’t know mix follow elixir versioning… :man_facepalming:) but definitely use always_rebuild=true which should pick up the specified elixir version then…

Yes everything runs fine locally. Again, this is just the base phx.new app, I haven’t done anything other than things to try to get it working on Heroku.

The actual error seems to have something to do with Ecto.

(ArgumentError) supervisors expect the child to be a module, a {module, arg} tuple or a map with the child specification, got: {DBConnection.ConnectionPool, {Ecto.Repo.Supervisor, :start_child, [{DBConnection.ConnectionPool, :start_link, [{Postgrex.Protocol, [types: Postgrex.DefaultTypes, hostname: "localhost", port: 5432, repo: StarlinkConnector.Repo, telemetry_prefix: [:starlink_connector, :repo], otp_app: :starlink_connector, timeout: 15000, database: "starlink_connector_prod", pool_size: 15, pool: DBConnection.ConnectionPool]}]}, Ecto.Adapters.Postgres, #Reference<0.1314834767.3961389057.13396>, %{opts: [timeout: 15000, pool_size: 15, pool: DBConnection.ConnectionPool], sql: Ecto.Adapters.Postgres.Connection, telemetry: {StarlinkConnector.Repo, :debug, [], [:starlink_connector, :repo, :query]}}]}, :permanent, 5000, :worker, [DBConnection.ConnectionPool]}

did always_rebuild=true in the elixir_buildpack.config solve it? (and subsequently using elixir 1.7.4)
(remember to git commit the change…)

it’s a known bug when running against elixir 1.5 https://github.com/phoenixframework/phoenix/issues/3238

Made that change to no effect.

I’m deploying using pipelines which trigger on commits to master so it’s definitely in the repo.


hmm, when you check heroku run “mix --version” which heroku app are you checking against? (staging or prod?)

have you promoted the deploy… is the build stuck on CI - can you do a manual deploy(should be a button in the interface…) - can you turn off CI…

believe there is an issue with the CI/pipeline currently… see https://github.com/HashNuke/heroku-buildpack-elixir/issues/135

I’m not actually running any CI, just deploying. I could try taking it out of the pipeline, but I don’t know how that would fix the issue. Just seems like Heroku is running the app under the wrong elixir version.

Could you please tell more about your deplyoment process?

Is the application built and deployed into the exact same environment that is used to run it afterwards or do you have a multi stage setup where you push to staging and then heroku promotes the staging to the new production afterwards? If the latter, it might be that the promotion process is broken.

And the tip to turn of CI is, as far as I understand, only for the case that you use heroku CI to test your application before deploying it. If though you use travis or circle or some other service external to heroku, I do not think, it would make a difference.

1 Like

Yup, see here: Ecto migration fails on Heroku

We have also updated the buildpack to use v1.5.3 by default in master.

I just went through the Phoenix Heroku deployment tutorial today, and got Elixir 1.5.0 and this error.
The buildpack seems not to be updated to 1.5.3 after all?
It worked by adding the config file.

thanks for feedback…

looks like https://github.com/phoenixframework/phoenix/blob/master/guides/deployment/heroku.md needs to be “backported” to the 1.4 branch…

I’ve created an issue for backporting it… https://github.com/phoenixframework/phoenix/issues/3360

1 Like

Is there a reason the buildpack itself is not updated to a newer Elixir?

good question… Have made an issue here for a new buildpack release - current release is from 2015(sic!)…


The pull request https://github.com/HashNuke/heroku-buildpack-elixir/pull/140 to default to 1.5.3 was merged in but it wasn’t bundled in a release (https://github.com/HashNuke/heroku-buildpack-elixir/issues/145).

Although the changes are on master, it appears that the command now in the guide uses heroku create --buildpack hashnuke/elixir which seems to route to the latest release (without master changes). However, if you specify heroku create --buildpack https://github.com/HashNuke/heroku-buildpack-elixir.git it will pick up the changes.

1 Like