Comments (15)
I guess I discovered why it happens: _build/(dev|prod)/ranch/ebin
is an empty directory. Same for all other dependencies.
Do you have an idea why this happens exactly?
from exrm.
Are you on Erlang 17.1? Symlinks were broken in that release. You'd need to upgrade to 17.1.2, or downgrade to 17.0. dev
mode uses symlinks for the release build, which is why it's probably breaking. Please let me know if that's not the case!
from exrm.
Unless erl
doesn't report minor version number increases, or I do have 17.0:
$ erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell
"17"
About the symlinks: the symlinks within rel
are correct. Those within _build
(where rel
libs link to) are empty.
Which is totally weird, I think this is a mix
managed directory, no?
from exrm.
@mweibel otp_release
only displays the major version, for reasons I don't fully understand, but it's in Erlang's docs. However, you can ls /usr/local/lib/erlang/lib
or wherever your Erlang installation is, and check the version number associated with the erts
directory. If it's 6.0, you are on 17.0, 6.1, you are on 17.1, and 6.1.2 you're on 17.1.2.
As for whether that's actually the problem, I'm not sure. It is strange that the beams themselves are not being dumped into _build
. I notice that it's giving you warnings about running an older version of Elixir than is required by some of the deps. If you run your app with iex -S mix
, does everything work as expected?
from exrm.
Ok, it's 6.0 therefore I'm on 17.0.
If I just run my app with iex -S mix
it works without problems.
I upgraded now to Elixir 0.14.3 and removed _build
, deps
and rel
folders in order to have a clean state.
» mix release --dev
==> Generating relx configuration...
==> Generating sys.config...
==> Generating boot script...
==> Performing protocol consolidation...
==> Conform: Loading schema...
==> Conform: No schema found, conform will not be packaged in this release!
==> Generating release...
===> Application metadata file exists but is malformed: /Users/michael/.exenv/versions/0.14.3/lib/mix/test/fixtures/deps_status/_build/dev/lib/invalidapp/ebin/invalidapp.app
===> Application metadata file exists but is malformed: /Users/michael/.exenv/versions/0.14.3/lib/mix/test/fixtures/deps_status/_build/dev/lib/invalidvsn/ebin/invalidvsn.app
===> Application metadata file exists but is malformed: /Users/michael/.exenv/versions/0.14.3/lib/mix/test/fixtures/deps_status/_build/dev/lib/ok/ebin/ok.app
==> Generating nodetool...
==> Packaging release...
==> The release for server-0.0.1 is ready!
» ./rel/server/bin/server console
Exec: /Users/michael/Projects/velvet2/server/rel/server/erts-6.0/bin/erlexec -boot /Users/michael/Projects/velvet2/server/rel/server/releases/0.0.1/server -env ERL_LIBS /Users/michael/Projects/velvet2/server/rel/server/lib -config /Users/michael/Projects/velvet2/server/rel/server/releases/0.0.1/sys.config -pa /Users/michael/Projects/velvet2/server/rel/server/lib/consolidated -args_file /Users/michael/Projects/velvet2/server/rel/server/releases/0.0.1/vm.args -user Elixir.IEx.CLI -extra --no-halt +iex -- console
Root: /Users/michael/Projects/velvet2/server/rel/server
/Users/michael/Projects/velvet2/server/rel/server
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
=INFO REPORT==== 29-Jul-2014::20:02:53 ===
application: ranch
exited: {bad_return,
{{ranch_app,start,[normal,[]]},
{'EXIT',
{undef,
[{ranch_app,start,[normal,[]],[]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},
{line,272}]}]}}}}
type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,ranch,{bad_return,{{ranch_app,start,[normal,[]]},{'EXIT',{undef,[{ranch_app,start,[normal,[]],[]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,272}]}]}}}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,ranch,{bad_return,{{ranch_app,start,[normal,[]]},{'EXIT',{undef,[{ranch_app,start,[normal,[]],[]},{application_master,start
» ls -la ranch-0.10.0
ranch-0.10.0 -> /Users/michael/Projects/velvet2/server/rel/files/../../_build/prod/lib/ranch
» ls -la ranch-0.10.0/
ls: ranch-0.10.0/: No such file or directory
Apparently it really is a problem with the symlinks: the rel/files
folder doesn't exist.
from exrm.
rel/files
shouldn't exist actually now that I'm looking at the path. That path is wrong, so this does seem like a bug in exrm. I'll take a look here shortly.
from exrm.
Just FYI, just confirmed that it's an exrm issue locally using my exrm-test project.
from exrm.
Fixed in ad63a52 and released with version 0.12.12. Thanks for the help troubleshooting!
from exrm.
Awesome, thanks a lot :) Works now
from exrm.
It seems I've run into a similar issue with version 0.14.11 (latest version at this time). iex -S mix
and the app itself runs without a problem, ./rel/my_app/bin/my_app start
does not work, exits immediately, but I do get some logs in rel/my_app/log/erlang.log.1 however.
Seeing different results on Ubuntu and OSX. Erlang version 17.2 on Ubuntu, 17.0 on OSX, Elixir 1.0.2 on both. Unfortunately the error that is spit out is much less formatted this time around. Wondering if you had any thoughts.
Ubuntu:
Exec: /var/www/my_app/current/rel/my_app/erts-6.2/bin/erlexec -boot /var/www/my_app/current/rel/my_app/releases/0.0.1/my_app -env ERL_LIBS /var/www/my_app/current/rel/my_app/lib -config /var/www/my_app/current/rel/my_app/releases/0.0.1/sys.config -pa /var/www/my_app/current/rel/my_app/lib/consolidated -args_file /var/www/my_app/current/rel/my_app/releases/0.0.1/vm.args -user Elixir.IEx.CLI -extra --no-halt +iex -- console
Root: /var/www/my_app/current/rel/my_app
/var/www/my_app/current/rel/my_app
Erlang/OTP 17 [erts-6.2] [source] [64-bit] [async-threads:10] [kernel-poll:false]
{"Kernel pid terminated",application_controller,"{application_start_failure,my_app,{bad_return,{{'Elixir.Pitch',start,[normal,[]]},{'EXIT',{function_clause,[{'Elixir.Phoenix.Router.Adapter',to_integer,[nil],[{file,\"lib/phoenix/router/adapter.ex\"},{line,71}]},{'Elixir.Phoenix.Router.Adapter',dispatch,3,[{file,\"lib/phoenix/router/adapter.ex\"},{line,68}]},{'Elixir.Phoenix.Router.Adapter',start,4,[{file,\"lib/phoenix/router/adapter.ex\"},{line,58}]},{'Elixir.Phoenix.Router.Adapter',start,2,[{file,\"lib/phoenix/router/adapter.ex\"},{line,43}]},{'Elixir.Pitch',start,2,[{file,\"lib/my_app.ex\"},{line,14}]},{application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,272}]}]}}}}}"}
OSX:
Exec: /Users/efatsi/Desktop/Projects/my_app/rel/my_app/erts-6.0/bin/erlexec -boot /Users/efatsi/Desktop/Projects/my_app/rel/my_app/releases/0.0.1/my_app -env ERL_LIBS /Users/efatsi/Desktop/Projects/my_app/rel/my_app/lib -config /Users/efatsi/Desktop/Projects/my_app/rel/my_app/releases/0.0.1/sys.config -pa /Users/efatsi/Desktop/Projects/my_app/rel/my_app/lib/consolidated -args_file /Users/efatsi/Desktop/Projects/my_app/rel/my_app/releases/0.0.1/vm.args -user Elixir.IEx.CLI -extra --no-halt +iex -- console
Root: /Users/efatsi/Desktop/Projects/my_app/rel/my_app
/Users/efatsi/Desktop/Projects/my_app/rel/my_app
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:8:8] [async-threads:10] [kernel-poll:false]
{"Kernel pid terminated",application_controller,"{application_start_failure,my_app,{{shutdown,{failed_to_start_child,'Elixir.Repo',{'EXIT',{undef,[{'Elixir.Ecto.Repo.Backend',start_link,['Elixir.Repo','Elixir.Ecto.Adapters.Postgres'],[]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,314}]},{supervisor,start_children,3,[{file,\"supervisor.erl\"},{line,297}]},{supervisor,init_children,2,[{file,\"supervisor.erl\"},{line,263}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,306}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,239}]}]}}}},{'Elixir.Pitch',start,[normal,[]]}}}"}
from exrm.
@efatsi It looks to me like a dependency is missing. We've run into this many times. Basically some package authors are not aware of what they need to do to make their packages release-ready, which pretty much boils down to making sure all dependencies are declared in the applications list in mix.exs. Even if you think you have all your dependencies listed there, it's probable that one of those deps does not all of it's dependencies listed properly.
If you gist up your mix.exs I might be able to help track it down, but that's the first place I'd start based on those error messages.
from exrm.
Thanks @bitwalker! Here's my mix.exs and mix.lock - https://gist.github.com/efatsi/454ed3513323f703b2be. Is it simply a matter of adding everything in the lock file into the mix.exs deps?
from exrm.
Yeah, ran into this issue multiple times as well. What I found out helps pretty well is checking the difference between rel/<name>/lib/<all directories here>
and the directories within the deps
folder. If there are items in the deps
folder which aren't in the lib folder of the release, then you know an application is missing in the list.
from exrm.
Aha! That did it. Thanks a lot @bitwalker and @mweibel.
from exrm.
Getting a similar error when I MIX_ENV=prod mix release
and ./rel/my_app/bin/my_app console
now :(. Things do work in dev which is good at least though.
from exrm.
Related Issues (20)
- Mix.env/1 being used with string instead of atom when `--env="prod"` passed from script HOT 1
- Generating upgrade fails when attaching git revision to version HOT 1
- "/rel/<projectname>/bin/<projectname> stop" does not work HOT 3
- `mix release` fails with `{unreachable_package, cowlib}` HOT 4
- Error when following Phoenix Walkthrough Documentation
- [Bug?] Not responding to pings HOT 1
- RELX_REPLACE_OS_VARS boot script fails on awk with env vars containing certain characters HOT 3
- Color codes always output
- Release on ubuntu but cannot use in macOS HOT 2
- Can't generate release if config contains values set by an anonymous function HOT 3
- Remote console doesn't seem to have access to all applications in an umbrella app HOT 1
- Running mix release in docker cause MatchError. HOT 1
- Upgrade releases and storage... HOT 1
- deploy: module Experimental.Flow is not available
- mix release fails with 'no case clause matching: :eacces' HOT 8
- Raspbian Jessie with erlang 19 failed to start release HOT 1
- using a different erts version when deploying a release
- Default protocols are not replaced by consolidated in release. HOT 3
- Error while trying to rewrite app file HOT 2
- Mix.Shell.cmd/2 no longer exists, could we get an update to use the new Mix.Shell.cmd/3?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exrm.