MacBook files not syncing to Raspberry Pi

I originally posted this on the r/Syncthing subreddit but haven’t got any replies there yet so hoping I’ll get some here

https://www.reddit.com/r/Syncthing/comments/1gk8y4e/macbook_files_not_syncing_to_raspberry_pi/

So I wanted to try Syncthing, and I installed it on my MacBook and my Raspberry Pi. I connected them and shared a folder between them and at first it seems to have worked, but then I noticed something. New files, and changes made to those files, only get synced from the Raspberry Pi to the Mac, not the other way around.

I made a file on my RPI named “test” containing the text “testa”. It showed up on my Mac. Then I tried to edit the file on my Mac to say “testb”, but on my RPI it still says “testa”. I made a few more files on my RPI, they all appear on the Mac, I edit them on my RPI, and the edits appear on the Mac. But if I ever change them on the Mac that change doesn’t sync to the RPI. Also if I make a new file on the Mac it does not appear on the RPI

I rebooted the Mac and now the files and their changes appeared on the RPI, but if I make any new files or changes they don’t appear on the RPI (until I reboot my mac, presumably).

Another thing I noticed, I set them both as introducers to each other and the web GUI showed a message saying I shouldn’t do that. So on my RPI I edited the mac to not be an introducer, but it still shows the message on the RPI web gui. The message did disappear on the mac though.

Another thing I thought I should add, both devices are running Yggdrasil and I disabled both global and local discovery, and manually configured them to connect to their Yggdrasil addresses.

Welcome here @OMG !

Please post screenshots of the Web GUI on both devices. We are particularly interested in how the folder is configured on both ends.

The message about them both being introducers did disappear after I restarted Syncthing on the RPI, but files from the Mac still don’t sync to the RPI, only the other way around.

@martinleben Could you clarify whether your silence was due to an inability/unwillingness to help with this issue, or if you simply didn’t see my reply? Cause if it’s the first then I’m sorry to bother you and I guess I’ll try to find help elsewhere but if it’s the second then I’m reminding you of it now, since if I don’t say anything the topic will close tomorrow.

Hello @OMG !

I am sorry, I missed your feedback.

To begin with, messages about introducer etc is not related to the sync problem you observe. Introducer is a mechanism which makes it easier to create a full mesh network in case you want it. I personally have never used it, so I cannot offer any more insight on this subject.

  • I see that “Folder Type” on both devices is “Send & Receive”, which is good because based on your first post that is your intention.
  • I see that both devices have the watcher enabled, which should detect changes more or less immediately.
  • I see that both devices have 1 hour scan interval. This is also good, as it is a kind of insurance that changes will be detected even in case the watcher misses something.

So … Sorry, but I do not see the source of the problem based on the information you have shared so far. Are there any error messages in the console logs?

Can someone else chime in and help here?

Good luck!

Well thank you for trying!

Are you using .stignore?

@chaos I don’t think so. On which device would that be? Cause the mac isn’t ignoring files from other devices, only files from the mac are being ignored. Tried connecting 2 more devices to the RPI and they can sync files to and from eachother just fine. Only the mac can’t add, remove, or change files.

On either device, please.

You would see a file called .stignore at the root of the shared Folder. You can also go to the Folder in the web GUI, click on Edit and click on Ignore Patterns.

If the answer is “no,” that means something else is going on.

One thing to confirm would be file rights. Please post the output of ps -ef | grep syncthing in Terminal on your Mac and your rPi to see who owns the two Syncthing processes (two is normal), and do the same with ls -l followed by the full path of the Folder you’re trying to use, which will show us the rights of that path.

If neither of those are fruitful, we should look to log messages as was suggested up thread.

@chaos

lowe.cregard@lowecregard-K9NN9HGL02 ~ % ps -ef | grep syncthing
  501  1075  1069   0  3:04PM ??         0:00.24 /Applications/Syncthing.app/Contents/Resources/syncthing/syncthing -no-browser -no-restart -logfile=default
  501  1141  1075   0  3:04PM ??         0:24.96 /Applications/Syncthing.app/Contents/Resources/syncthing/syncthing -no-browser -no-restart -logfile=default
  501  3345  3333   0  6:51PM ttys000    0:00.00 grep syncthing
lowe.cregard@lowecregard-K9NN9HGL02 ~ % ls -l /Users/lowe.cregard/Sync
total 861032
-rw-r--r--@ 1 lowe.cregard  staff      34821 Dec  8 17:57 Passwords.kdbx
-rw-r--r--@ 1 lowe.cregard  staff  440797477 Nov 17 17:53 Passwords01.kdbx
-rw-r--r--  1 lowe.cregard  staff          5 Dec  8 17:39 test
-rw-r--r--  1 lowe.cregard  staff          7 Dec  8 17:42 testa
-rw-r--r--  1 lowe.cregard  staff          6 Dec  8 18:57 testb
pumpkin314@raspberrypi:~ $ ps -ef | grep syncthing
pumpkin+   64273       1  0 Nov07 ?        00:02:32 /usr/bin/syncthing serve --no-browser --no-restart --logflags=0
pumpkin+   64283   64273  0 Nov07 ?        01:22:47 /usr/bin/syncthing serve --no-browser --no-restart --logflags=0
pumpkin+  456349  456320  0 18:55 pts/1    00:00:00 grep --color=auto syncthing
pumpkin314@raspberrypi:~ $ ls -l /home/pumpkin314/sync
total 430512
-rw-r--r-- 1 pumpkin314 pumpkin314     34821 Dec  8 17:57 Passwords.kdbx
-rw-r--r-- 1 pumpkin314 pumpkin314 440797477 Nov 17 17:53 Passwords01.kdbx
-rw-r--r-- 1 pumpkin314 pumpkin314         5 Dec  8 17:39 test
-rw-r--r-- 1 pumpkin314 pumpkin314         7 Dec  8 17:42 testa
1 Like

At the time your screenshots were taken, you weren’t using Syncthing’s ignore files feature because the web UI would have had a “Reduced by ignore patterns” right below the global and local state results, e.g.:

ignore_patterns

And the two other devices syncing to the RPi are also using Yggdrasil? What types of devices are they?

Are your RPi, the two recently added devices, and your MacBook (the one having the syncing issue) on the same LAN or are they syncing over the internet?

On a related note…

Given the available info and symptoms you’ve described, I’m currently leaning towards it being a network connectivity issue rather than it being Syncthing.

Would you mind sharing the goal/reason for tunneling Syncthing connections thru Yggdrasil? Having more details about how Yggdrasil is being used in your setup would help with debugging the syncing issue on your MacBook.

1 Like

@gadget All of the devices are running Ygddrasil, if they weren’t they wouldn’t be able to connect since I configured them to connect to their yggdrasil addresses and I disabled discovery (both local and global). As for whether they are on the same LAN or not changes when I leave the house with my mac and move it out of range. Yggdrasil nodes can peer over the LAN or over the internet. All of my devices are configured to peer over the LAN, as well as to a few other peers over the internet. So when my devices are on the same LAN they connect over the LAN, but when they leave the LAN the connections have to go through those other peers on the internet.

Idk if using yggdrasil is strictly neccessary, I could probably configure my mac to connect to our networks ip and use UPnP to connect to the RPI (don’t have access to the router so can’t configure port forward). I don’t think we have a static IP though so it might change and then my mac wouldn’t be able to connect. I think that’s what global discovery is for, but that seems a little centralised.

Either way yggdrasil doesn’t seem to be causing any issues for my other devices so I don’t think that’s the issue. As for it being some kind of connectivity issue, it’s possible, but both the mac and RPI say they are both connected and up to date.

I will note that the issue seems to have changed a little since when I made this topic. Originally the files from the mac wouldn’t sync to the RPI except for when it booted, meaning I would have to reboot my mac everytime I added, changed, or deleted a file on it (well it was probably when Syncthing started meaning I could just restart Syncthing, still a bit annoying).

Now however it seems files do sync eventually, just takes a couple of hours. I made a file named “testb” on my mac at 18:57 yesterday, and now today when I ran “ls sync” on the RPI it was there. I checked the recent changes on my mac, and it says the file was synced at 00:11 today, 5 hours and 14 minutes after the file was created. The fact that it does sync is better I guess, but 5 hours to sync a 6 byte file is not ideal. Hopefully I can get it to sync faster.

Also for some reason it says the file was in the Default Folder, which is strange since I don’t use that folder, and I ran “cd Sync” before I created the file, so it should only have been in that directory, not anywhere else.

Why can’t I edit my reply?

Thanks for the clarification. In your screenshots, the “This Device” panel says “Listeners 2/2”, meaning that Syncthing was configured and listening on two network addresses. So for example, it’s possible for your RPi to accept connections via Yggdrasil and also outside of it.

Occasionally there’s someone trying to use a mesh VPN as a solution to a LAN connectivity issue involving multiple subnets, so it’s good that it’s not the case here.

Probably one of the most popular reasons for using mesh networks.

Alternatively, a dynamic DNS service could be used if your home IP address frequently changes.

Note that Yggdrasil also relies on peers to pass along routing info (i.e. mapping 0200::/7 IPv6 addresses used by Yggdrasil to the actual internet IPv4/IPv6 addresses), so your Mac and RPi wouldn’t be able to find each another without them.

Yggdrasil is decentralized – without dependency on a singular peer – but the same really could be said about Syncthing’s cluster of discovery servers and the option for anyone to spin up discovery servers for private or public use.

Shortly before I saw your post above, I was thinking about the screenshots you posted earlier and remembered seeing that you had used ~/sync as the folder path for the Syncthing folder labeled “sync”.

When Syncthing is started without an existing configuration it automatically creates a directory at the path ~/Sync along with a Syncthing folder labeled “Default Folder” pointing to it.

The catch is that macOS by default ignores case-sensitivity, so your ~/sync and Syncthing’s auto-created ~/Sync are the same target in macOS’s eyes.

Because you didn’t pause or remove “Default Folder”, you effectively have two Syncthing folders pointing at the same target directory with Syncthing watching it twice and also regularly scanning it twice. So when you did a cd Sync then created the file testb, Syncthing essentially saw two conflicting files. (I’m unsure if what Syncthing does in such a scenario is even well defined.)

First thing I’d recommend is removing “Default Folder”. It might end up solving your very slow MacBook to RPi sync problem, but at the very least it’ll improve overall efficiency.

1 Like

I think there’s a temporary hold on new users to avoid potential issues with spammers, etc.

1 Like

@gadget

Well Yggdrasil isn’t really meant to be a VPN (although you can use it that way), it’s a proof of concept implementation of an experimental routing scheme, which I find very interesting, hence why I use it.

This is incorrect, yggdrasil won’t connect to another node over the internet unless the ip for that node has been added to the configuration file, and nodes don’t share IP addresses with other nodes (except for yggdrasil 0200::/7 addresses). The 0200::/7 IPv6 addresses are instead mapped to coordinates on the spanning tree. The coordinates can be used to calculate the distance between any given nodes. For example you can calculate the distance between nodes A and B, by adding the number of nodes in the path from node A up to the common ancestor, to the number of nodes in the path from node B up to the common ancestor.

Yggdrasil nodes are aware of the coordinates of all their peers, so when it wants to send a packet to another node on the yggdrasil network it calculates which of the nodes is the closest to the destination node and sends it there. Then that node does the same calculation and sends the packet to another node that is closer, and so the packet gets closer and closer until it reaches the destination.

That’s true, however if I ever end up in a situation where I don’t have an internet connection, but do have a connection to an yggdrasil network running outside of the internet my nodes will still be able to connect. I guess in such a situation I could still use a discovery server running on that yggdrasil network, but then I would actually need the yggdrasil IP or domain of that server (assuming there even is a domain for it) which I might not be able to get. And in such a situation my nodes could just connect to eachothers yggdrasil addresses so the discovery server would be unneccesary. Although such a situation would probably be very unlikely.

When I first remembered hearing about syncthing all my nodes were already running yggdrasil and could reach eachother so after learning about discovery servers and relays I just figured why bother with all that when my devices can already reach eachother. So after installing Syncthing I just manually configured them to connect to eachother yggdrasil addresses.

I too noticed this when I deleted the default folder on one of my devices earlier this day, and was planning to delete it on my mac as well, but I was busy and forgot to. Now that you reminded me of it I did delete it, which should hopefully fix my issues.

The thing is I can edit some of my other replies, but not that one

Update: The issue seems too have dissapeared completely after deleting the default folder! Is there a way to mark topics on here as “resolved”?

You let us know, just like you did :-). I’m glad it’s working!