OMV Syncthing Troubles

Hey everyone

I’ve been working on a project for my parents over the past few months, but I seem to have hit a wall. Essentially, I’m trying to get an instance of OMV running on a small server for them to automatically backup their photos from their phones, and then let them access those pictures from their computer. I had planned on using Syncthing for this, though I’ve hit some major issues with actually accomplishing that. In OMV5 it turns out you have to use Docker for the install and run it in a container, problem is I have zero experience in Docker.

The problem that I’m having is that no matter what I do, I cant seem to get the Syncthing Docker (Container? Not sure what the right term is, sorry) to reference the shared folder I’ve created in OMV. I think my issues stem from the fact that I don’t know how Docker references folder locations, though that might be way off too. To be frank, I’m not sure I know exactly what the issue is, but I think this is it. I’ve tried installing with this guide, as well as this one, and then finally with a compose script. None have worked so far, but I’ll post the compose below if anyone wants to take a look to see if there’s anything egregiously wrong. One of the folks over at the OMV forum provided this, so I’ve been working off of it.


version: “2.1”
services:
syncthing:
image: ghcr.io/linuxserver/syncthing
container_name: syncthing
hostname: syncthing #optional
environment:
- PUID=1001 #the first user created in the GUI of OMV has the UID 1001
- PGID=100 #OMV adds user by default to the group users which has GID 100
- TZ=America/Indianapolis #adjust as needed
volumes:
- /srv/dev-disk-by-uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed/config_syncthing:/config #adjust the left side of the “:” to your needs
- /srv/dev-disk-by-uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed/Photos #adjust the left side of the “:” to your needs
ports:
- 8384:8384
- 22000:22000/tcp
- 22000:22000/udp
- 21027:21027/udp

tl;dr

I’ve installed Syncthing on OMV in Docker, but cant get it to recognize the folder I would like to sync, which was created in OMV prior to this. I also cant seem to get the Syncthing server to actually copy or sync any files over from clients, or other devices I’ve connected. I’m not sure if this is a “no transfer” issue, or simply it isn’t syncing to the folder where I’m looking. I’ve checked permissions, and tried installing a few different ways, but feel very out of my depth.

If anyone can give me some pointers or help walk me through this that would be great! I’ve also recently started thinking about trying to get this to work with Rsync, since really all we’re looking for is copying the photos over to a backup. Is that the better solution here? At this point I almost want to stick with Syncthing, just to figure out this Docker business a bit more, but I also need this out of my hair before too long. Either way, any help or thoughts would be great, thanks!

From my understanding is that Docker was made to “isolate” OMV and not have access to files outside the container and vice versa?

You should probably use a bare metal instance of OMV rather than running it in a Docker container so that syncthing can have access to it

I am no Docker expert, and hope one will chime in. But something here does look odd to me. The “volumes” entries are describing the connection between dirs in your server (left of the colon, the “:”) and the Docker container (right of the colon).

Both entries have comments re adjusting the part to the left. But the second entry doesn’t actually contain a colon; it looks like there should be one just left of “/Photos”. Maybe that’s just a typo as you transcribed the info? Or maybe it is causing the issue?

Does your host have a directory /srv/dev-disk-by-uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed and a subdir config_syncthing under it? If not, you need to change these strings to match the locations where you want to store configuration info and the photos.

Either of those thoughts strike a chord? Hope so, and wish you good luck. Then again, I like rsync too and it might be more straightforward.

2 Likes

@regulareel

Sorry, I wasn’t clear. OMV is running on bare metal, Docker is running inside of OMV as an extra. You have to run certain extras inside of docker due to compatibility issues, or something of that note, Syncthing being one of them.

@Caped_Kibitzer

Good catch! That’s a typo on my part, so I’ll start there. I want to make sure I understand correctly, the colon in this case essentially separates the location of the directory on the server vs. in docker?
So, in a simple example like /myRoom/myCloset/:/Closet, any shirts in the closet in my room would also show up in my docker closet? Sorry, having examples like this just helps me to make sense of things a bit better, might not be the perfect metaphor though.

I believe it does, though I’ll have to check in a bit once I’m home. To be clear here, I’d like the directories to be separate for the config and where I store the data, I just need to make sure they’re both pointed at the right location, correct? Potentially:
/srv/dev-disk-by-uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed and a subdir config_syncthing
for the config
/srv/dev-disk-by-uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed/Photos
for the photos?

In that example, I know for a fact that the “Photos” directory exists at that location. Presuming the other config directory does as well, it shouldn’t matter it’s in a different directory, so long as the location is accurate, correct?

Your closet example sounds roughly right, though I would say that it is like a single closet with two doors, which you can enter from the bedroom (Host) or the bath (Docker). Another way to think of it is something like a symbolic link (aka “shortcut” in Windows).

You are correct that the host dirs mapped to the Docker /config & /Photos just need to exist & be valid; it is not a problem that they are different. It is best not to make them both the exact same dir, since Docker has set up different dirs for the two purposes. There could be a file name conflict if both were the exact same dir.

If it turns out that the compose file does have a valid setup, but the Docker program still can’t find the folder, it might be good to check on the permissions for the dir on the host. Alas, I am not familiar enough with Docker to know what permissions are needed.

OK, I’ve been googling a bit, and have an additional guess (shaky because I have only “google knowledge” here). It seems that the UIDs & GIDs used in a Docker container must align with those used in the host.

My tentative understanding is that the host dir permissions must allow RWX access for the UID & GID used in the Docker container. (Makes sense to you?) It may also be necessary to be a user with that UID & GID when you run the Docker command that starts the container.

I further guess that the PUID & PGID entries in the Compose file are intended to make it easy to set up the UID & GID to be compatible with your host setup.

Hope this helps; sorry it is a bit tentative.

1 Like

Also, you might get the attention of more-expert forum members if you repost your request to the “The small linux problem thread” in the Software & Operating Systems > Linux category.

Absolutely not required. I have a OMV5 install on a box and it has the debian (.deb) syncthing installed on bare metal. OMV is built on top of Debian, so most things you can do with standard Debian also can work on OMV.

Sure, there is not plugin through the web GUI, so it does require installing through the command line.

You can get official syncthing builds for apt platforms with instructions here: https://apt.syncthing.net/

This part is where the translation between the docker container file system and your native file system happens.

So on your host, if you create a file called readme.txt in /srv/dev-disk-by-uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed/config_syncthing, then readme.txt will show up in your container inside /config. And vise versa, so anything you change under /config in the container will be changed under /srv/dev-disk-by-uuid-5afa6ae2-2da6-44ab-8296-0248b37e70ed/config_syncthing on the host.

@Caped_Kibitzer you beautiful bastard, this was the issue. Everything is working now! You’re right, I just forgot to add that portion in, everything is chooching along now. Thank you!

Sorry, I guess I should have been more clear. I definitely could run on bare metal, though I hadn’t considered that before, so this is a point well taken.

1 Like