HashNuke / heroku-buildpack-elixir

Heroku Buildpack for Elixir with nitro boost
MIT License
810 stars 304 forks source link

Cache isn't cleared on stack change which results in shared library errors #197

Closed edmorley closed 3 years ago

edmorley commented 3 years ago

An app using the heroku-16 stack was upgraded to heroku-20, and the first build failed with:

-----> Building on the Heroku-20 stack
-----> Using buildpacks:
       1. https://github.com/HashNuke/heroku-buildpack-elixir.git
...
-----> Elixir app detected
...
-----> Checking Erlang and Elixir versions
       Will use the following versions:
       * Stack heroku-20
       * Erlang 20.2.3
       * Elixir v1.8.0 
-----> Stack changed, will rebuild
-----> Using cached Erlang 20.2.3
-----> Installing Erlang 20.2.3 
-----> Fetching Elixir v1.8.0 for OTP 20 from https://repo.hex.pm/builds/elixir/v1.8.0-otp-20.zip
-----> Installing Elixir v1.8.0 (changed)
-----> Installing Hex
/app/.platform_tools/erlang/erts-9.2.1/bin/beam.smp: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
-----> Installing rebar
/app/.platform_tools/erlang/erts-9.2.1/bin/beam.smp: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
-----> Fetching app dependencies with mix
/app/.platform_tools/erlang/erts-9.2.1/bin/beam.smp: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

The Stack changed, will rebuild line suggests that the cache was cleared, however the next line shows cached assets being used:

-----> Using cached Erlang 20.2.3

Manually clearing the cache (https://github.com/heroku/heroku-builds#purge-build-cache) and building again worked.

It seems that the cache clearing here isn't working as expected: https://github.com/HashNuke/heroku-buildpack-elixir/blob/b9092d471ebb0163dbf1bf733b719cf1e31c8f64/lib/misc_funcs.sh#L110-L113 https://github.com/HashNuke/heroku-buildpack-elixir/blob/b9092d471ebb0163dbf1bf733b719cf1e31c8f64/lib/misc_funcs.sh#L125-L132

Many thanks :-)

ahmadwaliesipick commented 3 years ago

I am facing same issue `----> Checking Erlang and Elixir versions Will use the following versions:

@edmorley any resolution?

edmorley commented 3 years ago

any resolution?

@ahmadwaliesipick Hi! I'm not a maintainer of this buildpack (nor an end user of it) - you'd need to ask someone who is :-)

In the meantime, use this workaround from the OP:

Manually clearing the cache (https://github.com/heroku/heroku-builds#purge-build-cache) and building again worked.

edmorley commented 3 years ago

We're getting support tickets periodically about this from users of this buildpack. I don't suppose someone could take a look? :-)