git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git maintenance fails without meaningful error message if any remote is no longer available

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
May 5, 2026, 09:59 UTC
Message-ID
<5e3bcfdb-d3aa-4494-81d6-15b0dfd43af1@gmail.com>
In-Reply-To
<0f3ef394-d96a-42f2-825d-53cb475a2363@anselmschueler.com>
Hi Anselm
On 30/04/2026 00:13, Anselm Schüler wrote:
Show 17 quoted lines
> I have a repo with multiple remotes, one of which no longer exists. When 
> git-maintenance runs on it, it fails during the prefetch stage because 
> that remote doesn’t exist anymore, and gives a mostly unhelpful error 
> message:
> 
> $ git maintenance run --schedule=daily
> ERROR: Repository not found.
> fatal: Could not read from remote repository.
> 
> Please make sure you have the correct access rights
> and the repository exists.
> error: failed to prefetch remotes
> error: task 'prefetch' failed
> 
> I think that
> 1. git-maintenance should report which remote it’s encountering an error on
> 2. git-maintenance should continue fetching other remotes even if one fails

Since c75662bfc9 (maintenance: running maintenance should not stop on errors, 2024-04-24) which is in git 2.45.3 the systemd timer files installed by "git maintenance start" use "git for-each-repo --keep-going --config=..." to avoid this problem. Unfortunately we don't have a way to automatically upgrade the timer files for users who ran "git maintenance start" before that. I think if you run

	git maintenance stop
	git maintenance start

It will delete the old timer files and install the new ones. If that does not work you'll need to manually edit the files and add "--keep-going" to "git for-each-repo".

Thanks
Phillip
Show 13 quoted lines
> Now, on my system, the systemd timers for git-maintenance use git-for- 
> each-repo. Not sure if that’s upstream behaviour or something Nix/home- 
> manager does. But if it is upstream behaviour, it would also be great to 
> report the repo the error comes from, since I basically had to guess 
> right now which repo was erroring. Luckily I have only three repos under 
> maintenance so that was fine.
> 
> Let me know if you agree that this should be done. I would be open to 
> writing a patch (no promises though)
> 
> Anselm
> 
> 
Previous: Anselm SchülerNext: Anselm Schüler
Message 2 of 4 in “Git maintenance fails without meaningful error message if any remote is no longer available”
  1. Anselm SchülerApr 29, 2026
  2. Phillip WoodMay 5, 2026
  3. Anselm SchülerMay 5, 2026
  4. Phillip WoodMay 6, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.