mikl

mikl

How to figure out what mix deps.get is stuck at?

We’ve recently started seeing our CI jobs failing due to mix deps.get hanging. It stalls for an hour, then the CI job gets a timeout, our script looks like this:

$ mix local.hex --force --if-missing
$ mix local.rebar --force --if-missing
$ mix hex.repo add oban https://getoban.pro/repo --fetch-public-key ${OBAN_KEY_FINGERPRINT} --auth-key ${OBAN_LICENSE_KEY}
$ mix deps.get

This is with Gitlab CI, using the hexpm/elixir:1.17.3-erlang-26.2.5.4-debian-bookworm-20241016-slim docker image.

Is there any way to see where it is getting stuck? mix help deps.get does not list any verbose or debugging flags.

Most Liked

sorentwo

sorentwo

Oban Core Team

Authenticating and fetching from the getoban.pro repo shouldn’t time out. However, we’ve heard about network trouble from CI instances in the past.

Try switching to the newer, globally distributed repo instead: https://repo.oban.pro. That will be served closer to your CI servers and should have better connectivity guarantees.

axelson

axelson

Scenic Core Team

What does MIX_DEBUG=true mix deps.get show? It should print output kind of like:

> MIX_DEBUG=true mix deps.get
-> Running mix loadconfig (inside Rewrite.MixProject)
<- Ran mix loadconfig in 0ms
-> Running mix deps.get (inside Rewrite.MixProject)
-> Running mix archive.check (inside Rewrite.MixProject)
<- Ran mix archive.check in 0ms
Resolving Hex dependencies...
Resolution completed in 0.038s
Unchanged:
  benchee 1.3.1
  benchee_dsl 0.5.3
  bunt 1.0.0
  credo 1.7.8
  deep_merge 1.0.0
  dialyxir 1.4.4
  earmark_parser 1.4.41
  erlex 0.2.7
  ex_doc 0.34.2
  excoveralls 0.18.3
  file_system 1.0.1
  fss 0.1.1
  glob_ex 0.1.10
  jason 1.4.4
  kino 0.14.2
  makeup 1.1.2
  makeup_elixir 0.16.2
  makeup_erlang 1.0.1
  nimble_parsec 1.4.0
  sourceror 1.7.0
  statistex 1.0.0
  table 0.1.2
  text_diff 0.1.0
All dependencies are up to date
<- Ran mix deps.get in 469ms

Another thing you could check is MIX_PROFILE=deps.get mix deps.get. Although I’m not sure if that’ll help if mix deps.get hangs forever.

Example output
> MIX_PROFILE=deps.get mix deps.get
-> Profiling mix deps.get (inside Rewrite.MixProject)
Resolving Hex dependencies...
Resolution completed in 0.064s
Unchanged:
  benchee 1.3.1
  benchee_dsl 0.5.3
  bunt 1.0.0
  credo 1.7.8
  deep_merge 1.0.0
  dialyxir 1.4.4
  earmark_parser 1.4.41
  erlex 0.2.7
  ex_doc 0.34.2
  excoveralls 0.18.3
  file_system 1.0.1
  fss 0.1.1
  glob_ex 0.1.10
  jason 1.4.4
  kino 0.14.2
  makeup 1.1.2
  makeup_elixir 0.16.2
  makeup_erlang 1.0.1
  nimble_parsec 1.4.0
  sourceror 1.7.0
  statistex 1.0.0
  table 0.1.2
  text_diff 0.1.0
All dependencies are up to date

Profile results of #PID<0.114.0>
#                                                                              CALLS     %  TIME µS/CALL
Total                                                                          67945 100.0 84998    0.13
:digraph.delete/1                                                                  2  0.00     0    0.00
:digraph.set_type/2                                                                2  0.00     0    0.00
:digraph.check_type/3                                                              2  0.00     0    0.00
:digraph.new/0                                                                     2  0.00     0    0.00
Hex.Registry.Server.open/1                                                         1  0.00     0    0.00
Hex.Registry.Server.open/0                                                         1  0.00     0    0.00
:digraph_utils.forest/3                                                            2  0.00     0    0.00
:erlang.setelement/3                                                               3  0.00     0    0.00
:erlang.monotonic_time/1                                                           2  0.00     0    0.00
:erlang.atom_to_list/1                                                             1  0.00     0    0.00
List.flatten/1                                                                     1  0.00     0    0.00
Path.relative_to_cwd/1                                                             8  0.00     0    0.00
Path.dirname/1                                                                     1  0.00     0    0.00
Hex.Solver.Constraints.Range.include/1                                             5  0.00     0    0.00
:eval_bits.expr_grp/3                                                              1  0.00     0    0.00
Map.new/1                                                                          1  0.00     0    0.00
Map.merge/3                                                                        1  0.00     0    0.00
Map.drop_keys/2                                                                    3  0.00     0    0.00
anonymous fn/1 in Hex.RemoteConverger.packages_from_requests/1                     8  0.00     0    0.00
Hex.RemoteConverger."-fun.request_to_dependency/1-"/1                              8  0.00     0    0.00
anonymous fn/1 in Hex.RemoteConverger.verify_input/2                               8  0.00     0    0.00
Hex.RemoteConverger."-fun.verify_repo/1-"/1                                        1  0.00     0    0.00
Hex.RemoteConverger.with_children/2                                                1  0.00     0    0.00
Hex.RemoteConverger.verify_resolved/2                                              1  0.00     0    0.00
Hex.RemoteConverger.verify_prefetches/1                                            1  0.00     0    0.00
Hex.RemoteConverger.verify_otp_app_names/1                                         1  0.00     0    0.00
Hex.RemoteConverger.verify_input/2                                                 1  0.00     0    0.00
Hex.RemoteConverger.verify_deps/2                                                  1  0.00     0    0.00
Hex.RemoteConverger.unlock_deps/2                                                  1  0.00     0    0.00
Hex.RemoteConverger.print_success/2                                                1  0.00     0    0.00
Hex.RemoteConverger.print_dependency_group/2                                       4  0.00     0    0.00
Hex.RemoteConverger.print_category/1                                               1  0.00     0    0.00
Hex.RemoteConverger.packages_from_requests/1                                       1  0.00     0    0.00
Hex.RemoteConverger.normalize_resolved/1                                           1  0.00     0    0.00
Hex.RemoteConverger.lock_merge/2                                                   1  0.00     0    0.00
Hex.RemoteConverger.group_dependency_changes/2                                     1  0.00     0    0.00
Hex.RemoteConverger.do_with_children/2                                             1  0.00     0    0.00
Hex.RemoteConverger.dep_info_from_lock/1                                           1  0.00     0    0.00
Hex.RemoteConverger.add_apps_to_resolved/2                                         1  0.00     0    0.00
Kernel.__info__/1                                                                  6  0.00     0    0.00
System.normalize_time_unit/1                                                       2  0.00     0    0.00
:lists.mergel/2                                                                    4  0.00     0    0.00
:lists.do_flatten/2                                                                5  0.00     0    0.00
:lists.flatten/1                                                                   1  0.00     0    0.00
:erl_eval.exprs/6                                                                  3  0.00     0    0.00
:erl_eval.empty_fun_used_vars/0                                                    3  0.00     0    0.00
Mix.Dep.Umbrella.unloaded/0                                                        1  0.00     0    0.00
:logger_server.check_level/1                                                       2  0.00     0    0.00

<MANY MORE LINES>

:erlang.binary_to_atom/2                                                        7370  1.59  1352    0.18
:erl_scan.scan_string_no_col/5                                                 24921  1.63  1389    0.06
:gen.do_call/4                                                                  2194  1.83  1554    0.71
:io_lib_format.build_small/1                                                   17526  2.22  1887    0.11
:erlang.atom_to_binary/1                                                       15111  2.22  1888    0.12
:io_lib_format.collect/2                                                       17526  2.44  2075    0.12
:io_lib_format.build_limited/5                                                 17526  2.62  2228    0.13
:elixir_aliases.do_concat/2                                                    14316  2.77  2357    0.16
:erts_internal.prepare_loading/2                                                  38 16.22 13784  362.74

Profile done over 1270 matching functions

It was a little tricky to find, but here is where that is documented: Mix — Mix v1.20.2
It was tricky because as far as I can tell:

  • mix help won’t print that out as help text
  • mix has a manpage but it isn’t installed on my system (where I use asdf)
  • Searching hexdocs.pm for MIX_DEBUG doesn’t yield any results because it actually seems to search for all mentions of mix or debug and there are a lot of those

I found the docs because I already knew there was a MIX_DEBUG environment variable, so I downloaded Elixir’s source code and searched via git grep.

One last thing. If you have the dependencies, i.e. you’ve cached the deps/, ~/.mix, ~/.hex then you can add HEX_OFFLINE=true to skip contracting hex.pm (that’s documented at mix hex.config — Hex v2.5.0)

jeroenbourgois

jeroenbourgois

Can you curl the package from within CI? Maybe try that just to verify the credentials in the url are correct? Something like:

curl -I https://getoban.pro/repo --fetch-public-key ${OBAN_KEY_FINGERPRINT} --auth-key ${OBAN_LICENSE_KEY}

Where Next?

Popular in Questions Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
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
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
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
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
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
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
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
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
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement