Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchGit transient failure not retried, Empty reply from server #9153

Open
roberth opened this issue Oct 14, 2023 · 2 comments
Open

fetchGit transient failure not retried, Empty reply from server #9153

roberth opened this issue Oct 14, 2023 · 2 comments
Labels
bug fetching Networking with the outside (non-Nix) world, input locking

Comments

@roberth
Copy link
Member

roberth commented Oct 14, 2023

Describe the bug

Git fetching should retry if the fetcher fails after a git fetch/git pull failure.

Steps To Reproduce

  1. Have an unreliable git host
  2. Call fetchGit with a rev that hasn't been fetched yet. (in my case, ref was also specified, and I used an http url to a private github.com repo)
  3. Observe a log such as:
fetching Git repository 'https://github.com/ORG/REPO.git'
fatal: unable to access 'https://github.com/ORG/REPO.git/': Empty reply from server
warning: could not update local clone of Git repository 'https://github.com/ORG/REPO.git'; continuing with the most recent version

This was a transient failure. The next evaluation fetched it correctly.

Expected behavior

Perform a retry of the entire fetcher if a possible network error was detected.
Approximately:

  1. check the cache for rev (if we don't care about testing that a rev still exists - idk, configurable?)
  2. git fetch or similar. Retry this step, because we know that we need it to work. Don't retry a missing ref or permission error.
  3. proceed with the fetched git data as usual

nix-env --version output

2.11

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added bug fetching Networking with the outside (non-Nix) world, input locking labels Oct 14, 2023
@roberth
Copy link
Member Author

roberth commented Oct 22, 2023

Here's another one

fetching Git repository 'https://github.com/hercules-ci/hercules-ci-effects.git'
fatal: unable to access 'https://github.com/hercules-ci/hercules-ci-effects.git/': Recv failure: Connection reset by peer
warning: could not update local clone of Git repository 'https://github.com/hercules-ci/hercules-ci-effects.git'; continuing with the most recent version

@roberth
Copy link
Member Author

roberth commented Oct 24, 2023

Or this:

fetching Git repository 'https://github.com/nixified-ai/flake.git'
error: RPC failed; curl 55 Failed sending data to the peer
fatal: expected flush after ref listing
warning: could not update local clone of Git repository 'https://github.com/nixified-ai/flake.git'; continuing with the most recent version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fetching Networking with the outside (non-Nix) world, input locking
Projects
None yet
Development

No branches or pull requests

1 participant