nextcloud / nextcloud/server

[Bug]: sqlite3 configured to only use mmap, no fallback to regular IO

Open
#46,568 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 28-feedback bug feature: database needs review
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
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
  1. Setup mergerfs with cache.files=off
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.