Syncthing not working (userdata-error?) Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
User avatar
Joulinar
Posts: 2277
Joined: Sat Nov 16, 2019 12:49 am

Re: Syncthing not working (userdata-error?)

Post by Joulinar »

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

Code: Select all

systemctl status syncthing.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Mr.Roboto
Posts: 23
Joined: Tue Nov 05, 2019 10:28 am

Re: Syncthing not working (userdata-error?)

Post by Mr.Roboto »

Code: Select all

● 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).
User avatar
Joulinar
Posts: 2277
Joined: Sat Nov 16, 2019 12:49 am

Re: Syncthing not working (userdata-error?)

Post by Joulinar »

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

Code: Select all

journalctl -u syncthing.service
cat /mnt/dietpi_userdata/syncthing/config.xml|grep 8384
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Mr.Roboto
Posts: 23
Joined: Tue Nov 05, 2019 10:28 am

Re: Syncthing not working (userdata-error?)

Post by Mr.Roboto »

Code: Select all

-- 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).

Code: Select all

<address>0.0.0.0:8384</address>
<localAnnounceMCAddr>[ff12::8384]:21027</localAnnounceMCAddr>
User avatar
Joulinar
Posts: 2277
Joined: Sat Nov 16, 2019 12:49 am

Re: Syncthing not working (userdata-error?)

Post by Joulinar »

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

Code: Select all

failed to load config: open /mnt/dietpi_userdata/syncthing/config.xml: permission denied
Pls can you post entire output of

Code: Select all

ls -la /mnt/dietpi_userdata/syncthing/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Mr.Roboto
Posts: 23
Joined: Tue Nov 05, 2019 10:28 am

Re: Syncthing not working (userdata-error?)

Post by Mr.Roboto »

Code: Select all

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
User avatar
Joulinar
Posts: 2277
Joined: Sat Nov 16, 2019 12:49 am

Re: Syncthing not working (userdata-error?)

Post by Joulinar »

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

Code: Select all

---------- 1 dietpi dietpi 4665 Okt  9 10:12 config.xml
Let's try to fix

Code: Select all

chmod 600 /mnt/dietpi_userdata/syncthing/config.xml
systemctl restart syncthing.service
systemctl status syncthing.service
hopefully status is active (running) now
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Mr.Roboto
Posts: 23
Joined: Tue Nov 05, 2019 10:28 am

Re: Syncthing not working (userdata-error?)

Post by Mr.Roboto »

:D :D :D :D :D :D :D :D :D

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.
User avatar
Joulinar
Posts: 2277
Joined: Sat Nov 16, 2019 12:49 am

Re: Syncthing not working (userdata-error?)

Post by Joulinar »

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.

Code: Select all

drwxr-xr-x  1 root   root     4096 Okt  8 12:25  dietpi_userdata
To get it corrected, you would need to do following.

Code: Select all

chown dietpi:dietpi /mnt/14BEBE5BBEBE3558/dietpi_userdata/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Mr.Roboto
Posts: 23
Joined: Tue Nov 05, 2019 10:28 am

Re: Syncthing not working (userdata-error?)

Post by Mr.Roboto »

I just did that. Vielen Dank für deine Hilfe! :D
Post Reply