IEx freezes on Heroku

I’ve got an Elixir application running in Heroku that will no longer successfully run an IEx shell (e.g., heroku run -a myapp iex -S mix). It basically refuses to accept any input. We’re currently running on Elixir 1.8.2, but I believe that IEx stopped working sometime around 1.7. I’m not really sure what it is (we have a number of dependencies, but none of these would seem to be the problem). It doesn’t matter whether I am doing iex -S mix from heroku run directly or inside of a heroku run bash command.

Has anyone had anything similar and know of any solutions that don’t involve leaving Heroku?

what heroku “stack” are you on? ie. heroku-16 ?

Yes, heroku-16.

Hmm, I’d expect heroku run iex -S mix to work just fine (and it works fine for me). Perhaps you have something odd in a .iex.exs file? Or maybe it’s some configuration that’s different between development and production?

I think that’s it. It turns out that, on Heroku, import_file_if_available "~/.iex.exs" results in an infinite loop, and as it’s a compile-time macro, I don’t think that there’s a way to prevent it from bodging up Heroku if you want to take advantage of an optional user-level .iex.exs. Thanks!

I have .iex.exs that goes up with no issue…

anything exotic in yours? mine is basically:

import Ecto.Query
import Ecto.Changeset
alias Phoenix.Presence

alias MyApp.{
  Repo,
  User,
  Booking,
  BookingGuest,
  Event,
  Meeting,
etc..
}

this is my (current) cmd that works: heroku run POOL_SIZE=2 iex -S mix -a myherokuapp

try with POOL_SIZE maybe…

It’s pretty much that simple, with the exception of import_file_if_available "~/.iex.exs". As soon as I remove that, I (eventually) get the interactive prompt. Before I remove that, I never get the interactive prompt.

I’ve filed an issue with Elixir: https://github.com/elixir-lang/elixir/issues/9363

1 Like