Skip to content

database or disk is full #10368

Closed
Closed

Description

@Orca75

What happened?

syncthing tells me "database or disk is full"
the disk can't be full:
pwd
/share/CACHEDEV2_DATA/.qpkg/SyncThing/index-v2
df
Filesystem Size Used Available Use% Mounted on
tmpfs 64.0M 35.4M 28.6M 55% /tmp
/dev/mapper/cachedev2
12.8T 1.6T 11.2T 13% /share/CACHEDEV2_DATA

Folder ID | m9xvj-celqf -- | -- /share/Backups/LENOVO-Chris database or disk is full 507’744   57’062   ~605 GiB 15’818   30’676   ~52.2 GiB 518’312 items, ~553 GiB Receive Only

it changes always between Preparing to Sync and Waiting to Sync.

support-bundle-4FKKX5H-2025-09-05T160349.zipFolder ID m9xvj-celqf
Folder Path /share/Backups/LENOVO-Chris
Error database or disk is full
Global State 507’744  57’062  ~605 GiB
Local State
15’818  30’676  ~52.2 GiB
Out of Sync Items 518’312 items, ~553 GiB
Folder Type Receive Only

Syncthing version

2.0.7

Platform & operating system

Linux (64-bit Intel/AMD)

Browser version

No response

Relevant log output

see added support-bundle file

Activity

  1. added
    bug
    needs-triage
    on Sep 5, 2025
  2. added theissue type on Sep 5, 2025
  3. tomasz1986 commented on Sep 5, 2025

    @tomasz1986
    Member
  4. Orca75 commented on Sep 5, 2025

    @Orca75
    Author

    Please see https://forum.syncthing.net/t/database-or-disk-is-full-might-be-syncthing-might-be-qnap/24930. This error means that your database has been corrupted.

    I removed the folder, to regenerate the db. Next time I deleted the folder and all data on the disk. But each time when the db is about 2.3 to 2.5 GB, I get this error. I tryed also to enable multiple debugs, but i don't find a reason.

  5. calmh commented on Sep 6, 2025

    @calmh
    Member

    SQLite will create temp files in some scenarios, and those will end up on /tmp which is quite small in your setup. I suspect this might be the root cause. Do you have the ability to set environment variables for Syncthing? It would be interesting to see what happens if you set for example SQLITE_TMPDIR=/share/CACHEDEV2_DATA/.qpkg/SyncThing/index-v2 (n.b. an existing directory or it won't be used)

  6. bt90 commented on Sep 6, 2025

    @bt90
    Contributor

    I fear that we have a few folks who might not have much space in /tmp either because some NAS vendor is rolling with questionable defaults or they're using tmpfs on systems with low RAM.
    Could we use a subdirectory of index-v2 for that? e.g index-v2/tmp ?

  7. calmh commented on Sep 6, 2025

    @calmh
    Member

    I'd love to, but it seems surprisingly tricky to control from our side. "Temporary storage locations" on https://www.sqlite.org/tempfiles.html lists the hierarchy:

    Image

    For us, that global variable is not accessible (though we can maybe provide patches to the two sqlite packages we use...), the PRAGMA is marked as deprecated and is apparently "super unsafe and unsupported" according to some forum thread, and the rest comes from the environment.

  8. bt90 commented on Sep 6, 2025

    @bt90
    Contributor

    ugh. I guess setting that environment variable from our code isn't possible?

  9. calmh commented on Sep 6, 2025

    @calmh
    Member

    🤔 Actually, since we use the monitor+subprocess thing, we could set this in the monitor process and have it take effect for the subprocess. Of course we'll have to do the whole xdg directory resolution dance or we'll get people with pitchforks when we're putting temp files in a state directory etc, plus we currently don't do the work to figure out the database location from the monitor...

  10. added 5 commits that reference this issue on Sep 7, 2025
    2c216d1
    a6b7820
    a5adb6c
    e006ba0
    2900f62
  11. added a commit that references this issue on Sep 7, 2025
    4b8d07d
  12. Orca75 commented on Sep 8, 2025

    @Orca75
    Author

    Wow, you are pretty fast to find the root cause. Thanks a lot for your help. I just took a look and it's still running and syncing without problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions