Closed Loschcode closed 7 years ago
You included the versions you have on your local OS X, but what elixir and Erlang versions are installed on the dokku server?
The Dokku server is configured as follow
# Erlang version
erlang_version=19.0
# Elixir version
elixir_version=1.4.0
# Rebar version
rebar_version=(tag 2.2.0)
# Do dependencies have to be built from scratch on every deploy?
always_build_deps=false
# post_compile="mix ecto.migrate"
@Loschcode there is something broken in your postgrex package. Postgrex 0.13.2 has 62 files but your compiler above says it has only 42. Or it is trying to use a previously cached version and that somehow is causing a failure or the dependency is somehow corrupt/broken.
I would temporarily set the config to true below hoping it will force a full recompilation without reusing caches.
always_build_deps=false
Sadly, it didn't change the error, I'm trying to understand why it doesn't compile properly but can't find out why
Compiling 42 files (.ex)
@Loschcode to be clear, you set always_build_deps=true
, right?
Yes it's what I just did, it didn't change the error
How does Dokku build Elixir projects, is there a buildpack?
Yes, I use this buildpack
https://github.com/HashNuke/heroku-buildpack-elixir
It should work, I already used it for a released project ...
It seems like you are using an outdated version of the buildpack or your config is outdated. The options rebar_version
and always_build_deps
do not exist on that buildpack.
You're right, I changed it to the following
# Erlang version
erlang_version=19.0
# Elixir version
elixir_version=1.4.0
# Always rebuild from scratch on every deploy?
always_rebuild=true
But it didn't change the error with Postgrex, it keeps failing 😞
By downgrading the version of Postgrex to 0.13.0 the compilation succeeded (0.13.1 did not)
==> postgrex
Compiling 61 files (.ex)
Compiling lib/postgrex/default_types.ex (it's taking more than 10s)
Generated postgrex app
But that's getting weirder and weirder as it crashes for another reason now
==> plug
Compiling 44 files (.ex)
== Compilation error on file lib/plug/debugger.ex ==
** (File.Error) could not read file "lib/plug/templates/debugger.html.eex": no such file or directory
(elixir) lib/file.ex:244: File.read!/1
lib/eex.ex:181: EEx.compile_file/2
lib/plug/debugger.ex:168: (module)
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
remote: could not compile dependency :plug, "mix compile" failed. You can recompile this dependency with "mix deps.compile plug", update it with "mix deps.update plug" or clean it with "mix deps.clean plug"
My deps look like that
defp deps do
[{:phoenix, "~> 1.2.4"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.0"},
{:postgrex, "0.13.0"},
{:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"}]
end
Maybe the fact I changed Postgrex version make the following dependencies crash ?
@Loschcode there is definitely something messed up in your deployment pipeline as it is now missing a file from another dependency. I don't know what is the cause but it is definitely something unrelated to Phoenix. Is there any chance this current machine is borked?
Well if you say so I can try to make everything from scratch including server, git and project and see what happens, it's extremely disturbing because I don't recall anything wrong in what I did 😞
I'll do that and if it works, then issue closed I guess.
Other than that, my local machine is working clean, the local version is working as well, but the server I use seems to act funny with this specific repo ; i'll try to find out.
@Loschcode maybe in dokku you can start a whole new project? If possible, maybe try that and make sure to start with the latest buildpack.
this is clearly a heroku-buildpack-elixir issue. related https://github.com/HashNuke/heroku-buildpack-elixir/issues/88
this is clearly a heroku-buildpack-elixir issue
It's more likely it's a dokku issue or an issue with the machine it's running on since the buildpack has been working without issue on heroku from some time. The buildpack was made for heroku and I don't think it has been tested on dokku by the maintainers of the buildpack.
Closing this until we can pinpoint it is a Phoenix issue.
Environment
Expected behavior
When deploying on my Dokku application on DigitalOcean, it should just work. The application is fresh and I wrote literally nothing in it to troubleshoot the problem.
Actual behavior
After trying to push with
git push dokku
it goes through the process until it crashes with Postgrex.I'm out of solution, it's been several days now and it's literally a fresh new project without anything in it. I just configured the database properly taking inspiration from my own working projects on Dokku.