alxvallejo
Asdf: Switching between projects is breaking my system
I have two separate Phoenix projects.
The first uses Elixir 1.4 and the second i’m using 1.9.
I’m using asdf to set the local versions of each but noticed that I had accidentally set the global version as 1.9 on the second project. I tried setting the global version back to 1.4 and then tried deleting the .tool-versions file at /home/user, but I still get this crash report.
Regardless, I’m hitting an error on my first project now. Immediately when I try to run the project I hit this crash report on the CLI. I’ve tried deleting the _build and the deps. Even if i just run mix -v I get the crash report.
iex -S mix phx.server
Erlang/OTP 23 [DEVELOPMENT] [erts-10.6.2] [source-cf6cf5e5f8] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]
=SUPERVISOR REPORT==== 15-Jan-2020::16:33:01.971915 ===
supervisor: {local,'Elixir.Logger.Supervisor'}
errorContext: start_error
reason: noproc
offender: [{pid,undefined},
{id,'Elixir.Logger.ErrorHandler'},
{mfargs,
{'Elixir.Logger.Watcher',watcher,
[error_logger,'Elixir.Logger.ErrorHandler',
{true,false,500}]}},
{restart_type,permanent},
{shutdown,5000},
{child_type,worker}]
=CRASH REPORT==== 15-Jan-2020::16:33:01.973889 ===
crasher:
initial call: application_master:init/4
pid: <0.93.0>
registered_name: []
exception exit: {{shutdown,
{failed_to_start_child,'Elixir.Logger.ErrorHandler',
noproc}},
{'Elixir.Logger.App',start,[normal,[]]}}
in function application_master:init/4 (application_master.erl, line 138)
ancestors: [<0.92.0>]
message_queue_len: 1
messages: [{'EXIT',<0.94.0>,normal}]
links: [<0.92.0>,<0.44.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 376
stack_size: 28
reductions: 192
neighbours:
=INFO REPORT==== 15-Jan-2020::16:33:01.975951 ===
application: logger
exited: {{shutdown,
{failed_to_start_child,'Elixir.Logger.ErrorHandler',noproc}},
{'Elixir.Logger.App',start,[normal,[]]}}
type: temporary
Most Liked
outlog
elixir 1.4 or elixir 1.4.5 (which supports otp20…) ?
use otp 20.3.8.23 and elixir 1.4.5 - and remember rm -rf _build/ before…
also pin the elixir 1.9 project to a more recent otp - like latest 22.x
bonus tip: You’ll want to use the specific elixir/otp builds eg asdf install elixir 1.4.5-otp-20 and asdf install elixir 1.9.4-otp-22 - to enable all latest elixir features…
NobbZ
Do you have elixir-1.9 or elixir-1.9-otp-22 or something similar?
No, don’t delete it. Keep it.
This means the same as ">= 0.5.0 && < 1.0.0", so 0.8 is in range. If that does not work for your project, you need to add further constraints.
If you had a lockfile from previously, than the locked version from earlier would have been used, unless you unlock it. But in that case, you would probably not have concluded that the issue were related to having a different elixir version in a different project.
outlog
you have a .tool-versions in each of the projects right?
eg cat /home/user/path_to/first_project/.tool-versions should have elixir 1.4 in it?
try rm -rf _build/ inside first project - maybe you accidently build it with elixir 1.9
NobbZ
- Do you have
.tool-versionsthat not pin the Elixir version, but the Erlang version as well? - Have you pinned the Elixir version bare or with OTP, and is the OTP version the same as the pinned erlang version.
- Do you have a
mix.lockin the project where you think it resolves to the wrong version? - What are your deps in the
mix.exsfor that project?
NobbZ
That’s where you use the .tool-versions for, but that is not a guarantee.
If you build a release it will have the elixir bundled in that was used to build the release. That’s all you will get.
Of course you can use external means of providing exact versions like docker or nix, but even with those it has to be done right.







