Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved Failed to Create Folder in Syncthing Admin - Read Only File System

    Syncthing
    3
    22
    681
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      saint last edited by

      Hi there,

      I am trying to setup syncthing between my server and laptop. However, when I try and create or use an existing directory under /mnt/, /media/, /srv/, etc. I keep getting the same read-only error from the syncthing admin panel.

      syncthing-read-only-error-notice.png

      syncthing-folder-view.png

      I have also tried to login through console as root, and created the directories in CLI, which was successful. Below is an example.

      cloudron-vol-added.png

      But, when I try to add the whatever directory created in CLI in syncthing admin panel, it gives me the same error.

      Last, I have also tried to chmod -R 777 the directory to see if it was an access issue between accounts, but still running into the same issue.

      I am trying to create this "volume" so that I can sync things in from my Laptop, but use Nextcloud's "External Storage" plugin to have it show up in Nextcloud.

      Any tutorials or videos that can help explain what could be going on?

      1 Reply Last reply Reply Quote 0
      • nebulon
        nebulon Staff last edited by

        For a start the volume would probably be mounted in /media/<volumename> instead of /mnt within the app. You can check this with using the webterminal into the app. Then you have to give other users write access for that folder, so syncthing, which runs as cloudron user has access to create the folder and write into it. Then it worked in my testing here.

        S 1 Reply Last reply Reply Quote 0
        • Topic has been marked as a question  nebulon nebulon 
        • S
          saint @nebulon last edited by

          @nebulon Thanks for the reply, so I've gone ahead and tried your suggestion. So far, I haven't had success. Can you see if there's anything I am doing incorrectly?

          I've added the directory to under /media/.

          Screen Shot 2022-09-17 at 1.17.25 PM.png

          And originally, the /sync/ and it's sub-directories were all owned by root.

          From what I understand, cloudron runs as user 1000, so I tried:

          chown 1000:1000 /sync/
          chown 1000:1000 /sync/server_io_mba
          

          Then tried:

          chmod -R 774 ./sync
          

          But am still getting the same error when trying to resume sync in Syncthing.

          As a test to see if could be a permission issue, then tried:

          chmod -R 777 ./sync
          

          But that didn't change anything.

          Is there something I may have missed?

          Thank you!

          S 1 Reply Last reply Reply Quote 0
          • S
            saint @saint last edited by

            Hi guys, following up on this question.

            nebulon 1 Reply Last reply Reply Quote 0
            • nebulon
              nebulon Staff @saint last edited by

              @saint this seems pretty much what I did and got it working there. Do you know why in your screenshot the mountpoint has the red indicator that it is down?

              S 1 Reply Last reply Reply Quote 0
              • S
                saint @nebulon last edited by

                @nebulon For some reason it says it's not mounted.

                Screen Shot 2022-09-22 at 10.50.32 PM.png

                But, I am able to upload files to that Mount Point?

                Screen Shot 2022-09-22 at 11.10.16 PM.png

                At this point, does it make sense to do a private login and see what may be causing this situation? Thank you.

                girish 1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff @saint last edited by girish

                  @saint Since this is mountpoint type, you have to SSH and check why it's not mounted using journactl and mount commands. I guess you set this mountpoint manually ? Check the output of mountpoint /media/sync/server_io_mba

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    saint @girish last edited by

                    @girish So at this point, I feel like I'm grasping at straws.

                    I've deleted the directories, remade them and changed the mount type to "filesystem"

                    Screen Shot 2022-09-24 at 11.07.04 PM.png

                    Now it says it's mounted.

                    But when I do, it tells me it is not mounted.

                    noVNC 2022-09-24 at 11.08.58 PM.jpg

                    I feel like I'm going back-and-forth, and not sure how to move past this and get to what I actually need to do (which is setup syncthing so I can get Sketch files linked to the server.)

                    girish 1 Reply Last reply Reply Quote 0
                    • girish
                      girish Staff @saint last edited by

                      @saint Did you figure this one out?

                      To help debug, let's do this step by step:

                      • Can you tell me what is /media/sync ? Is this really an external disk or external mount ?

                      • You have two choices on how to mount this on the server: Either use the volumes UI to mount the external file system OR mount this by ssh'ing into the server yourself and select the mountpoint type. In the former case, Cloudron will generate the needed systemd mount config files for automatic mounting on server reboot etc. In the latter case, you can consider it totally 'unmanaged' and you have to manage it. Do not choose the 'filesystem' type unless it's really the same disk (internally, what this does is to skip many of the mountpoint tests and thus will make debugging harder).

                      • Once you do the above, we have to get the green icon as the status. If we don't get this, we have to figure out why. I can help further, if you can explain your setup a bit more.

                      S 1 Reply Last reply Reply Quote 0
                      • nebulon
                        nebulon Staff last edited by

                        Lets pick this up again now here instead of the private email support channel, so others can benefit from the information as well.

                        Just to be clear, Cloudron has the host filesystem and then runs apps in containers, which are isolated from the host, but get specific folders (the /app/data as well as volumes) mounted into the container. The permissions of those things will look different from the host system compared to what the app sees. This is to be expected. This is because of how unix user IDs are matched with actual usernames.

                        In your case what you need to do is, to open the webterminal into the synthing app instance and there perform the chown of the folder in the volume which needs to have changed permissions. The user who should own those directories is called cloudron as that is the user with which syncthing runs.

                        1 Reply Last reply Reply Quote 0
                        • S
                          saint @girish last edited by

                          @girish Thanks for your thoughts.

                          Can you tell me what is /media/sync ? Is this really an external disk or external mount?

                          Screen Shot 2022-10-17 at 1.43.17 AM.png

                          From what I can see, both of these are green and my understanding is that it is mounted.

                          Do not choose the 'filesystem' type unless it's really the same disk (internally, what this does is to skip many of the mountpoint tests and thus will make debugging harder

                          I see, is there a recommended approach to selecting the correct Mount Type?

                          @nebulon - Please see below.

                          The user who should own those directories is called cloudron as that is the user with which syncthing runs.

                          I chown'd the user to '1000', as from what I understand that is the user for cloudron. Does this look about right to you?

                          Screen Shot 2022-10-17 at 1.55.01 AM.png

                          Much appreciate it guys.

                          S girish 2 Replies Last reply Reply Quote 0
                          • S
                            saint @saint last edited by

                            Hi @nebulon @girish - Please let me know if the above was helpful, or if I could help provide any additional context.

                            girish 1 Reply Last reply Reply Quote 0
                            • girish
                              girish Staff @saint last edited by

                              @saint said in Failed to Create Folder in Syncthing Admin - Read Only File System:

                              I see, is there a recommended approach to selecting the correct Mount Type?

                              The filesystem was used primarily for migration purposes (from old Cloudron versions). Are you able to mount them with the correct type? If so, I think we need to start there to figure why it's not mounting.

                              Also, I wanted to quickly check why you are using volumes here. Is this because you want to share the data with another app ? If you just want to move the data to another location you can use https://docs.cloudron.io/apps/#data-directory

                              1 Reply Last reply Reply Quote 0
                              • girish
                                girish Staff @saint last edited by girish

                                @saint OK, I went back and re-read your initial post. Your intention is that you will sync using Syncthing and have the files available via the External volumes plugin of nextcloud. This is the reason you want to create a filesystem volume.

                                I think I managed to hit some of the issues you faced but I have sort of got it working. I tried to basically keep things like what you posted in the screenshots.

                                Here's what I did:

                                • First, create a directory /mnt/sync on the server
                                • Important: chmod 777 /mnt/sync. This is required so the containers can write to this directory.
                                • Add the Cloudron volume named Sync as Filesystem (do not use Filesystem (mountpoint) ). When you do this, the icon should be green. After all, there is nothing to mount.
                                • Now, add the volume in Syncthing. Add folder inside Syncthing. You should be able to sync now.

                                Next step, nextcloud:

                                • Add volume to nextcloud.
                                • Enable External plugin. Add /media/Sync in Configuration column to add folder.
                                • I can see the files now.

                                What's missing right now is that I cannot edit files via nextcloud because of permissions issues but can view them. Do you want them to be modifiable in nextcloud ? If so, we have to dig deeper into permissions stuff.

                                1 Reply Last reply Reply Quote 2
                                • girish
                                  girish Staff last edited by

                                  @saint I wrote a doc section that will also help you make it writable across apps - https://docs.cloudron.io/volumes/#sharing

                                  S 1 Reply Last reply Reply Quote 2
                                  • S
                                    saint @girish last edited by

                                    @girish Thanks for the reply, and the documentation.

                                    I feel like I'm running in circles. Following the instructions above, and also the docs, I still keep getting the below:

                                    Screen Shot 2022-11-08 at 12.19.32 AM.png

                                    The directories are all chmod' to 777. I've changed it to "media" as the group owner. But it keep showing that same error.

                                    girish 1 Reply Last reply Reply Quote 0
                                    • girish
                                      girish Staff @saint last edited by

                                      @saint I think syncthing is saying that the mount is read only. Can you check if the volume is mounted as writable in syncthing ? It's a checkbox in the mount ui. (Now that I look at it , maybe we should make it like a drop down to make it clearer).

                                      S 1 Reply Last reply Reply Quote 0
                                      • S
                                        saint @girish last edited by

                                        @girish Am I looking at the right place? I'm in the volumes settings area, but don't see any checkbox in the mount UI?

                                        Screen Shot 2022-11-08 at 8.32.42 PM.png

                                        girish 1 Reply Last reply Reply Quote 0
                                        • girish
                                          girish Staff @saint last edited by

                                          @saint in the UI where you actually mount the volume into the app - https://docs.cloudron.io/apps/#mounts

                                          S 1 Reply Last reply Reply Quote 0
                                          • S
                                            saint @girish last edited by

                                            @girish Ahh, got it. Okay, this is what I see in the Nextcloud storage mount UI.

                                            Yep, I think you're right. It is "read-only"

                                            Screen Shot 2022-11-09 at 11.27.38 PM.png

                                            This is what I see when I added the Volume that's tied to /mnt/sync.

                                            To test, I unchecked it, hit save, then tried to delete & re-add the sync directory in Syncthing.

                                            But, still encountering the same error.

                                            Screen Shot 2022-11-09 at 11.33.55 PM.png

                                            girish 1 Reply Last reply Reply Quote 0
                                            • girish
                                              girish Staff @saint last edited by

                                              @saint if you open a web terminal for the sync thing app, are you able to go into /mnt/sync and touch foo ? I think the core of the issue is that it is for whatever reason read-only.

                                              S 1 Reply Last reply Reply Quote 0
                                              • S
                                                saint @girish last edited by

                                                @girish I followed the example provided at https://docs.cloudron.io/volumes/#sharing and did a 'touch ./test-file'

                                                From what I can see, the directory does appear to have write permissions.

                                                Screen Shot 2022-11-10 at 12.48.07 AM.png

                                                1 Reply Last reply Reply Quote 0
                                                • Topic has been marked as solved  girish girish 
                                                • First post
                                                  Last post
                                                Powered by NodeBB