We have a Phoenix application that has been running in production on Heroku for the last year.
Now I am attempting to enable pull request versions of the application to run via review apps as part of a Heroku pipeline.
The application has three Heroku buildpacks:
- https://buildpack-registry.s3.amazonaws.com/buildpacks/hashnuke/elixir.tgz
- https://github.com/gjaldon/heroku-buildpack-phoenix-static
- our own buildpack (see below)
Our own buildpack is very straightforward. Here is the bin/detect
script:
#!/bin/sh
exit 0
And here is the bin/compile
script:
#!/bin/bash
cd $1
mix release
Whilst the build has been working for production, unfortunately for the PR which is designed to enable review apps, it is failing when it gets to the final buildpack. Here is the relevant output from the Heroku build:
-----> https://github.com/orgname/buildpack-name.git app detected
** (ArgumentError) argument error
:erlang.binary_to_atom(nil, :utf8)
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
(stdlib) erl_eval.erl:878: :erl_eval.expr_list/6
(stdlib) erl_eval.erl:236: :erl_eval.expr/5
(stdlib) erl_eval.erl:228: :erl_eval.expr/5
(stdlib) erl_eval.erl:878: :erl_eval.expr_list/6
(stdlib) erl_eval.erl:404: :erl_eval.expr/5
! Push rejected, failed to compile https://github.com/orgname/buildpack-name.git app.
! Push failed
So it seems to be failing in the mix release
step but the error message doesn't give me a good idea of why. I have found a similar problem report, which suggests that the problem I'm trying to solve may be due to one or more missing environment variables. However, I've double checked and can't see any environment variables that are missing.
Any suggestions about how I might solve this problem would be most welcome.