[Bug]: sqlite3 configured to only use mmap, no fallback to regular IO
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
I'm the author of mergerfs. As a FUSE filesystem it is possible for individual to disable mmap support. Numerous Nextcloud + mergerfs users have run into an issue where they get IO errors from sqlite because (I'm guessing) nextcloud's usage of sqlite3 sets up mmap and when a query fails doesn't reset it to regular IO. As a result they get unclear messages about IO errors.
Steps to reproduce
- Setup mergerfs with cache.files=off
- Point Nextcloud to the mergerfs mount during install.
Expected behavior
Ideally the code managing sqlite3 could confirm the target filesystem supports mmap and falls back to regular IO.
Installation method
None
Nextcloud Server version
28
Operating system
None
PHP engine version
None
Web server
None
Database engine version
SQlite
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue identifies SQLite3 configuration and a mergerfs mount with cache.files=off, but names no source files or tests. Start by reproducing the installation on that mount and tracing the SQLite database setup and resulting I/O errors. Done means mmap-only configuration no longer produces unclear I/O failures when mmap is unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100