I started learning elixir and installed used nix to install elixir and it was working fine but mix deps.get fails with the error Failed to fetch record for <package> from registry
I tried to install elixir with homebrew, mise, asdf and all of them give the same error, heck even docker and orbstack VM’s also throw the exact same error, can someone please let me know how to solve this issue?
Sounds like a network problem?
what are the network settings that I need to check? I even tested with a VPN but got the same result
The interesting thing is that mix local.hex
and mix archive.install hex phx_new
are working correctly
I forgot the exact hosts, sorry, but maybe just dig hex.pm
as a start?
; <<>> DiG 9.10.6 <<>> hex.pm
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3680
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;hex.pm. IN A
;; ANSWER SECTION:
hex.pm. 154 IN A 35.241.14.39
;; Query time: 41 msec
;; SERVER: fddd:dddd::#53(fddd:dddd::)
;; WHEN: Sun Sep 01 22:25:32 IST 2024
;; MSG SIZE rcvd: 57
I am getting this output
output of dig repo.hex.pm
; <<>> DiG 9.10.6 <<>> repo.hex.pm
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62054
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;repo.hex.pm. IN A
;; ANSWER SECTION:
repo.hex.pm. 60 IN CNAME dualstack.f2.shared.global.fastly.net.
dualstack.f2.shared.global.fastly.net. 60 IN A 151.101.154.2
;; Query time: 47 msec
;; SERVER: fddd:dddd::#53(fddd:dddd::)
;; WHEN: Sun Sep 01 22:26:50 IST 2024
;; MSG SIZE rcvd: 155
No further ideas, sorry. This older thread has several people saying that running mix local.hex
first made mix deps.get
work afterwards. Maybe run mix do local.rebar --force, local.hex --force
to make double sure?
Hm, you might also run mix deps.clean --unlock --unused
before mix deps.get
just to make, what count it became?, triple-sure.
I tried all the above commands and I am still getting the same error
Sorry man, I got nothing more. Perhaps corporate firewall or an antivirus on your computer are interfering, but no actual idea.
Show us your deps
from mix.exs
.
Maybe there is a git repo?
defp deps do
[
{:bumblebee, "~> 0.5.3"},
{:castore, "~> 0.1.13"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.3", only: [:dev], runtime: false},
{:dns_cluster, "~> 0.1.1"},
{:ecto_network, "~> 1.3.0"},
{:ecto_sql, "~> 3.6"},
{:elixir_make, "~> 0.7.0", runtime: false},
{:esbuild, "~> 0.8", runtime: Mix.env() == :dev},
{:ex_m3u8, "~> 0.9.0"},
{:ex_marcel, "~> 0.1.0"},
{:exla, ">= 0.0.0"},
{:ffmpex, "~> 0.10.0"},
{:finch, "~> 0.18"},
{:floki, ">= 0.30.0", only: :test},
{:fly_postgres, "~> 0.3.0"},
{:gettext, "~> 0.18"},
{:heroicons, "~> 0.5.0"},
{:hnswlib, "~> 0.1.0"},
{:icalendar, "~> 1.1.0"},
{:image, "~> 0.37"},
{:jason, "~> 1.2"},
{:libcluster, "~> 3.3.1"},
{:membrane_core, "~> 1.0"},
{:membrane_h264_ffmpeg_plugin, "~> 0.31.6"},
{:membrane_http_adaptive_stream_plugin, "~> 0.18.0"},
{:membrane_rtmp_plugin, "~> 0.20.0"},
{:membrane_tee_plugin, "~> 0.12.0"},
{:mint, "~> 1.0"},
{:oban, "~> 2.16"},
{:phoenix_ecto, "~> 4.4"},
{:phoenix_html_helpers, "~> 1.0"},
{:phoenix_html, "~> 4.0", override: true},
{:phoenix_live_dashboard, "~> 0.8.3"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.20.2"},
{:phoenix, "~> 1.7.11"},
{:plug_cowboy, "~> 2.5"},
{:replicate, "~> 1.2.0"},
{:reverse_proxy_plug, "~> 3.0"},
{:slugify, "~> 1.3"},
{:swoosh, "~> 1.3"},
{:tailwind, "~> 0.2", runtime: Mix.env() == :dev},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:thumbnex, "~> 0.5.0"},
{:timex, "~> 3.0"},
{:websockex, "~> 0.4.3"},
# ex_aws
{:ex_aws_s3, "~> 2.3"},
{:ex_doc, "~> 0.29.0"},
{:hackney, ">= 1.20.1"},
{:sweet_xml, ">= 0.0.0", optional: true}
]
end
It is working when I run deps.get like this
HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix deps.get