Why are rebar3 '"git://' dependency fetching hanging?

Hi.

I’m using rebar 3.24.0 on Erlang/OTP 27.2 / Erts 15.2.

I’m trying to compile the Erlang app (https://github.com/yurrriq/nkcluster) and have a questions about the get-deps phase of rebar3.

  1. Q1: Why fetching a dependency from {git,"git://github.com/... hangs but fetching a dependency from {git,"https://github.com/... works normally?

  2. Q2: Is there a flag for rebar3 to turn on verbose output?

Example:

deps part from the rebar.config:

{deps, [
  {nkdist,
   {git, "git://github.com/yurrriq/nkdist.git",
    {branch, "master"}}},
  {nkpacket,
   {git, "git://github.com/yurrriq/nkpacket.git",
    {branch, "master"}}},
  {nkdocker,
   {git, "git://github.com/yurrriq/nkdocker.git",
    {branch, "master"}}},
  {eper,
   {git, "git://github.com/yurrriq/eper.git",
    {branch, "master"}}},
  {lager,
   {git, "git://github.com/basho/lager.git",
    {tag, "3.1.0"}}}
]}.

$ rebar3 compile

===> Fetching rebar3_run v0.5.0
make: Entering directory '/home/user/dev/erl/tmp/nkcluster/_build/default/plugins/rebar3_run/c_src'
make: Leaving directory '/home/user/dev/erl/tmp/nkcluster/_build/default/plugins/rebar3_run/c_src'
===> Analyzing applications...
===> Compiling rebar3_run
===> Verifying dependencies...
===> Fetching eper (from {git,"git://github.com/yurrriq/eper.git",{branch,"master"}})


... here fetching process hangs on the first git dependency - until timeout.

But if I change for all rebar.config dependencies {git, "git://... to {git, "https://..., the fetching process starts to go normally - again, until it encounters a depencency with {git, "git://....

About Q1, you can try git clone git://github.com/yurrriq/nkdist.git. It will hang, too.

That’s not a problem of rebar3. GitHub deprecated the git:// protocol in 2022 due to security concerns. Read more at Improving Git protocol security on GitHub - The GitHub Blog

Q1: Why does fetching a dependency from {git, "git://github.com/... hang, but fetching from {git, "https://github.com/... works normally?

This issue is likely caused by the differences in how the git:// and https:// protocols interact with your system’s environment. Here are a few possible reasons:

  • Firewall or Network Restrictions: Many corporate or personal firewalls block the git:// protocol as it uses a custom port (9418) instead of the standard HTTP/HTTPS ports (80/443). This could result in the fetch operation hanging until it times out.
  • Deprecation of git:// Protocol: GitHub has deprecated the git:// protocol in favor of https:// for better security and reliability. Some newer systems may no longer fully support git:// for fetching repositories.
  • Proxy Settings: If you’re working behind a proxy, it might only support https:// requests. The git:// protocol does not work with typical proxy configurations.
  • SSH vs. HTTPS Settings: If your environment is configured for HTTPS instead of SSH or doesn’t have SSH keys set up for GitHub, the git:// protocol may fail silently or hang.

So, replace all git:// URLs with https:// in your rebar.config. If you expect to work with SSH-based URLs, ensure you are using the correct format: git@github.com:owner/repo.git.

Q2: Is there a flag for rebar3 to turn on verbose output?

Yes, you can enable verbose output in rebar3 by using the --verbose flag. For example:

rebar3 compile --verbose

This will give you more detailed logs about the fetch process, which can help debug network or configuration issues.

Thank you for explanation.

you can enable verbose output in rebar3 by using the --verbose flag. For example:

$ rebar3 compile --verbose
===> Invalid option --verbose on task compile

DEBUG=1 rebar3 compile

Should be get you what you want

Oh… The --verbose flag is related to common tests(Commands | Rebar3)… @LeonardB provide correct answer, you need set DEBUG=1 variable(Base Config | Rebar3).