Skip to content

WARNING: fsync is not supported by the data storage #230

Closed

Description

@r0l1

Output of rest-server --version

docker image: f41f6db080c5
Digest: sha256:8b806c911815e78db8a95e7d41f34780d0690eae0d75cf8a49c35c8ec3c831e3

How did you run rest-server exactly?

docker run --name "restic-server" -p 8000:8000 -v /data:/data --env "OPTIONS=--private-repos --append-only" restic/rest-server

What backend/server/service did you use to store the repository?

Expected behavior

fsync working. This is an ext4 drive (raid1 -> luks -> ext4).

Actual behavior

I get hundreds of following messages during a backup process:

WARNING: fsync is not supported by the data storage. This can lead to data loss, if the system crashes or the storage is unexpectedly disconnected.

Steps to reproduce the behavior

Don't know. I compiled a simple go program (via docker golang:alpine) and tested for f.Sync support. No error is thrown and it also runs within the same docker container without any problems.

Do you have any idea what may have caused this?

Maybe the compiled binary within the official docker image differs from my test binary? Different go versions?

Do you have an idea how to solve the issue?

Currently not. The filesystem supports fsync.

Did rest-server help you today? Did it make you happy in any way?

Restic is just awesome and I really appreciate this open source project.

Activity

  1. r0l1 commented on May 8, 2023

    @r0l1
    Author

    And why are there so many log messages? Looking at the code:

    fsyncWarning sync.Once

    should actually result into one single log message. Any hints?

  2. MichaelEischer commented on May 8, 2023

    @MichaelEischer
    Member

    Arghh, looks like I've messed up the check for fsync support in #199. #231 fixes the fsync check. But I'm not yet sure why the warning is printed multiple times.

  3. wojas commented on May 9, 2023

    @wojas
    Contributor

    But I'm not yet sure why the warning is printed multiple times.

    A new Handler is created for every request, so it will current be printed at most once per request, which is not very helpful.

    Perhaps create a global var for the sync.Once?

  4. MichaelEischer commented on May 13, 2023

    @MichaelEischer
    Member

    @wojas I've moved the sync.Once instance into the server struct.

  5. DanielGibson commented on Jun 1, 2023

    @DanielGibson

    Good to see this fixed, I was just gonna report this :)

    My setup is similar (harddisk partition -> LUKS encryption -> ext4), and I wasn't 100% sure if the warning maybe is true and due to the LUKS in the middle maybe fsync() on ext4 doesn't go through to the physical disk, but according to https://stackoverflow.com/questions/32225517/fsync-on-mapped-crypted-device-with-dm-crypt it does?

    (either way the warning should of course only be logged once, so I'm glad that's fixed)

  6. kittkott commented on Jul 4, 2023

    @kittkott

    Windows Server 2019
    rest-server version rest-server 0.12.0 compiled with go1.20.3 on windows/amd64

    I get hundreds of following messages during a backup process:

    "WARNING: fsync is not supported by the data storage. This can lead to data loss, if the system crashes or the storage is unexpectedly disconnected."

  7. DanielGibson commented on Jul 5, 2023

    @DanielGibson

    The fix has been implemented on May 18th, but the last release (0.12.0, the one you're using) is from April.

    I think a new release would make sense, as those messages are both noisy and (apparently wrongly) alarming.
    (Says the guy who hasn't done a release of his open source project in over a year 🙃)

  8. added a commit that references this issue on Oct 19, 2023
    6f5bcca
  9. added a commit that references this issue on Aug 6, 2024
    c4e0217
  10. added 2 commits that reference this issue on May 11, 2026
    ffecae3
    46a56e1
  11. added a commit that references this issue on May 13, 2026
    f1cd011
  12. added a commit that references this issue on May 14, 2026
    f8208d3
  13. added a commit that references this issue on Oct 13, 2026
    9a32ed8
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions