Coder Social home page Coder Social logo

Comments (15)

mweibel avatar mweibel commented on July 26, 2024

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.

bitwalker avatar bitwalker commented on July 26, 2024

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.

mweibel avatar mweibel commented on July 26, 2024

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.

bitwalker avatar bitwalker commented on July 26, 2024

@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.

mweibel avatar mweibel commented on July 26, 2024

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.

bitwalker avatar bitwalker commented on July 26, 2024

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.

bitwalker avatar bitwalker commented on July 26, 2024

Just FYI, just confirmed that it's an exrm issue locally using my exrm-test project.

from exrm.

bitwalker avatar bitwalker commented on July 26, 2024

Fixed in ad63a52 and released with version 0.12.12. Thanks for the help troubleshooting!

from exrm.

mweibel avatar mweibel commented on July 26, 2024

Awesome, thanks a lot :) Works now

from exrm.

efatsi avatar efatsi commented on July 26, 2024

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.

bitwalker avatar bitwalker commented on July 26, 2024

@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.

efatsi avatar efatsi commented on July 26, 2024

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.

mweibel avatar mweibel commented on July 26, 2024

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.

efatsi avatar efatsi commented on July 26, 2024

Aha! That did it. Thanks a lot @bitwalker and @mweibel.

from exrm.

efatsi avatar efatsi commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.