beerlington
I upgraded to Elixir 1.15 and am having issues deploying on Heroku now. Whenever the app restarts, the whole application recompiles. On our large application, this recompile takes longer than 30 seconds, which causes the app to crash.
I’m able to reproduce this on a bare bones Phoenix app. The line where it says “Compiling 15 files” should not be happening during a restart.
2023-07-06T14:42:59.587968+00:00 heroku[web.1]: Restarting
2023-07-06T14:42:59.650735+00:00 heroku[web.1]: State changed from up to starting
2023-07-06T14:43:00.295043+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2023-07-06T14:43:00.322078+00:00 app[web.1]: 14:43:00.321 [notice] SIGTERM received - shutting down
2023-07-06T14:43:00.322086+00:00 app[web.1]:
2023-07-06T14:43:01.502645+00:00 heroku[web.1]: Process exited with status 0
2023-07-06T14:43:03.720077+00:00 heroku[web.1]: Starting process with command `mix phx.server`
2023-07-06T14:43:05.363804+00:00 app[web.1]: Compiling 15 files (.ex)
Where should I report this issue? I don’t know if it’s something specific to Elixir or if the Heroku buildpack we’re using needs to be updated to support Elixir 1.15. GitHub - HashNuke/heroku-buildpack-elixir: Heroku Buildpack for Elixir with nitro boost · GitHub
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 7 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
iamyojimbo
I have posted an update here: Additional recompile occurring on Heroku with Elixir 1.15 causing boot issues · Issue #12771 · elixir-lang/elixir · GitHub
Read there for more detail. The root cause is that elixir 1.15 introduced
cwdin the cache key after compilation. Heroku compiles code in a tmp build dir, but is run from /app.Fix it by using your exact same Procfile as before, but passing in
--no-compile, as detailed here: Changing absolute path of mix project causes full recompilation · Issue #13241 · elixir-lang/elixir · GitHubSo change your procfile to:
You do not need to use releases.
AlfredBaudisch
For those coming here with a setup similar to mine:
The solution to make it work with Heroku, as explained previously, is to migrate to use Releases, but then, Node and npm weren’t being run so statics assets were not being compiled (i.e. apps/xxx/assets).
In the end I made it work in Heroku by adding a Procfile manually, keeping the Elixir and Phoenix static assets buildpacks, adding an additional “elixir mix release” buildpack and setting Phoenix Endpoint as a server.
Configuration step by step:
Phoenix Endpoint
I had a lot of trouble making Phoenix start in Heroku when building the mix release. In the end, this is what I needed to put inside
config/runtime.exs. The secret lies in addingserver: true, otherwise the Elixir release won’t start Phoenix as a server and Heroku will timeout on startup.mix.exs release
In the main mix.exs file add all your umbrella apps in the
releasesconfig key:Heroku Buildpacks
You are going to need these 3 buildpacks installed in order:
Buildpack config
elixir_buildpack.config
phoenix_static_buildpack.config
Procfile
YOU need to manually create a Heroku Procfile for Umbrellas.
In our case it is:
beerlington
That’s perfect. Thanks for your help!
johantell
If you haven’t found it already: Deploying with Releases — Phoenix v1.8.8
johantell
Yes, running the migrations through mix will force recompilation. There is a way around it though, i think its described quite well under the phoenix release docs. In short its a helper function that is called via the release through the eval command
beerlington
Thanks for the suggestion. I was able to get our app running on Heroku with mix releases with minimal changes. One thing that seems a bit odd is that the app recompiles during Heroku’s release phase when we run migrations. It only does this in 1.15 and not 1.14, so it think there’s still something “off” here. The app at least starts up, but adds a few minutes to deploy time.
johantell
Have you considered deploying elixir through mix releases on heroku? That should prevent having to recompile and also bring some other benefits.
It might not answer your question but i can recommend looking i to it as this problem will reoccur even if you manage to solve it for now
. I would post links but I’m currently on my phone so i have limited resources. I will try to do so later