Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to create folder root directory mkdir /data1: read-only file system #80

Closed
1 task done
panomitrius opened this issue Jul 14, 2024 · 8 comments
Closed
1 task done

Comments

@panomitrius
Copy link

panomitrius commented Jul 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When adding a new synced folder to /data1/somepath - I get this error in Syncthing GUI:

Failed to create folder root directory mkdir /data1: read-only file system

Expected Behavior

That should work.

Steps To Reproduce

Setting up docker with default config and trying to sync a folder.
creating files in /data1 from shell on docker container works fine, also as user abc.

Environment

- OS: Ubuntu 22.04.3 LTS
- How docker service was installed: package system

CPU architecture

x86-64

Docker creation

docker-compose 

version: "2.1"

volumes:
  syncthing.persistent:
    name: syncthing.persistent
    driver_opts:
      mountpoint: /media/bigdata/syncthing.persistent.image

services:
  syncthing:
    image: lscr.io/linuxserver/syncthing:latest
    container_name: syncthing
    hostname: flourish-syncthing
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Stockholm
    volumes:
      - './config:/config:rw'
      - type: volume
        source: syncthing.persistent
        target: /data1
    ports:
      - 8384:8384
      - 8106:8106/tcp
      - 8106:8106/udp
      - 21027:21027/udp
    restart: unless-stopped

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: v1.27.9-ls150
Build-date: 2024-07-13T01:49:21+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
[start] 2024/07/14 12:11:36 INFO: syncthing v1.27.9 "Gold Grasshopper" (go1.22.5 linux-amd64) root@buildkitsandbox 2024-07-13 01:50:26 UTC [noupgrade]
[ABHYS] 2024/07/14 12:11:36 INFO: My ID: ABHYSVV-ZTJMO22-BKOOKPT-LDE5IIQ-7NXFQ5V-AW4LRRY-JBN6IXF-MFFDXQG
[ABHYS] 2024/07/14 12:11:37 INFO: Single thread SHA256 performance is 307 MB/s using crypto/sha256 (305 MB/s using minio/sha256-simd).
[ABHYS] 2024/07/14 12:11:38 INFO: Hashing performance is 257.05 MB/s
[ABHYS] 2024/07/14 12:11:38 INFO: Overall send rate is unlimited, receive rate is unlimited
[ABHYS] 2024/07/14 12:11:38 INFO: Using discovery mechanism: IPv4 local broadcast discovery on port 21027
[ABHYS] 2024/07/14 12:11:38 INFO: Using discovery mechanism: IPv6 local multicast discovery on address [ff12::8384]:21027
[ABHYS] 2024/07/14 12:11:38 INFO: TCP listener ([::]:8106) starting
[ABHYS] 2024/07/14 12:11:38 INFO: Ready to synchronize "Seedvault" (1q9b0-iw3p9) (sendreceive)
[ABHYS] 2024/07/14 12:11:38 INFO: Ready to synchronize "Default Folder" (default) (sendreceive)
[ABHYS] 2024/07/14 12:11:38 INFO: GUI and API listening on [::]:8384
[ABHYS] 2024/07/14 12:11:38 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
[ABHYS] 2024/07/14 12:11:38 INFO: My name is "May You Flourish and Shine"
[ABHYS] 2024/07/14 12:11:38 INFO: Device ***** is "*****" at [dynamic]
[ABHYS] 2024/07/14 12:11:38 INFO: Device ***** is "*****" at [tcp://*****:22000]
*various folder messages, no errors*
Connection to localhost (127.0.0.1) 8384 port [tcp/*] succeeded!
[ls.io-init] done.
[ABHYS] 2024/07/14 12:11:38 INFO: Completed initial scan of sendreceive folder "Foton (telefonen)" (k2769-pl6fc)
[ABHYS] 2024/07/14 12:11:58 INFO: Detected 0 NAT services

*No error messages. When syncthing GUI gives the error message, nothing appears in docker logs.*
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@Roxedus
Copy link
Member

Roxedus commented Jul 14, 2024

Does user 1000 have permissions to write to /media/bigdata/syncthing.persistent.image? Error claims it doesn't.

@panomitrius
Copy link
Author

panomitrius commented Jul 14, 2024

Does user 1000 have permissions to write to /media/bigdata/syncthing.persistent.image? Error claims it doesn't.

Yea. I can create folders without any problem by sudo -u abc mkdir /data1/telefon-backups through the syncthing docker shell (after installing sudo in it).

I've also set permissions to (-R) 777 (to avoid any permissions issues) on /media/bigdata/syncthing.persistent.image

@tdharris
Copy link

tdharris commented Jul 15, 2024

I have a similar issue as well, it appears the container mounts the additional data volume(s) as container's root user and not the app user despite setting the puid and guid appropriately.. Works for me on another server so I'm not sure what it could be.. Though the working instance was created a long time ago and updated along the way while this problematic instance is new... Both are using the same image currently. I'm running docker as the same user that I have set puid and guid to in container env, host permission and ownership is appropriate. When shelled into the problematic container, I see ownership set to root for the mapped data volumes yet app's /config is a non-root user, abc:users . That explains the permission issue inside the container I would suspect. The older working container shows the data dir ownership within the container as abc user. For me, I do get an error from the log:

WARNING: Failed to create folder marker: mkdir /data/<redacted>/.stfolder: permission denied
...
INFO: Failed initial scan of sendreceive folder "<redacted>" (<redacted>)
WARNING: Error on folder "<redacted>" (<redacted>): folder marker missing (this indicates potential data loss, search docs/forum to get information about how to proceed)

results from shell within the container:

drwx------   4 abc  users 4.0K Jul 15 01:59 config
drwxrwxr-x   3 root root  4.0K Jul 14 23:38 data

@panomitrius
Copy link
Author

Any ideas on this issue? All worked fine for me until recently when I wanted to sync a new folder. I haven't found a way to create new folders.

@LinuxServer-CI
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

@panomitrius
Copy link
Author

@Roxedus Any idea how to solve this?

@panomitrius
Copy link
Author

Seems to work now for some reason!

@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants
@tdharris @Roxedus @LinuxServer-CI @panomitrius and others