[Nix#9153] fetchGit transient failure not retried, Empty reply from server #108

Open
opened 2024-03-16 06:44:57 +00:00 by lix-bot · 0 comments
Member

Upstream-Issue: NixOS/nix#9153

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.

Upstream-Issue: https://git.lix.systems/NixOS/nix/issues/9153 **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 :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
lix-bot added the
bug
imported
labels 2024-03-16 06:44:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#108
No description provided.