Skip to content

nix-prefetch-url fails, but seems to download fine #85

Closed

Description

@viric

It goes like this; I tried multiple times:

$ nix-prefetch-url https://github.com/raspberrypi/firmware/archive/4ade27942e.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0    153      0  0:00:01  0:00:01 --:--:--   211
100 86.0M  100 86.0M    0     0   271k      0  0:05:24  0:05:24 --:--:--  336k
/usr/local/bin/nix-prefetch-url: download of ‘https://github.com/raspberrypi/firmware/archive/4ade27942e.tar.gz’ failed

Activity

  1. viric commented on Jan 6, 2013

    @viric
    MemberAuthor

    The same result on nixos, btw.

  2. edolstra commented on Jan 6, 2013

    @edolstra
    Member

    Works for me... (on NixOS)

  3. vcunat commented on Jan 6, 2013

    @vcunat
    Member

    For me works OK as well (NixOS, about a week old trunk).

  4. edolstra commented on Jan 6, 2013

    @edolstra
    Member

    BTW, this error indicates that curl returned a non-zero exit code.

  5. viric commented on Jan 6, 2013

    @viric
    MemberAuthor

    Umh ok, weird. I tried from 3 computers, and all of them run curl until the 100% of the download, but exit with exit code = 141.

  6. viric commented on Jan 6, 2013

    @viric
    MemberAuthor

    it seems to be something with nscd, also on the non-nixos (and non-nix curl) raspbian.

    curl keeps two sockets open: one with nscd (unix socket), and the tcp for the download. At the end of the download, it writes something to the nscd, gives EPIPE, and get skilled.

    The three computers at home where I tried, reproduce it. I guess it has to do with the time of the download, and I guess I have a slower connection. 5m24s for the download, and that may trigger this.

  7. viric commented on Jan 6, 2013

    @viric
    MemberAuthor

    oh my error. the nscd socket is closed immediately, and then it opens a new one to url hostname. Then it works with a 2nd, that of redirection. At the end of the download, it writes to the 1st, and gets killed by SIGPIPE.

  8. viric commented on Jan 6, 2013

    @viric
    MemberAuthor

    shlevy could reproduce the problem by using "--limit-rate 250k" in curl. I've sent a letter to a curl mailing list about it.

  9. edolstra commented on Jan 10, 2013

    @edolstra
    Member

    Cool, thanks!

  10. added a commit that references this issue on Feb 26, 2025
  11. added a commit that references this issue on Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions