Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 948595 - ebuild repository with git sync eventually gets corrupted if /var/db/repos is a symlink on ZFS
Summary: ebuild repository with git sync eventually gets corrupted if /var/db/repos is...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-23 00:33 UTC by Benn Snyder
Modified: 2025-01-23 01:45 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benn Snyder 2025-01-23 00:33:15 UTC
When using a git-synced ebuild repository when /var/db/repos is a symlink to /var/cache/repos eventually the repo becomes corrupt and will no longer sync.

>>> Syncing repository 'gentoo' into '/var/tmp/cache/repos/gentoo'...
/bin/git fetch origin --depth 1
remote: Enumerating objects: 1752, done.
remote: Counting objects: 100% (1752/1752), done.
remote: Compressing objects: 100% (608/608), done.
remote: Total 1036 (delta 715), reused 657 (delta 427), pack-reused 0 (from 0)
Receiving objects: 100% (1036/1036), 384.46 KiB | 846.00 KiB/s, done.
Resolving deltas: 100% (715/715), completed with 549 local objects.
fatal: missing blob object 'b35a72d166b3c44c6036d90ac82f96986024f123'
error: remote did not send all necessary objects
!!! git fetch error in /var/tmp/cache/repos/gentoo

Workaround: rm -r /var/db/repos/gentoo && emerge --sync

Reproducible: Sometimes

Steps to Reproduce:
1. Make a symlink: /var/db/repos -> /var/cache/repos
2. Configure /etc/portage/repos.conf/gentoo.conf with a basic git-synced repo.

[DEFAULT]
main-repo = gentoo

[gentoo]
location = /var/db/repos/gentoo
sync-type = git
sync-uri = https://anongit.gentoo.org/git/repo/sync/gentoo.git
sync-git-verify-commit-signature = yes
auto-sync = yes

3. Run emerge --sync and notice that everything works fine for a while.
4. Keep running emerge --sync over a few days and eventually an error arises.
Actual Results:  
An error like this appears, and the git repo in /var/db/repos/gentoo becomes corrupted with a bunch of half-synced files and sometimes the .git/ directory itself is partially lost.

>>> Syncing repository 'gentoo' into '/var/tmp/cache/repos/gentoo'...
/bin/git fetch origin --depth 1
remote: Enumerating objects: 1752, done.
remote: Counting objects: 100% (1752/1752), done.
remote: Compressing objects: 100% (608/608), done.
remote: Total 1036 (delta 715), reused 657 (delta 427), pack-reused 0 (from 0)
Receiving objects: 100% (1036/1036), 384.46 KiB | 846.00 KiB/s, done.
Resolving deltas: 100% (715/715), completed with 549 local objects.
fatal: missing blob object 'b35a72d166b3c44c6036d90ac82f96986024f123'
error: remote did not send all necessary objects
!!! git fetch error in /var/tmp/cache/repos/gentoo


I am planning to soon abandon this weird symlink layout and just put /var/db/repos straight on a separate ZFS dataset to avoid this issue.  But I am filing a bug first just in case this report is useful.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-23 00:38:37 UTC
I don't see how this could be caused by Portage. I'll try reproduce it nonetheless, but it's far more likely to be a ZFS bug which we've exposed via Portage before (or a hardware problem).
Comment 2 Benn Snyder 2025-01-23 00:59:13 UTC
It might be specific to ZFS, but it's not a hardware problem since it also happened on another very different machine.  It went away after I stopped using the symlinks and mounted a regular dataset at /var/db/repos instead.

I also made a tarball of my latest corrupted repo.  It's too big to attach here but it should be available at https://github.com/piedar/overboard/releases/download/gentoo-bug-948595/db-repos-gentoo-failed.tar.gz
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-01-23 01:45:08 UTC
Thanks (and thanks for the report, it's useful either way -- even if I can't reproduce it (yet), it'll be useful if someone else hits it as well.)