HashNuke / heroku-buildpack-elixir

Heroku Buildpack for Elixir with nitro boost
MIT License
811 stars 310 forks source link

Elixir 1.10.0+ not working #171

Closed sambou closed 4 years ago

sambou commented 4 years ago

Building/deploying doesn't work when trying to deploy with Elixir v1.10.2.

I already tried to clear the build cache but to no avail.

Build Output:

       Will use the following versions:
       * Stack heroku-18
       * Erlang 20.1
       * Elixir 1.10.2 
-----> Stack changed, will rebuild
-----> Fetching Erlang 20.1 from https://s3.amazonaws.com/heroku-buildpack-elixir/erlang/cedar-14/OTP-20.1.tar.gz
-----> Installing Erlang 20.1 (changed)
-----> Fetching Elixir v1.10.2 for OTP 20 from https://repo.hex.pm/builds/elixir/v1.10.2-otp-20.zip
-----> Installing Elixir v1.10.2 (changed)
[/app/tmp/cache/elixir-v1.10.2.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /app/tmp/cache/elixir-v1.10.2.zip or
        /app/tmp/cache/elixir-v1.10.2.zip.zip, and cannot find /app/tmp/cache/elixir-v1.10.2.zip.ZIP, period.
chmod: cannot access '/tmp/build_33e7d82ce9781f31d16e7883db80a54d/.platform_tools/elixir/bin/*': No such file or directory
-----> Installing Hex
/app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/elixir_funcs.sh: line 99: mix: command not found
-----> Installing rebar
/app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/elixir_funcs.sh: line 105: mix: command not found
-----> Fetching app dependencies with mix
/app/tmp/buildpacks/7dbb5567c3a8b869f9516cd869ebf95082d7cf78f12fea9cba8fad1e1923c580f31b53ba792ed7279cc47894e95fe878ef82661603023bf1f6a023e7c7953587/lib/app_funcs.sh: line 81: mix: command not found
 !     Push rejected, failed to compile Elixir app.
 !     Push failed
jesseshieh commented 4 years ago

My guess is this is because elixir 1.10 is not compatible with otp 20. Try using erlang 21+ and see if that helps.

See https://github.com/elixir-lang/elixir/blob/master/lib/elixir/pages/Compatibility%20and%20Deprecations.md#compatibility-between-elixir-and-erlangotp

sambou commented 4 years ago

Ah, yes that was the issue! Thanks so much for your help! 🙂

ryanzidago commented 4 years ago

On my side it is still not working.

The following elixir_buildpack.config file:

# Erlang version
erlang_version=22
# Elixir version
elixir_version=1.10.2
# always rebuild from scratch on every deploy?
always_rebuild=false

causes the following error message when I run git push heroku master:

Enumerating objects: 108, done.
Counting objects: 100% (108/108), done.
Delta compression using up to 8 threads
Compressing objects: 100% (96/96), done.
Writing objects: 100% (108/108), 1.05 MiB | 746.00 KiB/s, done.
Total 108 (delta 49), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Elixir app detected
remote: -----> Checking Erlang and Elixir versions
remote:        Will use the following versions:
remote:        * Stack heroku-18
remote:        * Erlang 22
remote:        * Elixir 1.10.2 
remote: -----> Will export the following config vars:
remote: BUILDPACK_URL
remote:        * MIX_ENV=prod
remote: -----> Stack changed, will rebuild
remote: -----> Fetching Erlang 22
remote: -----> Installing Erlang 22 (changed)
remote: 
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: /app/tmp/buildpacks/64e61c9ed2f722ba254af0c2a31073c9484883a607461e0e00cf066bf3959101411be00769a4a3fea67f11eb1e60985df323d47517b908e8fe2f62bb08fb0a09/lib/erlang_funcs.sh: line 37: /app/tmp/cache/erlang/Install: No such file or directory
remote: -----> Fetching Elixir v1.10.2 for OTP 22
remote: -----> Installing Elixir v1.10.2 (changed)
remote: -----> Installing Hex
remote: /tmp/build_f87eb6a9319182d05c043cf5bd1f386d/.platform_tools/elixir/bin/elixir: 230: exec: erl: not found
remote: -----> Installing rebar
remote: /tmp/build_f87eb6a9319182d05c043cf5bd1f386d/.platform_tools/elixir/bin/elixir: 230: exec: erl: not found
remote: -----> Fetching app dependencies with mix
remote: /tmp/build_f87eb6a9319182d05c043cf5bd1f386d/.platform_tools/elixir/bin/elixir: 230: exec: erl: not found
remote:  !     Push rejected, failed to compile Elixir app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to conversassion.
remote: 
To https://git.heroku.com/conversassion.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/conversassion.git'

Is there anything that I am missing?

jesseshieh commented 4 years ago

I think the erlang version has to match one of these exactly so maybe you can try 22.2 instead. https://github.com/HashNuke/heroku-buildpack-elixir-otp-builds/blob/master/otp-versions

ryanzidago commented 4 years ago

Yes thank you I finally realized that!