Stuck at "Fetching rebar3_lfe v0.4.8" when adding a dependency, running mix deps.get, and then mix run or mix test

Hi all,

(Updated with new observations below)

I’m going through Ecto’s “Getting Started” (Getting Started — Ecto v3.12.5).

I’ve done the following:

mix new friends --sup

change mix.exs:
defp deps do
  [
    {:ecto_sql, "~> 3.0"},
    {:postgrex, ">= 0.0.0"}
  ]
end

mix deps.get

mix ecto.gen.repo -r Friends.Repo

My adventure stalls there. I just see this for the last 20 minutes and it goes no further:

===> Fetching rebar3_lfe v0.4.8

What am I doing wrong? Is there some cache that I should clear to get things moving along?

I’m using Windows 10, Erlang/OTP 28, Elixir 1.18.4

Update:
It’s not only Ecto. It’s pretty much anything. Here’s another scenario where I’m stuck with the same issue:

> mix new asdf
* creating README.md
* creating .formatter.exs
* creating .gitignore
* creating mix.exs
* creating lib
* creating lib/asdf.ex
* creating test
* creating test/test_helper.exs
* creating test/asdf_test.exs
> cd asdf
> mix test
Compiling 1 file (.ex)
Generated asdf app
Running ExUnit with seed: 287652, max_cases: 8

..
Finished in 0.04 seconds (0.00s async, 0.04s sync)
1 doctest, 1 test, 0 failures

Made the following changes to mix.exs:

  defp deps do
    [
    {:eden, "~> 2.1"},
    ]
  end

Then reran mix deps.get:

> mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.206s
New:
  certifi 2.14.0
  combine 0.10.0
  eden 2.1.0
  elixir_array 2.1.0
  expo 1.1.0
  gettext 0.26.2
  hackney 1.23.0
  idna 6.1.1
  metrics 1.0.1
  mimerl 1.3.0
  parse_trans 3.4.1
  ssl_verify_fun 1.1.7
  timex 3.7.11
  tzdata 1.1.3
  unicode_util_compat 0.7.0
* Getting eden (Hex package)
* Getting elixir_array (Hex package)
* Getting timex (Hex package)
* Getting combine (Hex package)
* Getting gettext (Hex package)
* Getting tzdata (Hex package)
* Getting hackney (Hex package)
* Getting certifi (Hex package)
* Getting idna (Hex package)
* Getting metrics (Hex package)
* Getting mimerl (Hex package)
* Getting parse_trans (Hex package)
* Getting ssl_verify_fun (Hex package)
* Getting unicode_util_compat (Hex package)
* Getting expo (Hex package)

Finally…

> mix test
==> combine
Compiling 6 files (.ex)
Generated combine app
==> asdf
===> Fetching rebar3_lfe v0.4.8

And it just stays there. I had to ctrl+c out of it. Mix run does the same thing:

> mix run
==> combine
Compiling 6 files (.ex)
Generated combine app
==> asdf
===> Fetching rebar3_lfe v0.4.8

Where do I go from here? Thanks.

1 Like

What puzzles me is why it needs to load LFE. :wink: In hex.pm the corresponding rebar3_lfe version is 0.4.8 and there is also a 0.4.11.

I don’t know. I just follow instructions, and try to learn as I go. This just prevents me from moving forward. No error message.

Also, I’ve noticed it happening for Phoenix too, when I added {:yaml_elixir, “~> 2.11.0”} as a new dependency for an older project, and also when I tried to create a new Phoenix project, following the tutorial.

Update:
I’ve removed rebar3 from my path, cleared the .cache\rebar3 in my user directory, and things seem to work now.

Then, if I try to run mix test:

> mix test
===> Failed to update package rebar3_lfe from repo hexpm
===> Errors loading plugin {rebar3_lfe,"0.4.8"}. Run rebar3 with DEBUG=1 set to see errors.
===> Analyzing applications...
===> Compiling yamerl
==> yaml_elixir
Compiling 6 files (.ex)
Generated yaml_elixir app
==> asdf
Compiling 1 file (.ex)
Generated asdf app
Running ExUnit with seed: 681222, max_cases: 8

..
Finished in 0.02 seconds (0.00s async, 0.02s sync)
1 doctest, 1 test, 0 failures

When I run rebar3 alone, I get the same issue:

> rebar3
===> Fetching rebar3_lfe v0.4.8

Then, when I rerun mix.test, I run into this:

> mix test
===> Fetching rebar3_lfe v0.4.8
===> Download error, using cached file at c:/Users/Name/.cache/rebar3/hex/hexpm/packages/rebar3_lfe-0.4.8.tar

And it just stays there.

The only way to get past this is to delete the directory c:/Users/Name/.cache/rebar3

> mix test
===> Failed to update package rebar3_lfe from repo hexpm
===> Errors loading plugin {rebar3_lfe,"0.4.8"}. Run rebar3 with DEBUG=1 set to see errors.
===> Analyzing applications...
===> Compiling yamerl
==> yaml_elixir
Compiling 6 files (.ex)
Generated yaml_elixir app
==> asdf
Compiling 1 file (.ex)
Generated asdf app
Running ExUnit with seed: 628281, max_cases: 8

..
Finished in 0.02 seconds (0.00s async, 0.02s sync)
1 doctest, 1 test, 0 failures

When I run rebar3 with DEBUG=1:

===> Load global config file c:/Users/Name/.config/rebar3/rebar.config
===> Getting definition for package rebar3_lfe from repo hexpm (#{name => <<"hexpm">>,repo_verify_origin => true,
         repo_name => <<"hexpm">>,repo_url => <<"https://repo.hex.pm">>,
         repo_organization => undefined,api_url => <<"https://hex.pm/api">>,
         repo_verify => true})
===> Fetching rebar3_lfe v0.4.8
===> Making request to get package rebar3_lfe from repo hexpm
===> Downloaded package rebar3_lfe, caching at c:/Users/Name/.cache/rebar3/hex/hexpm/packages/rebar3_lfe-0.4.8.tar
===> Writing {pkg,<<"rebar3_lfe">>,<<"0.4.8">>,
                  <<"70AD90549580C5384ABFF1677B8FE874C9EEFD15FF93BF875C86D5115CBDBEBD">>,
                  <<"09F3E90AA6A4A7B706E64C314AB670F5C37AC77EBDC119CFB6398AA9F165EE1B">>,
                  #{name => <<"hexpm">>,repo_verify_origin => true,
                    repo_name => <<"hexpm">>,
                    repo_url => <<"https://repo.hex.pm">>,
                    repo_organization => undefined,
                    api_url => <<"https://hex.pm/api">>,repo_verify => true}} to cache at c:/Users/Name/.cache/rebar3/hex/hexpm/packages/rebar3_lfe-0.4.8.tar

… and it goes no further

I declare this unsolvable, and I reformatted my system. Everything’s working fine after reinstalling.

I have arrived too late here but one action item for the next time: try completely removing ~/.hex and ~/.mix and reinstall tools and libraries as needed. It has fixed Heisenbugs for people before.

1 Like

@rvirding Mentioned this thread to me – I know you’ve got it sorted now, @ohmyohmyohmy – but I did some checking at hex.pm, and nothing lists rebar3_lfe 0.4.8 as a dependent. I also poked around a Github search or two to see if anything unexpected is using it – nada.

Similar to what @dimitarvp metnioned, I’ve seen many situations where dependencies just refused to go away (all the usual caching spots – and some unusual ones). Sometimes folks forget they’ve added deps to ~/.config/rebar3/rebar.config or ~/.config/rebar3/hex.config. Other times, I’ve seen very hard isses to debug, due to code being compiled into ./ebin instead of the usual build tool locations, and those continue to pull in old versions until they get deleted.

Sorry we couldn’t be more help!

1 Like

No worries. I hold nothing against anyone. I just wanted to get back to learning, and formatting was the quickest way forward for me.

I suspect you’re right about the ~/.config/rebar3/rebar.config or ~/.config/rebar3/hex.config. After reformatting, I recalled that I was attempting to try lfe once upon a time, and might have left the configuration there and forgot about it.

Things started to go awry after I upgraded Erlang and Elixir.

I think the reason why the version was so specific (0.4.8) was because I was following the documentation here:

Obviously, I didn’t know what I was doing, and it didn’t work, and I just forgot about it until after I reformatted my computer. Oh well. Lesson learned! Don’t just leave config files around.