supervisor: Supervisor Error Cant update github addons
The problem
ERROR (MainThread) [supervisor.store.git] Can’t update https://github.com/home-assistant/addons repo: Reference at ‘HEAD’ does not exist.
What version of Home Assistant Core has the issue?
2022.4.3
What was the last working version of Home Assistant Core?
2022.4.3
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Supervisor
Link to integration documentation on our website
No response
Diagnostics information
ERROR (MainThread) [supervisor.store.git] Can’t update https://github.com/home-assistant/addons repo: Reference at ‘HEAD’ does not exist.
Example YAML snippet
ERROR (MainThread) [supervisor.store.git] Can't update https://github.com/home-assistant/addons repo: Reference at 'HEAD' does not exist.
Anything in the logs that might be useful for us?
22-04-14 08:42:16 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-1459664' coro=<Repository.update() done, defined at /usr/src/supervisor/supervisor/store/repository.py:106> exception=StoreGitError()>
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/store/git.py", line 152, in pull
branch = self.repo.active_branch.name
File "/usr/local/lib/python3.9/site-packages/git/repo/base.py", line 797, in active_branch
return self.head.reference
File "/usr/local/lib/python3.9/site-packages/git/refs/symbolic.py", line 292, in _get_reference
sha, target_ref_path = self._get_ref_info(self.repo, self.path)
File "/usr/local/lib/python3.9/site-packages/git/refs/symbolic.py", line 201, in _get_ref_info
return cls._get_ref_info_helper(repo, ref_path)
File "/usr/local/lib/python3.9/site-packages/git/refs/symbolic.py", line 184, in _get_ref_info_helper
raise ValueError("Reference at %r does not exist" % ref_path)
ValueError: Reference at 'HEAD' does not exist
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/supervisor/supervisor/store/repository.py", line 110, in update
await self.git.pull()
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 108, in wrapper
raise err
File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper
return await self._method(*args, **kwargs)
File "/usr/src/supervisor/supervisor/store/git.py", line 195, in pull
raise StoreGitError() from err
supervisor.exceptions.StoreGitError
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 21 (3 by maintainers)
So I’m not going to resolve this one as a duplicate because the error you’re seeing is slightly different and its about a different repository. But it looks very similar to #3561 even down to the git error code so I think it is a duplicate.
Which means for now my approach is the same as what I laid out here. Basically a change was made in core
2022.4where it started forcing supervisor to check for updates in every addon repository every 5 minutes. This means that every 5 minutes every HA user om the world with core >=2022.4and supervisor is cloning both the official add-ons repo and the community add-ons repo. My guess based on the error codes is that github does not like this activity and is blocking requests periodically to reduce load.There is a PR merged already that changes it so core stops forcing supervisor to check for updates every 5 minutes and supervisor can resume checking on its schedule (every couple hours or so). That’s slated for the next patch (
2022.4.5). If the issue continues after that has been out for a day or two (giving most users time to update) then I will start to dig into it further. Because it doesn’t really make sense otherwise, both of those repos definitely exist.FYI 2022.4.5 out now with the mentioned fix for the hassio component
Same here with
supervisor-2022.04.0andcore-2022.4.4Errors supervisor log
22-04-15 18:01:02 ERROR (MainThread) [supervisor.store.git] Can't update https://github.com/hassio-addons/repository repo: Cmd('git') failed due to: exit code(128) cmdline: git fetch -v --update-shallow --depth=1 origin stderr: 'fatal: expected flush after ref listing'. 22-04-15 18:01:02 ERROR (MainThread) [supervisor.store.git] Can't update https://github.com/home-assistant/addons repo: Cmd('git') failed due to: exit code(128) cmdline: git fetch -v --update-shallow --depth=1 origin stderr: 'fatal: error reading section header 'acknowledgments''. 22-04-15 18:01:02 INFO (MainThread) [supervisor.resolution.module] Create new issue IssueType.CORRUPT_REPOSITORY - ContextType.STORE / core 22-04-15 18:01:02 INFO (MainThread) [supervisor.resolution.module] Create new suggestion SuggestionType.EXECUTE_RESET - ContextType.STORE / core 22-04-15 18:01:03 ERROR (MainThread) [asyncio] Task exception was never retrieved future: <Task finished name='Task-197042' coro=<Repository.update() done, defined at /usr/src/supervisor/supervisor/store/repository.py:106> exception=StoreGitError()> Traceback (most recent call last): File "/usr/src/supervisor/supervisor/store/git.py", line 155, in pull await self.sys_run_in_executor( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.9/site-packages/git/remote.py", line 886, in fetch res = self._get_fetch_info_from_stderr(proc, progress, File "/usr/local/lib/python3.9/site-packages/git/remote.py", line 750, in _get_fetch_info_from_stderr proc.wait(stderr=stderr_text) File "/usr/local/lib/python3.9/site-packages/git/cmd.py", line 502, in wait raise GitCommandError(remove_password_if_present(self.args), status, errstr) git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git fetch -v --update-shallow --depth=1 origin stderr: 'fatal: error reading section header 'acknowledgments'' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/supervisor/supervisor/store/repository.py", line 110, in update await self.git.pull() File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 108, in wrapper raise err File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper return await self._method(*args, **kwargs) File "/usr/src/supervisor/supervisor/store/git.py", line 195, in pull raise StoreGitError() from err supervisor.exceptions.StoreGitError 22-04-15 18:01:03 ERROR (MainThread) [asyncio] Task exception was never retrieved future: <Task finished name='Task-197045' coro=<Repository.update() done, defined at /usr/src/supervisor/supervisor/store/repository.py:106> exception=StoreGitError()> Traceback (most recent call last): File "/usr/src/supervisor/supervisor/store/git.py", line 155, in pull await self.sys_run_in_executor( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.9/site-packages/git/remote.py", line 886, in fetch res = self._get_fetch_info_from_stderr(proc, progress, File "/usr/local/lib/python3.9/site-packages/git/remote.py", line 750, in _get_fetch_info_from_stderr proc.wait(stderr=stderr_text) File "/usr/local/lib/python3.9/site-packages/git/cmd.py", line 502, in wait raise GitCommandError(remove_password_if_present(self.args), status, errstr) git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git fetch -v --update-shallow --depth=1 origin stderr: 'fatal: expected flush after ref listing' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/supervisor/supervisor/store/repository.py", line 110, in update await self.git.pull() File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 108, in wrapper raise err File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper return await self._method(*args, **kwargs) File "/usr/src/supervisor/supervisor/store/git.py", line 195, in pull raise StoreGitError() from err supervisor.exceptions.StoreGitErrorsame here, right after 2022.4.4
details ...
<source>22-04-15 16:40:00 ERROR (MainThread) [supervisor.store.git] Can't update https://github.com/hassio-addons/repository repo: Cmd('git') failed due to: exit code(128) cmdline: git fetch -v --update-shallow --depth=1 origin stderr: 'fatal: expected flush after ref listing'. 22-04-15 16:40:00 INFO (MainThread) [supervisor.resolution.module] Create new issue IssueType.CORRUPT_REPOSITORY - ContextType.STORE / a0d7b954 22-04-15 16:40:00 INFO (MainThread) [supervisor.resolution.module] Create new suggestion SuggestionType.EXECUTE_RESET - ContextType.STORE / a0d7b954 22-04-15 16:40:00 ERROR (MainThread) [asyncio] Task exception was never retrieved future: <Task finished name='Task-1108' coro=<Repository.update() done, defined at /usr/src/supervisor/supervisor/store/repository.py:106> exception=StoreGitError()> Traceback (most recent call last): File "/usr/src/supervisor/supervisor/store/git.py", line 155, in pull await self.sys_run_in_executor( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.9/site-packages/git/remote.py", line 886, in fetch res = self._get_fetch_info_from_stderr(proc, progress, File "/usr/local/lib/python3.9/site-packages/git/remote.py", line 750, in _get_fetch_info_from_stderr proc.wait(stderr=stderr_text) File "/usr/local/lib/python3.9/site-packages/git/cmd.py", line 502, in wait raise GitCommandError(remove_password_if_present(self.args), status, errstr) git.exc.GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git fetch -v --update-shallow --depth=1 origin stderr: 'fatal: expected flush after ref listing' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/src/supervisor/supervisor/store/repository.py", line 110, in update await self.git.pull() File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 108, in wrapper raise err File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper return await self._method(*args, **kwargs) File "/usr/src/supervisor/supervisor/store/git.py", line 195, in pull raise StoreGitError() from err supervisor.exceptions.StoreGitError</source>