[Support] Linuxserver.io - Syncthing


Recommended Posts

3 hours ago, gaikokujinkyofusho said:

Not to pry, but was anyone able to figure out how to get syncthing to write versions to an alternate location?

To be honest I forgot about it,  but just having a look now, I think to accomplish what you want you're going to need to use the script.

 

Link to comment

No worries, Thanks for the reponse (better late than never!).

 

Ok, so at least now I know I am on the right track in needing the script but I haven't managed to resolve the issues that I was having with the script.

 

Do you think the script is supposed to be edited? I tried just putting the script as was and also editing but nada, also, where exactly do you think it should go?

Thanks so much!

Link to comment
  • 5 weeks later...

I am trying to use this but I am not sure that I am setting up the container path correctly.  I tried /mnt/user/appdata/syncthing.  Is that where it should be?

 

What I am setting this up to do is to backup files from my unRAID server to another server on my LAN, or perhaps to a portable USB hard drive for my own offsite backups.  Is syncthing the correct tool to do this?

Link to comment
  • 1 month later...

Hi, I am using this docker with great success thanks! but I just have one question....

 

Everything syncthing copies I do not have write access from my desktop pc? (access denied) I cannot find anywhere to change Syncthings permissions to allow this?  any pointers please?

 

Cheers!

Link to comment

Hi, I am using this docker with great success thanks! but I just have one question....

 

Everything syncthing copies I do not have write access from my desktop pc? (access denied) I cannot find anywhere to change Syncthings permissions to allow this?  any pointers please?

 

Cheers!

 

Bumpity bump :-)

Link to comment

PUID and PGID are the parameters in the template to set ownership.  I use Syncthing myself and have no issues, and on Unraid PUID and PGID shouldn't need to be changed at all, as essentially it make the owner of files nobody:users which is the same as Unraid's default.

 

But without more details on your setup it's impossible to say any more really.

  • Upvote 1
Link to comment

 

13 minutes ago, CHBMB said:

PUID and PGID are the parameters in the template to set ownership.  I use Syncthing myself and have no issues, and on Unraid PUID and PGID shouldn't need to be changed at all, as essentially it make the owner of files nobody:users which is the same as Unraid's default.

 

But without more details on your setup it's impossible to say any more really.

 

Hi, Many thanks for your reply!

 

I have not changed the PUID or PGID within Syncthing and I have Syncthing copy files from my seedbox to my unRAID server into the media share. my user on unraid is what I use to connect to the shares from my Windows 10 PC which has read/write access to all my shares which I can delete/rename whatever to any files except those written by Syncthing?

Link to comment

Still can't say,  but the key is you need to start looking at the file permissions and identify what they actually are.  It might be inheriting them from the seedbox?  Once you work out what the file permissions/owner/group are then it makes identifing the cause easier.

  • Upvote 1
Link to comment
2 minutes ago, CHBMB said:

Still can't say,  but the key is you need to start looking at the file permissions and identify what they actually are.  It might be inheriting them from the seedbox?  Once you work out what the file permissions/owner/group are then it makes identifing the cause easier.

 

Here is a screenshot of the files & folders created by Syncthing, does this help?

 

 

sync.JPG

Link to comment
37 minutes ago, CHBMB said:

So, I don't know jack about windows smb permissions, but the owner & group look fine.   If Windows can RW files by nobody:users you should be good as on insugent you have 644 as a perm and parent directory is 744.

 

I just created a folder from my Windows machine in the same folder and I can see the difference in privilages just not sure where the problem lies..

 

 

sync.JPG

Link to comment
Just now, mbc0 said:

 

I just created a folder from my Windows machine in the same folder and I can see the difference in privilages just not sure where the problem lies..

 

 

sync.JPG

 

OK, well that helps.  Files created by windows are as i7quad:users and existing permissions on the files you're having issues with are RWX for nobody R_X for the users, R_X for everyone else.

 

Now as both your Windows machine and your Syncthing files are owned by the same group, essentially it means your Windows box can read and execute files just not write.

 

I can't really help with the next bit, but as I see it, you have two options.

 

1.  Try and find a way to make your existing files RWX for the group, thus allowing Windows to write

2. Get Windows to access the files as nobody:users rather than i7quad:users

 

Unfortunately I'm not sure how to do either of those, Syncthing forum would be a good place to look regarding option 1.  For option 2, that will be something to do with Windows and not something I have a clue about to be honest, but you're definitely on the right track now we've isolated the issue.

  • Upvote 1
Link to comment

Thanks for that, I really appreciate your time!

 

I am looking into changing my Windows connection to nobody as I think that is the easiest solution, I can chmod/chown for the existing files but all new files obviously will not be affected. Thanks again!

Link to comment
  • 1 month later...

Hey friends,

 

How do I set the umask for syncthing?

 

My issue is that files I create on my macbook that get synced to my UnRaid are read only over SMB. I have a theory as to why.

 

The default file permissions on Mac (and every unix I've seen except unraid) are 644 for files and 755 for folders. Files on my macbook are created with these permissions, then synced to the server with this permissions, but under the user nobody:users. They are then read only when you access them over SMB. My testing suggests that samba accesses files as whoever you're logged into the share as. So I log in as chuckdries, my user (or guest it shouldn't matter), and I get hit with a read only because I'm merely a member of group. If I manually chown any given file to chuckdries, suddenly that file is writeable over SMB with 644. From this and Unraid's "New Permissions" tool, we conclude that files need 666 or 777 for UnRaid to operate correctly. The default umask for unraid's root user is 0000, so the default permissions are 666 and 777.

 

The solution is to either set my mac to create files with 666 (lol definitely a last resort) or have syncthing transform the permissions correctly, using the ignore permissions flag.

 

Well, if you set the ignore permissions flag, it defaults to...

(wait for it)

644. :(.

 

The syncthing documentation says you need to specify the umask if you ignore permissions. How can I specify the umask in this container?

 

Thanks in advance for the help!

 

EDIT: thinking about this more, I'm really surprised it isn't a more common issue. In theory it should afflict every linux and mac syncthing user, unless I'm just an idiot and I'm missing something big.

 

EDIT 2: I see the configuration option about setting a user ID. This would mostly work, as I use the same user to log in from all my devices, but my roommate occasionally uses my server for stuff and I want his user to be able to access and edit everything

Edited by CommandLionInterface
Added experimental results
Link to comment
  • 4 weeks later...
  • 4 weeks later...

@mbc0,

@CommandLionInterface,

@CHBMB

 

I requested, and was granted, a change to the docker container. The solution to all your write-on-samba problems is now here.
First, make sure the container is up to date.

Then, edit the docker container and go to "Add another Path, Port or Variable"

The Config type is variable, the Key is "UMASK_SET", and the Value is "000" (all without quotes).
Click on Add, then Apply.
 

Afterwards open the WebUI for the syncthing docker container.

Go to Actions > Advanced.
On EACH of the Folders you have synced to unRAID, check the "ignorePerms" box, and click save.

 

Now, when new files are synced over to unRAID, they can be written to over the network share.

If existing files cannot be edited, use the "New Permissions" tool in unRAID or the "Docker Safe New Permissions Tool" plugin to fix the share that has the problem.

  • Thanks 2
  • Upvote 1
Link to comment

I am having an issue with Syncthing.. It synced over 70% of my primary server to my secundairy (which is standing next to it).

 

I am just trying in here if someone can help, if not, I will write a mail on the product home page of syncthing.

 

The syncthing logfile of my primary server:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...

-------------------------------------
_ _ _
| |___| (_) ___
| / __| | |/ _ \
| \__ \ | | (_) |
|_|___/ |_|\___/
|_|

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donations/
-------------------------------------
GID/UID
-------------------------------------
User uid: 99
User gid: 100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[NYD47] 01:07:16 INFO: syncthing v0.14.39 "Dysprosium Dragonfly" (go1.8.4 linux-amd64) root@4430ab19aba5 2017-10-27 22:54:14 UTC [noupgrade]
[NYD47] 01:07:16 INFO: My ID: NYD476I-JIDSNKM-GBFSVHP-F6SBLHR-XVQZM7N-F6IQYAK-TCXMNSC-P2N3IAJ
[NYD47] 01:07:17 INFO: Single thread SHA256 performance is 197 MB/s using minio/sha256-simd (135 MB/s using crypto/sha256).
[NYD47] 01:07:17 INFO: Hashing performance with weak hash is 165.96 MB/s
[NYD47] 01:07:18 INFO: Hashing performance without weak hash is 202.78 MB/s
[NYD47] 01:07:18 INFO: Weak hash enabled, as it has an acceptable performance impact.
[NYD47] 01:07:28 INFO: Ready to synchronize "Default Folder" (default) (readwrite)
[NYD47] 01:14:20 INFO: Ready to synchronize "Tower-data" (rtecd-abbex) (readonly)
[NYD47] 01:14:20 INFO: Send rate is unlimited, receive rate is unlimited
[NYD47] 01:14:20 INFO: Rate limits do not apply to LAN connections
[NYD47] 01:14:20 INFO: TCP listener ([::]:22000) starting
[NYD47] 01:14:20 INFO: Completed initial scan of readwrite folder "Default Folder" (default)
[NYD47] 01:14:20 INFO: Device NYD476I-JIDSNKM-GBFSVHP-F6SBLHR-XVQZM7N-F6IQYAK-TCXMNSC-P2N3IAJ is "Tower" at [dynamic]
[NYD47] 01:14:20 INFO: Device 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN is "Vault" at [tcp://192.168.1.41:22000]
[NYD47] 01:14:20 INFO: Starting usage reporting
[NYD47] 01:14:20 INFO: GUI and API listening on [::]:8384
[NYD47] 01:14:20 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
[NYD47] 01:14:20 INFO: Established secure connection to 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN at 192.168.1.40:60238-192.168.1.41:22000 (tcp-client) (TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305)
[NYD47] 01:14:20 INFO: Device 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN client is "syncthing v0.14.39" named "Vault"
[NYD47] 02:00:02 INFO: Connection to 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN closed: reading length: read tcp 192.168.1.40:60238->192.168.1.41:22000: read: connection reset by peer
[NYD47] 02:03:48 INFO: Completed initial scan of readonly folder "Tower-data" (rtecd-abbex)
[NYD47] 02:07:58 INFO: Established secure connection to 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN at 192.168.1.40:22000-192.168.1.41:53994 (tcp-server) (TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305)
[NYD47] 02:07:58 INFO: Device 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN client is "syncthing v0.14.39" named "Vault"
[NYD47] 06:42:07 INFO: Connection to 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN closed: reading length: read tcp 192.168.1.40:22000->192.168.1.41:53994: read: connection reset by peer
[NYD47] 06:53:34 INFO: Established secure connection to 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN at 192.168.1.40:22000-192.168.1.41:59340 (tcp-server) (TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305)
[NYD47] 06:53:34 INFO: Device 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN client is "syncthing v0.14.39" named "Vault"

 

The syncthing logfile of my secundary unraid server:

 

-------------------------------------
_ _ _
| |___| (_) ___
| / __| | |/ _ \
| \__ \ | | (_) |
|_|___/ |_|\___/
|_|

Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donations/
-------------------------------------
GID/UID
-------------------------------------
User uid: 99
User gid: 100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[7CCSK] 06:44:35 INFO: syncthing v0.14.39 "Dysprosium Dragonfly" (go1.8.4 linux-amd64) root@4430ab19aba5 2017-10-27 22:54:14 UTC [noupgrade]
[7CCSK] 06:44:35 INFO: My ID: 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN
[7CCSK] 06:44:36 INFO: Single thread SHA256 performance is 305 MB/s using minio/sha256-simd (203 MB/s using crypto/sha256).
[7CCSK] 06:44:36 INFO: Hashing performance with weak hash is 261.76 MB/s
[7CCSK] 06:44:37 INFO: Hashing performance without weak hash is 299.25 MB/s
[7CCSK] 06:44:37 INFO: Weak hash enabled, as it has an acceptable performance impact.
[7CCSK] 06:44:43 INFO: Ready to synchronize "Default Folder" (default) (readwrite)
[7CCSK] 06:53:34 INFO: Ready to synchronize "Tower-data" (rtecd-abbex) (readwrite)
[7CCSK] 06:53:34 INFO: Send rate is unlimited, receive rate is unlimited
[7CCSK] 06:53:34 INFO: Rate limits do not apply to LAN connections
[7CCSK] 06:53:34 INFO: TCP listener ([::]:22000) starting
[7CCSK] 06:53:34 INFO: Completed initial scan of readwrite folder "Default Folder" (default)
[7CCSK] 06:53:34 INFO: Device 7CCSKMK-DCMAXVG-2XBD7HK-22XF4MR-2WKU36O-DJ3QZ52-CW5JEZV-JJHMKAN is "Vault" at [dynamic]
[7CCSK] 06:53:34 INFO: Device NYD476I-JIDSNKM-GBFSVHP-F6SBLHR-XVQZM7N-F6IQYAK-TCXMNSC-P2N3IAJ is "Tower" at [tcp://192.168.1.40:22000]
[7CCSK] 06:53:34 INFO: Starting usage reporting
[7CCSK] 06:53:34 INFO: GUI and API listening on [::]:8384
[7CCSK] 06:53:34 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
[7CCSK] 06:53:34 INFO: Established secure connection to NYD476I-JIDSNKM-GBFSVHP-F6SBLHR-XVQZM7N-F6IQYAK-TCXMNSC-P2N3IAJ at 192.168.1.41:59340-192.168.1.40:22000 (tcp-client) (TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305)
[7CCSK] 06:53:34 INFO: Device NYD476I-JIDSNKM-GBFSVHP-F6SBLHR-XVQZM7N-F6IQYAK-TCXMNSC-P2N3IAJ client is "syncthing v0.14.39" named "Tower"

It basically looks like everything is working, no error messages, the server even says its at 70%.. But it remains at that for days and days... Restarting docker and/or server does not make a difference..

 

The database log is active though:

 

18:54:10.023626 table@compaction committed F-2 S-474B Ke·0 D·2 T·403.784714ms
18:54:10.023912 table@remove removed @5153375
18:54:10.025817 table@remove removed @5017880
18:54:10.026242 table@remove removed @4892481
18:54:10.026635 table@remove removed @4892482
18:54:10.027045 table@remove removed @4892483
18:54:10.027412 table@remove removed @4892484
18:54:10.027516 table@remove removed @4892485
18:54:10.028217 table@remove removed @4593788
18:54:10.028613 table@remove removed @4593789
18:54:10.029045 table@remove removed @4593790
18:54:10.029210 table@remove removed @4593791
18:55:50.598876 table@compaction L3·1 -> L4·5 S·8MiB Q·518126735
18:55:50.639635 table@build created L4@5154414 N·90 S·2MiB "\x00\x00\x00..nfo,v507287658":"\x00\x00\x00..mkv,v46958744"
18:55:50.692242 table@build created L4@5154415 N·48 S·2MiB "\x00\x00\x00..nfo,v46958732":"\x00\x00\x00..mkv,v46882739"
18:55:50.724982 table@build created L4@5154416 N·40 S·2MiB "\x00\x00\x00..nfo,v46882733":"\x00\x00\x00..mkv,v46829899"
18:55:50.800282 table@build created L4@5154417 N·98 S·2MiB "\x00\x00\x00..nfo,v46821656":"\x00\x00\x00..mkv,v180467045"
18:55:50.825914 version@stat F·[0 72 657 5913 15834] S·43GiB[0B 94MiB 995MiB 9GiB 33GiB] Sc·[0.00 0.95 1.00 1.00 0.34]
18:55:50.862967 table@compaction committed F-2 S-386B Ke·0 D·2 T·264.031158ms
18:55:50.863254 table@remove removed @5153379
18:55:50.865455 table@remove removed @5090947
18:55:50.865567 table@remove removed @5090948
18:55:50.865877 table@remove removed @5071123
18:55:50.866164 table@remove removed @5071124
18:55:50.866421 table@remove removed @5071125
18:59:12.842652 table@compaction L3·1 -> L4·2 S·3MiB Q·518126743
18:59:12.873480 table@build created L4@5154418 N·139 S·2MiB "\x00\x00\x00..srt,v172149271":"\x00\x00\x00..avi,v96227265"
18:59:12.921038 table@build created L4@5154419 N·169 S·1MiB "\x00\x00\x00..nfo,v96227241":"\x00\x00\x00..mkv,v141277036"
18:59:12.943405 version@stat F·[0 72 657 5912 15834] S·43GiB[0B 94MiB 995MiB 9GiB 33GiB] Sc·[0.00 0.95 1.00 1.00 0.34]
18:59:12.979282 table@compaction committed F-1 S-293B Ke·0 D·2 T·136.557864ms
18:59:12.979635 table@remove removed @5153393
18:59:12.981871 table@remove removed @4896378
18:59:12.982409 table@remove removed @994746

Anyone any idea what I could do ?

 

Both servers only do a local connect, where I specify the ip address and port..

Link to comment

@Helmonder I have heard that leaving the Web interface open is the kiss of death for speed with syncthing. I don't have much experience using it, but I have read over on their forums that if you close the web ui for both the client and server, suddenly the transfer speed spikes, and everything syncs quickly. One person had a transfer of about 11gb going for days while he was watching it, complained on the forums, tried closing the webpage, and then everything finished sync in an hour or two.

Link to comment
3 hours ago, David Spivey said:

@Helmonder I have heard that leaving the Web interface open is the kiss of death for speed with syncthing. I don't have much experience using it, but I have read over on their forums that if you close the web ui for both the client and server, suddenly the transfer speed spikes, and everything syncs quickly. One person had a transfer of about 11gb going for days while he was watching it, complained on the forums, tried closing the webpage, and then everything finished sync in an hour or two.

 

I read that and my gui is not left open..

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.