baroldgene

baroldgene

I’m attempting to deploy a bare-bones elixir app to Heroku. I keep getting the following error: `** (EXIT from pid<0.74.0>) an exception was raised:

    ** (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: 2, pool: DBConnection.ConnectionPool]}]}, Ecto.Adapters.Postgres, #Reference<0.115686411.3922591746.186642>, %{opts: [timeout: 15000, pool_size: 2, pool: DBConnection.ConnectionPool], sql: Ecto.Adapters.Postgres.Connection, telemetry: {StarlinkConnector.Repo, :debug, [], [:starlink_connector, :repo, :query]}}]}, :permanent, 5000, :worker, [DBConnection.ConnectionPool]}
        (elixir) lib/supervisor.ex:609: Supervisor.init_child/1
        (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
        (elixir) lib/supervisor.ex:581: Supervisor.init/2
        (stdlib) supervisor.erl:294: :supervisor.init/1
        (stdlib) gen_server.erl:365: :gen_server.init_it/2
        (stdlib) gen_server.erl:333: :gen_server.init_it/6
        (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3`

I’ve added the build packs for both Elixir and Phoenix and specified my elixir version to be 1.7.x in both the mix.exs file and the elixir_buildpack.config. When I run heroku run "mix --version" though I get the following:

Running mix --version on ⬢ xxxxxxxxxxxx... up, run.8452 (Free)
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

Mix 1.5.0

From googling I feel like Elixir 1.5 won’t actually work for what I’m doing but it seems Heroku is intent on using that for the project?

First 10 of 21 Posts Switch mode

NobbZ

NobbZ

Please tell us exactly how you specified the version.

baroldgene

baroldgene OP

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()
    ]
  end

And in elixir_buildpack.config:

always_rebuild=false
erlang_version=20.1
elixir_version=1.7.2
runtime_path=/app
axelson

axelson

Scenic Core Team

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

outlog

outlog

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

baroldgene

baroldgene OP

=== 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.

baroldgene

baroldgene OP

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.

outlog

outlog

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..)

NobbZ

NobbZ

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

outlog

outlog

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..

baroldgene

baroldgene OP

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]}

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement