When running on NixOS, I faced an issue.
The initial mirror operation worked, but subsequent syncs fail with the error:
Error message: Failed to sync repository: Snapshot failed; sync blocked to protect history. git command failed: fatal: Unable to create '/tmp/gitea-mirror-backup-g9VYmK/repo.git/data/repo-backups/u5wbKMuhe95WV9fXH3y0DOcD4IX04B27/<OWNER_REDACTED>/<REPO_REDACTED>/2026-03-01T02-19-08-257Z.bundle.lock': No such file or directory
At first, I thought it was a permissions issue, but adding ReadWritePaths = [ "/tmp" ]; didn't change anything. Then I looked at the code, and I got a feeling that there's something wrong with the path construction. I feel like /tmp/gitea-mirror-backup-g9VYmK/repo.git is one part, and /data/repo-backups/u5wbKMuhe95WV9fXH3y0DOcD4IX04B27/<OWNER_REDACTED>/<REPO_REDACTED>/2026-03-01T02-19-08-257Z.bundle.lock is something different, but somehow they got joined into one. 🤔
It doesn't happen all the time, but some repos/branches synchronize sometimes. I can't find a pattern yet.
When running on NixOS, I faced an issue.
The initial mirror operation worked, but subsequent syncs fail with the error:
```
Error message: Failed to sync repository: Snapshot failed; sync blocked to protect history. git command failed: fatal: Unable to create '/tmp/gitea-mirror-backup-g9VYmK/repo.git/data/repo-backups/u5wbKMuhe95WV9fXH3y0DOcD4IX04B27/<OWNER_REDACTED>/<REPO_REDACTED>/2026-03-01T02-19-08-257Z.bundle.lock': No such file or directory
```
At first, I thought it was a permissions issue, but adding `ReadWritePaths = [ "/tmp" ];` didn't change anything. Then I looked at the [code](https://github.com/RayLabsHQ/gitea-mirror/blob/2e00a610cb41e423c92ed09b00f6998bbfb9f3ee/src/lib/repo-backup.ts#L146-L170), and I got a feeling that there's something wrong with the path construction. I feel like `/tmp/gitea-mirror-backup-g9VYmK/repo.git` is one part, and `/data/repo-backups/u5wbKMuhe95WV9fXH3y0DOcD4IX04B27/<OWNER_REDACTED>/<REPO_REDACTED>/2026-03-01T02-19-08-257Z.bundle.lock` is something different, but somehow they got joined into one. 🤔
It doesn't happen all the time, but some repos/branches synchronize sometimes. I can't find a pattern yet.
<!-- github-sync-id:4006036069 -->
Fixed in #204 — the bundle path was being passed as relative to git -C, so git resolved it against the temp clone dir instead of the actual backup directory. Swapped to path.resolve() to always guarantee an absolute path. Shipped in v3.10.1.
Fixed in #204 — the bundle path was being passed as relative to `git -C`, so git resolved it against the temp clone dir instead of the actual backup directory. Swapped to `path.resolve()` to always guarantee an absolute path. Shipped in [v3.10.1](https://github.com/RayLabsHQ/gitea-mirror/releases/tag/v3.10.1).
<!-- github-comment-id:3978949100 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When running on NixOS, I faced an issue.
The initial mirror operation worked, but subsequent syncs fail with the error:
At first, I thought it was a permissions issue, but adding
ReadWritePaths = [ "/tmp" ];didn't change anything. Then I looked at the code, and I got a feeling that there's something wrong with the path construction. I feel like/tmp/gitea-mirror-backup-g9VYmK/repo.gitis one part, and/data/repo-backups/u5wbKMuhe95WV9fXH3y0DOcD4IX04B27/<OWNER_REDACTED>/<REPO_REDACTED>/2026-03-01T02-19-08-257Z.bundle.lockis something different, but somehow they got joined into one. 🤔It doesn't happen all the time, but some repos/branches synchronize sometimes. I can't find a pattern yet.
Fixed in #204 — the bundle path was being passed as relative to
git -C, so git resolved it against the temp clone dir instead of the actual backup directory. Swapped topath.resolve()to always guarantee an absolute path. Shipped in v3.10.1.