alxvallejo

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

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

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

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

NobbZ

  • Do you have .tool-versions that 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.lock in the project where you think it resolves to the wrong version?
  • What are your deps in the mix.exs for that project?
NobbZ

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.

Where Next?

Popular in Questions Top

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement