Fixing "Can't open file 'txn-current-lock': Read-only file system" on Apache-Served Subversion Repositories Under /home

Abstract: Newer Ubuntu releases ship an Apache systemd unit that mounts /home read-only for the httpd process, so Subversion commits fail with E000030. A systemd drop-in that whitelists the repository path restores write access.

Created: 2026-11-02 by

The error svn: E000030: Can't open file '.../db/txn-current-lock': Read-only file system is not caused by Subversion, Apache configuration, or your repository permissions. It happens because the apache2.service systemd unit on recent Ubuntu releases runs the web server inside a hardened sandbox in which /home is mounted read-only. If your SVN repository lives under /home/svn, the Apache worker that handles the commit physically cannot create the transaction files it needs, and the kernel reports the filesystem as read-only — even though it is perfectly writable for every other process on the machine.

Why commits fail only on newer Ubuntu releases

Subversion's repository format has not changed, and neither has mod_dav_svn's behavior. During a commit, the server must write into the repository's db/ directory, including creating and locking txn-current-lock and the corresponding transaction directories. If that write is blocked, the client sees E000030.

What changed is the default security hardening of the packaged Apache unit. The unit now includes a directive such as:

ProtectHome=read-only

This systemd sandboxing option makes every path under /home visible to the service but mounted read-only. Older LTS releases (20.04, 22.04, 24.04) shipped a unit without this restriction, which is why identical provisioning scripts that worked for years suddenly break after an OS upgrade. Nothing is wrong with your chown www-data, your 775 permissions, or your DBM authentication — the denial happens below the filesystem permission layer, at the mount-namespace level.

You can confirm this quickly:

  • sudo -u www-data touch /home/svn/myrepository/db/testfile succeeds, because a plain shell is not sandboxed.
  • The Apache error log may show nothing beyond the failed commit, since the kernel rejection is transparent to the module.
  • Checking the effective unit with systemctl cat apache2.service reveals the ProtectHome (and related) settings.

The fix: a systemd drop-in, not editing the unit file

Do not edit /lib/systemd/system/apache2.service directly — package updates will overwrite it. Instead, create a drop-in override:

sudo systemctl edit apache2.service

This opens an editor on an override file. There are two approaches, and the trade-off between them matters:

Option 1 — whitelist only the repository path (recommended)

[Service]
ReadWritePaths=/home/svn

The ReadWritePaths directive carves a writable exception out of the read-only /home mount, leaving the rest of the sandbox intact. Your repository stays protected by all the other hardening options, and only the directory that genuinely needs writes is exposed. This is the minimal-privilege choice and the one to prefer.

Option 2 — disable home sandboxing entirely

[Service]
ProtectHome=no

This removes the read-only /home mount altogether. It is simpler and works if you also need Apache to read or write elsewhere under /home, but it weakens the sandbox more than necessary. If your repository lives somewhere else entirely — say /srv/svn — you may find that a different sandbox directive (such as one covering /srv) is the culprit, and the same technique applies with the appropriate path.

After saving the drop-in, reload and restart:

sudo systemctl daemon-reload
sudo systemctl restart apache2.service

Then retry the commit from the client. The txn-current-lock error should disappear immediately.

Verifying the change took effect

To confirm the service is running with your override, inspect the effective configuration:

systemctl show apache2.service -p ReadWritePaths -p ProtectHome

You can also verify from inside the running service's namespace:

sudo cat /proc/$(systemctl show -p MainPID --value apache2.service)/mounts | grep home

With Option 1 in place, /home appears read-only but /home/svn (or whatever path you whitelisted) appears writable.

Prevention and generalization

This class of failure is easy to misdiagnose because the error message points at the filesystem rather than at the sandbox. Whenever a daemon reports "read-only file system" on a path that is demonstrably writable from a shell, suspect systemd sandboxing directives: ProtectHome, ProtectSystem, ReadOnlyPaths, ReadWritePaths, and PrivateTmp. Upgrading an LTS release is the most common trigger, because unit files shipped by the distribution get stricter over time while your directory layout stays the same.

To avoid surprises in future upgrades:

  • Keep any drop-in overrides in /etc/systemd/system/apache2.service.d/ under version control so they survive reinstallation and are easy to reapply on new servers.
  • Consider placing service-writable data outside /home (for example /srv/svn) to reduce reliance on ProtectHome exceptions — though note that other directives may still apply to those paths.
  • After any OS upgrade that hosts Apache-backed services, smoke-test write operations (an SVN commit, a WordPress upload, etc.), not just read access.

Frequently Asked Questions

Why does the error say "read-only file system" when permissions are 775 and the owner is www-data?

Because the denial comes from a read-only bind mount inside Apache's systemd sandbox, not from Unix file permissions. The kernel rejects writes at the mount level before permissions are ever consulted, and the resulting error message is generic.

Is ReadWritePaths better than setting ProtectHome=no?

Generally yes. ReadWritePaths opens a single directory for writing while keeping the rest of the /home sandbox intact, which follows the principle of least privilege. ProtectHome=no is a blunt fix that removes the protection entirely; use it only if the service legitimately needs broad access to /home.

Do I need to reinstall or recreate the repository?

No. The repository itself is fine — nothing was corrupted, because the writes never happened. Once the sandbox permits writes, commits succeed against the existing repository with no migration or repair.

Does this affect browsing or checking out over HTTP(S), or only commits?

Read operations (checkout, export, log, update) usually continue to work, since the sandbox still allows reading /home. Only operations that write to the repository — commit, lock, property changes — hit the read-only wall.

I placed my repository in /var or /srv and get the same error. Is the fix the same?

The mechanism is the same but the responsible directive may differ. Newer units also restrict parts of the filesystem via options like ProtectSystem=full or ReadOnlyPaths. Check systemctl cat apache2.service, identify which directive covers your path, and add a matching ReadWritePaths entry for it.

Will a package upgrade of Apache erase my drop-in override?

No. Drop-ins live in /etc/systemd/system/apache2.service.d/, which is not owned by the package, so they survive upgrades. Only edits made directly to the unit file under /lib/systemd/system/ would be overwritten — which is exactly why drop-ins are the recommended approach.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More