Can't build anything because of gnu-config

When I try to use home-manager switch or get packages with nix-shell (like bash, git, brave, nerdfonts), the following error occurs:

warning: error: unable to download 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=948ae97ca5703224bd3eada06b7a69f40dd15a02': HTTP error 502

       response body:

       <html>
       <head><title>502 Bad Gateway</title></head>
       <body>
       <center><h1>502 Bad Gateway</h1></center>
       <hr><center>nginx/1.18.0 (Trisquel GNU/Linux)</center>
       </body>
       </html>; retrying in 272 ms
warning: error: unable to download 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=948ae97ca5703224bd3eada06b7a69f40dd15a02': HTTP error 502

       response body:

       <html>
       <head><title>502 Bad Gateway</title></head>
       <body>
       <center><h1>502 Bad Gateway</h1></center>
       <hr><center>nginx/1.18.0 (Trisquel GNU/Linux)</center>
       </body>
       </html>; retrying in 529 ms
warning: error: unable to download 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=948ae97ca5703224bd3eada06b7a69f40dd15a02': HTTP error 502

       response body:

       <html>
       <head><title>502 Bad Gateway</title></head>
       <body>
       <center><h1>502 Bad Gateway</h1></center>
       <hr><center>nginx/1.18.0 (Trisquel GNU/Linux)</center>
       </body>
       </html>; retrying in 343 ms
warning: error: unable to download 'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=948ae97ca5703224bd3eada06b7a69f40dd15a02': HTTP error 502

       response body:

       <html>
       <head><title>502 Bad Gateway</title></head>
       <body>
       <center><h1>502 Bad Gateway</h1></center>
       <hr><center>nginx/1.18.0 (Trisquel GNU/Linux)</center>
       </body>
       </html>; retrying in 629 ms

Seems like gnu-config is the dependency for many packages, and it cannot be built from source if https://git.savannah.gnu.org/cgit/config.git is unreachable. At the same time, Index of /git/config.git/ is fine, so it’s just the cgit server that is down.

Is there a workaround, like maybe replacing gnu-config or using a mirror?

Sorry that sucks, if you can’t wait it out, I believe you could workaround using overrideAttrs to replace gnu-config’s unpackPhase so it uses a mirror.

edit: since it’s pulled as a transitive dependency you might actually have to use an overlay too. (That is overlay the overridden package).

2 Likes

Thank you! After waiting it out, cgit is back online. In the meantime, I have tested the overlay:

(self: super: let
  gnuConfig = builtins.fetchGit {
    url = "git://git.savannah.gnu.org/config.git";
    rev = "948ae97ca5703224bd3eada06b7a69f40dd15a02";
    allRefs = true;
  };
in {
  gnu-config = super.gnu-config.overrideAttrs {
    unpackPhase = ''
      runHook preUnpack
      cp ${gnuConfig}/config.guess ./config.guess
      cp ${gnuConfig}/config.sub ./config.sub
      chmod +w ./config.sub ./config.guess
      runHook postUnpack
    '';
  };
})

I’m using fetchGit here, as I prefer it over fetchurl. Otherwise, this overlay provides an identical package using git.savannah.gnu.org or any other mirror.

This was a great learning experience of Nix overlays.