Dvc exp run ERROR: unexpected error - corrupted TREE extension in index

Hey,

I wanted to run a new experiment and I suddenly got this error message

2025-07-01 13:15:52,296 DEBUG: command: /home/fuchsfa/align/.venv/bin/dvc exp run -v                                                                                                                                                                
2025-07-01 13:15:53,949 ERROR: unexpected error - corrupted TREE extension in index                                                                                                                                                                 
Traceback (most recent call last):                                                                                                                                                                                                                  
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/cli/__init__.py", line 211, in main                                                                                                                                              
    ret = cmd.do_run()                                                                                                                                                                                                                              
          ^^^^^^^^^^^^                                                                                                                                                                                                                              
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/cli/command.py", line 27, in do_run                                                                                                                                              
    return self.run()                                                                                                                                                                                                                               
           ^^^^^^^^^^                                                                                                                                                                                                                               
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/commands/experiments/run.py", line 14, in run                                                                                                                                    
    self.repo.experiments.run(                                                                                                                                                                                                                      
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/repo/experiments/__init__.py", line 354, in run
    return run(self.repo, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/repo/__init__.py", line 58, in wrapper
    return f(repo, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/repo/experiments/run.py", line 77, in run
    return repo.experiments.reproduce_one(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/repo/experiments/__init__.py", line 125, in reproduce_one
    self.queue_one(exp_queue, **kwargs)
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/repo/experiments/__init__.py", line 136, in queue_one
    return self.new(queue, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/repo/experiments/__init__.py", line 218, in new
    return queue.put(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/repo/experiments/queue/workspace.py", line 38, in put
    return self._stash_exp(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/dvc/repo/experiments/queue/base.py", line 309, in _stash_exp
    with self.scm.stash_workspace(reinstate_index=True) as workspace:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/.local/share/uv/python/cpython-3.12.7-linux-x86_64-gnu/lib/python3.12/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/scmrepo/git/__init__.py", line 477, in stash_workspace
    rev = self.stash.push(**kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/scmrepo/git/stash.py", line 36, in push
    rev, reset = self.scm._stash_push(  # pylint: disable=protected-access
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/scmrepo/git/__init__.py", line 307, in _backend_func
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/scmrepo/git/backend/pygit2/__init__.py", line 762, in _stash_push
    oid = self.repo.stash(
          ^^^^^^^^^^^^^^^^
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/pygit2/repository.py", line 1159, in stash
    check_error(err)
  File "/home/fuchsfa/align/.venv/lib/python3.12/site-packages/pygit2/errors.py", line 66, in check_error
    raise GitError(message)
_pygit2.GitError: corrupted TREE extension in index

2025-07-01 13:15:54,157 DEBUG: link type reflink is not available ([Errno 95] no more link types left to try out)
2025-07-01 13:15:54,157 DEBUG: Removing '/home/fuchsfa/.oX3xUDLPfYIgRCCJPI-eKw.tmp'
2025-07-01 13:15:54,159 DEBUG: Removing '/home/fuchsfa/.oX3xUDLPfYIgRCCJPI-eKw.tmp'
2025-07-01 13:15:54,161 DEBUG: Removing '/home/fuchsfa/.oX3xUDLPfYIgRCCJPI-eKw.tmp'
2025-07-01 13:15:54,163 DEBUG: Removing '/home/fuchsfa/align/.dvc/cache/files/md5/.8YnQ6J2XqsoNLtEngz99Aw.tmp'
2025-07-01 13:15:54,169 DEBUG: Version info for developers:
DVC version: 3.60.1 (pip)
-------------------------
Platform: Python 3.12.7 on Linux-5.15.0-142-generic-x86_64-with-glibc2.36
Subprojects:
        dvc_data = 3.16.10
        dvc_objects = 5.1.1
        dvc_render = 1.0.2
        dvc_task = 0.40.2
        scmrepo = 3.3.11
Supports:
        http (aiohttp = 3.12.13, aiohttp-retry = 2.9.1),
        https (aiohttp = 3.12.13, aiohttp-retry = 2.9.1)
Config:
        Global: /home/fuchsfa/.config/dvc
        System: /etc/xdg/dvc
Cache types: hardlink, symlink
Cache directory: beegfs on beegfs_nodev
Caches: local
Remotes: local
Workspace directory: beegfs on beegfs_nodev
Repo: dvc, git
Repo.site_cache_dir: /var/tmp/dvc/repo/5bd8845c8855293b65c1034fca596b01

Normal git commands are still working. dvc repro is working as well.
I tried dvc exp clean as well but this changed nothing.

Hi, please downgrade dulwich to <0.23 for now.

There’s an open issue being tracked here: `dulwich==0.23.1` breaks libgit2 index parsing · Issue #1643 · jelmer/dulwich · GitHub.

1 Like

thx for the quick reply :sign_of_the_horns:. seems I did not search enough beforehand :sweat_smile: