Troubleshooting SvnAdmin: Fix Common Subversion Issues Fast
1. Verify repository health
- Run:
svnadmin verify /path/to/repo - If it reports errors: note the revision numbers and error messages.
2. Repair corrupted revisions
- Attempt recovery by dumping good revisions:
- Create a dump of the last good revision range:
bash
svnadmin dump /path/to/repo -r 0:GOOD_REV > repo-good.dump - Create a new repository and load the dump:
bash
svnadmin create /path/to/newreposvnadmin load /path/to/newrepo < repo-good.dump
- Create a dump of the last good revision range:
- If only a few revisions are corrupted, skip them by dumping ranges before and after the bad revisions and loading both into a new repo.
3. Fix filesystem permission issues
- Symptoms: errors opening repository, E175002, permission denied.
- Fix: ensure repository owner and group match the server process (e.g.,
www-dataorsvn) and set permissions:bashchown -R svnuser:svngroup /path/to/repofind /path/to/repo -type d -exec chmod 2775 {} ;find /path/to/repo -type f -exec chmod 664 {} ; - Ensure
umaskfor repository-accessing processes allows group writes.
4. Resolve locking problems
- Symptom: operations hang or report locked working copies.
- Client-side: run
svn cleanupin the working copy. - Server-side repository locks: use
svnadmin lslocksandsvnadmin rmlocks(if using repository-level lock management), or manually remove lock files indb/locksonly as a last resort after backing up the repo.
5. Recover from transaction failures
- When a transaction fails (txn-), list transactions:
bash
svnadmin lstxns /path/to/repo - To commit a good transaction:
bash
svnadmin resolve /path/to/repo –transaction TXN_ID –accept work(Note:
svnadminsubcommands vary by Subversion version; consultsvnadmin help.)
6. Handle low disk space or quota errors
- Symptoms: IO errors, aborted commits.
- Fix: free space or increase quotas, then run:
bash
svnadmin recover /path/to/repo - After recovery, run
svnadmin verifyto confirm integrity.
7. Fix repository UUID or format mismatches
- Symptoms: clients reject repository or migrations fail.
- Check format and UUID in
db/formatanddb/uuid. To set UUID:bashsvnadmin setuuid /path/to/repo NEW-UUID
8. Troubleshoot auth and hook script failures
- Check server logs (Apache, svnserve) for permission/auth errors.
- Hook scripts: ensure executable bit set and environment variables defined; test scripts manually as the repository user. Add logging to hooks to capture runtime errors.
9. Performance issues
- Common causes: large
db/revsordb/transactions, no hot copy backups, inefficient hooks. - Mitigations: enable FSFS packing (
svnadmin pack), schedule regularsvnadmin dump+reload maintenance for very old repositories, optimize hooks, and upgrade Subversion if on an old version.
10. Backup and disaster recovery best practices
- Regularly run
svnadmin hotcopy /path/to/repo /path/to/backup(hotcopy preserves a live repo). - Keep offsite copies of dumps:
svnadmin dump –incremental. - Test restores periodically by loading dumps into a new repo.
Quick checklist (action order)
- Run
svnadmin verify. - Check disk space and permissions.
- Run
svnadmin recoverif needed. - Use dumps to reconstruct repo excluding corrupted revisions.
- Inspect hooks and server logs.
- Restore from hotcopy or dump if repair fails.
If you want, I can tailor recovery commands for your Subversion version and repository path—provide the server OS and Subversion version.
Leave a Reply