Reinstall after drive crash

Installed syncthing on Ubuntu 18.04 a couple/few years ago and the default folder was /home/mylogin/snap/syncthing which had subfolders 498, 501, common and a link called current. There is also a /home/syncthing folder. I’ve synced with my Android phone flawlessly during that time.

Drive failure and upgrade to 20.04. Reinstalled syncthing per instructions on https://apt.syncthing.net and it appears the default folder has changed to /home/mylogin/Sync. When syncthing starts up, it creates that folder fine but errors with:

2021-08-17 17:09:04: Failed to create folder root directory mkdir /butternut_sync: permission denied

I’d just like to get back up and running again. Suggestions and/or pointers to docs would be welcome. I’ve perused the documentation and this forum without finding answers, though admittedly, they may be right in front of me.

Permission errors usually happen if syncthing is executed as the wrong user. Given that you’re using Ubuntu which kind of systemd service did you configure and with which user?

Have you copied the old configuration and database folder or started from scratch?

To me it looks like the path was previously relative to the root directory, which in case of Snap is probably the top level of some sandbox directory. You need to re-add the folder in Syncthing with the correct path if it is not really a directory in your root file system (which sounds awkward for a user service, should be somewhere under your $HOME). You can achieve the same result by editing config.xml while Syncthing is stopped, if you feel confident enough for this route.

Wherever the folder is, checking permissions for the user who runs the Syncthing process is definitely the first thing to do.

Installed from the Live “CD”, erased the disk and chose the encrypt using LVM option, all of which is the same as it was installed previously. Also, used the same computer name and account name as before.

Thanks!

Sorry, I don’t think I said in my original post that I did a full restore of my home directory, which is why I knew what the folders used to be.

I agree that it seems like it should be creating the sync folder under $HOME instead of /, which is why, I’m guessing, I don’t have permission to create it there.

I really don’t remember how I originally installed syncthing, but the path indicates I used snap instead of apt. Should I simply remove the apt version and reinstall using snap or am I better off just getting the apt install figured out so it works?

Thanks!

I’d stick to the apt release and fix the paths in the config. Stop syncthing and edit the config file accordingly:

https://docs.syncthing.net/users/config.html

I found the previous config.xml (there were several in different locations) and copied it to $HOME/.config/syncthing which appears to be where the new configuration files are now held. But when I try to run syncthing, it refuses connection to 127.0.0.1. I tried several other config.xml files before I found the last file I was using and they all started up fine, but none of the previous setup/folders were there. This one appears to contain all the right folders I had last used, but the connection gets refused.

I tried copying the entire old syncthing config folder to the new .config location, but same results. I’m using Shutdown every time, if syncthing actually comes up in the browser or verifying there are no syncthing processes running before making changes.

Any logs?

Discovered after a reboot, that syncthing is running. Opening http://localhost:8384/ in the browser displays what appears to be a new default config and if I view /.config/syncthing/config.xml it is not the file I had copied to that folder.

Stopping syncthing and running it from the command line with a logfile option nets the following (sans My ID, which I don’t know whether is safe to post or not.

[BVNZT] 21:12:31 INFO: syncthing unknown-dev “Erbium Earthworm” (go1.13.5 linux-amd64) unknown@unknown 1970-01-01 00:00:00 UTC [BVNZT] 21:12:31 INFO: My ID: … [BVNZT] 21:12:32 INFO: Single thread SHA256 performance is 181 MB/s using minio/sha256-simd (135 MB/s using crypto/sha256). [BVNZT] 21:12:32 WARNING: Failed to initialize config: Config file version (30) is newer than supported version (28). If this is expected, use -allow-newer-config to override. [BVNZT] 21:12:33 INFO: syncthing unknown-dev “Erbium Earthworm” (go1.13.5 linux-amd64) unknown@unknown 1970-01-01 00:00:00 UTC [BVNZT] 21:12:33 INFO: My ID: … [BVNZT] 21:12:33 INFO: Single thread SHA256 performance is 181 MB/s using minio/sha256-simd (135 MB/s using crypto/sha256). [BVNZT] 21:12:33 WARNING: Failed to initialize config: Config file version (30) is newer than supported version (28). If this is expected, use -allow-newer-config to override. [BVNZT] 21:12:35 INFO: syncthing unknown-dev “Erbium Earthworm” (go1.13.5 linux-amd64) unknown@unknown 1970-01-01 00:00:00 UTC [BVNZT] 21:12:35 INFO: My ID: … [BVNZT] 21:12:35 INFO: Single thread SHA256 performance is 181 MB/s using minio/sha256-simd (135 MB/s using crypto/sha256). [BVNZT] 21:12:35 WARNING: Failed to initialize config: Config file version (30) is newer than supported version (28). If this is expected, use -allow-newer-config to override. [BVNZT] 21:12:36 INFO: syncthing unknown-dev “Erbium Earthworm” (go1.13.5 linux-amd64) unknown@unknown 1970-01-01 00:00:00 UTC [BVNZT] 21:12:36 INFO: My ID: … [BVNZT] 21:12:37 INFO: Single thread SHA256 performance is 181 MB/s using minio/sha256-simd (135 MB/s using crypto/sha256). [BVNZT] 21:12:37 WARNING: Failed to initialize config: Config file version (30) is newer than supported version (28). If this is expected, use -allow-newer-config to override.

…which makes it look like it’s replacing my past good config file with a newer version even though I note that they both say “version=30”. In any case, after attempting to start syncthing, if I’ve dropped my old config.xml in, it replaces it with something else.

You’re starting Syncthing v1.0.0 which is ancient. You should enable Syncthings apt repository and upgrade:

https://apt.syncthing.net/

Well, evidently I had failed to follow instructions and left out step one, failing to add the PGP key. I presume because curl wasn’t installed. So, installed curl, ran sudo apt upgrade and it all works like a charm after permitting both devices.

Thank you very much for your patience and support!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.