Syncthing not working (userdata-error?)

Ok doesn’t seems to be running at all. Pls can you check status of the service

systemctl status syncthing.service
● syncthing.service - Syncthing (DietPi)
   Loaded: loaded (/etc/systemd/system/syncthing.service; disabled; vendor prese
t: enabled)
   Active: failed (Result: exit-code) since Fri 2020-10-09 10:22:50 C
EST; 4h 26min ago
  Process: 819 ExecStart=/opt/syncthing/syncthing -no-browser -no-restart -logfl
ags=0 -home=/mnt/dietpi_userdata/syncthing (code=exited, status=1/FAILUR
E)
 Main PID: 819 (code=exited, status=1/FAILURE)

Okt 09 10:22:50 MediaPi systemd[1]: syncthing.service: Service RestartSec=100ms
expired, scheduling restart.
Okt 09 10:22:50 MediaPi systemd[1]: syncthing.service: Scheduled restart job, re
start counter is at 5.
Okt 09 10:22:50 MediaPi systemd[1]: Stopped Syncthing (DietPi).
Okt 09 10:22:50 MediaPi systemd[1]: syncthing.service: S
tart request repeated too quickly.
Okt 09 10:22:50 MediaPi systemd[1]: syncthing.service: F
ailed with result 'exit-code'.
Okt 09 10:22:50 MediaPi systemd[1]: Failed to start Sync
thing (DietPi).

ok to bad, service is not running. Maybe something wrong on the settings we did. Can you post following

journalctl -u syncthing.service
cat /mnt/dietpi_userdata/syncthing/config.xml|grep 8384
-- Logs begin at Thu 2019-02-14 11:11:59 CET, end at Sat 2020-10-10 07:40:57 CES
T. --
Okt 09 14:50:23 MediaPi systemd[1]: Started Syncthing (DietPi).
Okt 09 14:50:25 MediaPi syncthing[648]: [monitor] INFO: Default folder created a
nd/or linked to new config
Okt 09 14:50:25 MediaPi syncthing[648]: [start] INFO: syncthing v1.10.0 "Fermium
 Flea" (go1.15.2 linux-arm) teamcity@build.syncthing.net 2020-09-15 17:38:23 UTC
Okt 09 14:50:26 MediaPi syncthing[648]: [start] WARNING: Failed to initialize co
nfig: failed to load config: open /mnt/dietpi_userdata/syncthing/config.xml: per
mission denied
Okt 09 14:50:26 MediaPi systemd[1]: syncthing.service: M
ain process exited, code=exited, status=1/FAILURE
Okt 09 14:50:26 MediaPi systemd[1]: syncthing.service: F
ailed with result 'exit-code'.
Okt 09 14:50:26 MediaPi systemd[1]: syncthing.service: Service RestartSec=100ms
expired, scheduling restart.
Okt 09 14:50:26 MediaPi systemd[1]: syncthing.service: Scheduled restart job, re
start counter is at 1.
Okt 09 14:50:26 MediaPi systemd[1]: Stopped Syncthing (DietPi).
Okt 09 14:50:26 MediaPi systemd[1]: Started Syncthing (DietPi).
Okt 09 14:50:26 MediaPi syncthing[711]: [monitor] INFO: Default folder created a
nd/or linked to new config
Okt 09 14:50:27 MediaPi syncthing[711]: [start] INFO: syncthing v1.10.0 "Fermium
 Flea" (go1.15.2 linux-arm) teamcity@build.syncthing.net 2020-09-15 17:38:23 UTC
Okt 09 14:50:28 MediaPi syncthing[763]: [start] WARNING: Failed to initialize co
nfig: failed to load config: open /mnt/dietpi_userdata/syncthing/config.xml: per
mission denied
Okt 09 14:50:28 MediaPi systemd[1]: syncthing.service: M
ain process exited, code=exited, status=1/FAILURE
Okt 09 14:50:28 MediaPi systemd[1]: syncthing.service: Failed with result 'exit-code'.
Okt 09 14:50:28 MediaPi systemd[1]: syncthing.service: Service RestartSec=100msexpired, scheduling restart.
Okt 09 14:50:28 MediaPi systemd[1]: syncthing.service: Scheduled restart job, restart counter is at 3.
Okt 09 14:50:28 MediaPi systemd[1]: Stopped Syncthing (DietPi).
Okt 09 14:50:28 MediaPi systemd[1]: Started Syncthing (DietPi).
Okt 09 14:50:28 MediaPi syncthing[781]: [monitor] INFO: Default folder created and/or linked to new config
Okt 09 14:50:28 MediaPi syncthing[781]: [start] INFO: syncthing v1.10.0 "Fermium
 Flea" (go1.15.2 linux-arm) teamcity@build.syncthing.net 2020-09-15 17:38:23 UTC
Okt 09 14:50:29 MediaPi syncthing[781]: [start] WARNING: Failed to initialize co
nfig: failed to load config: open /mnt/dietpi_userdata/syncthing/config.xml: permission denied
Okt 09 14:50:29 MediaPi systemd[1]: syncthing.service: M
ain process exited, code=exited, status=1/FAILURE
Okt 09 14:50:29 MediaPi systemd[1]: syncthing.service: F
ailed with result 'exit-code'.
Okt 09 14:50:29 MediaPi systemd[1]: syncthing.service: Service RestartSec=100ms
expired, scheduling restart.
Okt 09 14:50:29 MediaPi systemd[1]: syncthing.service: Scheduled restart job, re
start counter is at 4.
Okt 09 14:50:29 MediaPi systemd[1]: Stopped Syncthing (DietPi).
Okt 09 14:50:29 MediaPi systemd[1]: Started Syncthing (DietPi).
Okt 09 14:50:29 MediaPi syncthing[797]: [monitor] INFO: Default folder created a
nd/or linked to new config
Okt 09 14:50:30 MediaPi syncthing[797]: [start] INFO: syncthing v1.10.0 "Fermium
 Flea" (go1.15.2 linux-arm) teamcity@build.syncthing.net 2020-09-15 17:38:23 UTC
Okt 09 14:50:30 MediaPi syncthing[797]: [start] WARNING: Failed to initialize co
nfig: failed to load config: open /mnt/dietpi_userdata/syncthing/config.xml: permission denied
Okt 09 14:50:30 MediaPi systemd[1]: syncthing.service: Main process exited, code=exited, status=1/FAILURE
Okt 09 14:50:30 MediaPi systemd[1]: syncthing.service: Failed with result 'exit-code'.
Okt 09 14:50:30 MediaPi systemd[1]: syncthing.service: Service RestartSec=100msexpired, scheduling restart.
Okt 09 14:50:30 MediaPi systemd[1]: syncthing.service: Scheduled restart job, restart counter is at 5.
Okt 09 14:50:30 MediaPi systemd[1]: Stopped Syncthing (DietPi).
Okt 09 14:50:30 MediaPi systemd[1]: syncthing.service: Start request repeated too quickly.
Okt 09 14:50:30 MediaPi systemd[1]: syncthing.service: Failed with result 'exit-code'.
Okt 09 14:50:30 MediaPi systemd[1]: Failed to start Syncthing (DietPi).



<address>0.0.0.0:8384</address>
<localAnnounceMCAddr>[ff12::8384]:21027</localAnnounceMCAddr>

Ok there seems to be an issue with accessing the config file

failed to load config: open /mnt/dietpi_userdata/syncthing/config.xml: permission denied

Pls can you post entire output of

ls -la /mnt/dietpi_userdata/syncthing/
insgesamt 31
drwx------ 1 dietpi dietpi 4096 Okt  9 10:12 .
drwxr-xr-x 1 root   root   4096 Okt  9 10:20 ..
-rw-r--r-- 1 dietpi dietpi  648 Okt  8 12:25 cert.pem
---------- 1 dietpi dietpi 4665 Okt  9 10:12 config.xml
-rw------- 1 dietpi dietpi 4667 Okt  8 12:25 config.xml.v0
-rw-r--r-- 1 dietpi dietpi  639 Okt  8 12:25 https-cert.pem
-rw------- 1 dietpi dietpi  288 Okt  8 12:25 https-key.pem
drwxr-xr-x 1 dietpi dietpi 4096 Okt  9 01:27 index-v0.14.0.db
-rw------- 1 dietpi dietpi  288 Okt  8 12:25 key.pem

ok strange. Your config file has no permissions at all. That’s a good reason for not being accessible.

---------- 1 dietpi dietpi 4665 Okt  9 10:12 config.xml

Let’s try to fix

chmod 600 /mnt/dietpi_userdata/syncthing/config.xml
systemctl restart syncthing.service
systemctl status syncthing.service

hopefully status is active (running) now

:smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley:

It’s working!!! Thanks a lot!!!

I really did nothing manually to break anything. Maybe this long thread might help someone with the same issue.

I guess whole issue was caused by the fact that your dietpi_userdata has incorrect ownership. Actually it is owned by root user but usually it should be dietpi user. Therefore you had issues during installation as DietPi was not able to write to this file system.

drwxr-xr-x  1 root   root     4096 Okt  8 12:25  dietpi_userdata

To get it corrected, you would need to do following.

chown dietpi:dietpi /mnt/14BEBE5BBEBE3558/dietpi_userdata/

I just did that. Vielen Dank für deine Hilfe! :smiley:

Gerne :smiley: