Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mix local.hex does not work in case of Erlang/OTP 28 rc.2 #14349

Open
zacky1972 opened this issue Mar 20, 2025 · 7 comments
Open

mix local.hex does not work in case of Erlang/OTP 28 rc.2 #14349

zacky1972 opened this issue Mar 20, 2025 · 7 comments

Comments

@zacky1972
Copy link
Contributor

Elixir and Erlang/OTP versions

Erlang/OTP 28 [RELEASE CANDIDATE 2] [erts-16.0] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]

Elixir 1.18.3 (compiled with Erlang/OTP 27)

Operating system

macOS Sequoia 15.3.2

Current behavior

I installed Erlang/OTP 28.0-rc.2 and Elixir 1.18.3-otp-27 using mise, do the following steps:

  1. mix new test
  2. cd test
  3. Edit mix.exs to install ex_doc

I got the following error when mix deps.get:

12:01:56.398 [error] beam/beam_load.c(592): Error loading function 'Elixir.Hex.State':print_invalid_config_error/2: op bs_add p x x u x:
  please re-compile this module with an Erlang/OTP 28 compiler or update your Erlang/OTP version



12:01:56.402 [error] beam/beam_load.c(592): Error loading function 'Elixir.Hex.State':print_invalid_config_error/2: op bs_add p x x u x:
  please re-compile this module with an Erlang/OTP 28 compiler or update your Erlang/OTP version



12:01:56.404 [notice] Application hex exited: exited in: Hex.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (ArgumentError) The module Hex.State was given as a child to a supervisor but it does not exist
            (elixir 1.18.3) lib/supervisor.ex:797: Supervisor.init_child/1
            (elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
            (elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
            (elixir 1.18.3) lib/supervisor.ex:783: Supervisor.init/2
            (elixir 1.18.3) lib/supervisor.ex:707: Supervisor.start_link/2
            (kernel 10.3) application_master.erl:297: :application_master.start_it_old/4

12:01:56.405 [notice] Application inets exited: :stopped

12:01:56.406 [notice] Application ssl exited: :stopped

12:01:56.406 [notice] Application public_key exited: :stopped

12:01:56.406 [notice] Application asn1 exited: :stopped

12:01:56.406 [notice] Application crypto exited: :stopped
Could not start Hex. Try fetching a new version with "mix local.hex" or uninstalling it with "mix archive.uninstall hex.ez"
** (MatchError) no match of right hand side value: {:error, {:hex, {:bad_return, {{Hex.Application, :start, [:normal, []]}, {:EXIT, {%ArgumentError{message: "The module Hex.State was given as a child to a supervisor but it does not exist"}, [{Supervisor, :init_child, 1, [file: ~c"lib/supervisor.ex", line: 797]}, {Enum, :"-map/2-lists^map/1-1-", 2, [file: ~c"lib/enum.ex", line: 1714]}, {Enum, :"-map/2-lists^map/1-1-", 2, [file: ~c"lib/enum.ex", line: 1714]}, {Supervisor, :init, 2, [file: ~c"lib/supervisor.ex", line: 783]}, {Supervisor, :start_link, 2, [file: ~c"lib/supervisor.ex", line: 707]}, {:application_master, :start_it_old, 4, [file: ~c"application_master.erl", line: 297]}]}}}}}}
    (hex 2.1.1) lib/hex.ex:5: Hex.start/0
    (mix 1.18.3) lib/mix/hex.ex:60: Mix.Hex.start/0
    (mix 1.18.3) lib/mix/dep/loader.ex:189: Mix.Dep.Loader.with_scm_and_app/5
    (mix 1.18.3) lib/mix/dep/loader.ex:141: Mix.Dep.Loader.to_dep/4
    (elixir 1.18.3) lib/enum.ex:1714: Enum."-map/2-lists^map/1-1-"/2
    (mix 1.18.3) lib/mix/dep/loader.ex:364: Mix.Dep.Loader.mix_children/3
    (mix 1.18.3) lib/mix/dep/loader.ex:18: Mix.Dep.Loader.children/1
    (mix 1.18.3) lib/mix/dep/converger.ex:97: Mix.Dep.Converger.all/4

I also did mix local.hex, I got the following message:

mix local.hex
Found existing entry: /Users/zacky/.mix/archives/hex-2.1.1
Are you sure you want to replace it with "https://builds.hex.pm/installs/1.16.0/hex-2.1.1.ez"? [Yn] y
* creating /Users/zacky/.mix/archives/hex-2.1.1

I did mix deps.get again, but I got the same error.

I also did mix archive.uninstall hex.ez, and I got the following error:

Could not find a local artifact named "hex.ez". We found:
* hex-2.1.1
Archives installed at: /Users/zacky/.mix/archives

Expected behavior

I will succeed in mix deps.get without any errors.

@kipcole9
Copy link
Contributor

See this same issue already reported in the hex repo

@kipcole9
Copy link
Contributor

I have been able to move forward by installing hex with:

% mix archive.install github hexpm/hex branch latest

@zacky1972
Copy link
Contributor Author

@kipcole9 Thank you! I tested it and it seems to work well!

@josevalim
Copy link
Member

Yes, we plan to precompile Hex per OTP version to address such issues.

@0xFlo
Copy link

0xFlo commented Apr 6, 2025

So annoying because I need to use OTP 28 rc.2 since 27 has so many issues on macos

@josevalim
Copy link
Member

josevalim commented Apr 6, 2025

Which issues are you running into? I am running 27 daily on macOS and production for more than 6 months at this point and I haven't run into anything.

@0xFlo
Copy link

0xFlo commented Apr 6, 2025

Disk-based ETS is causing issues. I've read people had to upgrade to OTP 28 to get it working but anyway I'll just replace it with simple file-based JSON cache and wait for a new version. Better than hacking around with elixir and phoenix. Could also be a skill issue idk <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants