Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Syncthing permission errors
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
zsoltiv
n00b
n00b


Joined: 12 Jan 2022
Posts: 2

PostPosted: Wed Feb 16, 2022 8:13 pm    Post subject: [SOLVED] Syncthing permission errors Reply with quote

I'm having a little trouble with getting Syncthing to start on boot.
It was working until a while ago, but stopped.
When I check the service's status, it says
Code:
* status: crashed

The log file says it can't open its database:
Code:

[start] 20:49:35 INFO: syncthing v1.19.0 "Fermium Flea" (go1.17.5 linux-amd64) portage@localhost 2022-02-16 18:57:02 UTC [noupgrade]
[start] 20:49:35 WARNING: Error opening database: open /home/zsolti/.config/syncthing/index-v0.14.0.db/LOCK: permission denied (is another instance of Syncthing running?)
[monitor] 20:49:35 INFO: Syncthing exited: exit status 1
[start] 20:49:36 INFO: syncthing v1.19.0 "Fermium Flea" (go1.17.5 linux-amd64) portage@localhost 2022-02-16 18:57:02 UTC [noupgrade]
[start] 20:49:36 WARNING: Error opening database: open /home/zsolti/.config/syncthing/index-v0.14.0.db/LOCK: permission denied (is another instance of Syncthing running?)
[monitor] 20:49:36 INFO: Syncthing exited: exit status 1
[start] 20:49:37 INFO: syncthing v1.19.0 "Fermium Flea" (go1.17.5 linux-amd64) portage@localhost 2022-02-16 18:57:02 UTC [noupgrade]
[start] 20:49:37 WARNING: Error opening database: open /home/zsolti/.config/syncthing/index-v0.14.0.db/LOCK: permission denied (is another instance of Syncthing running?)
[monitor] 20:49:37 INFO: Syncthing exited: exit status 1
[start] 20:49:38 INFO: syncthing v1.19.0 "Fermium Flea" (go1.17.5 linux-amd64) portage@localhost 2022-02-16 18:57:02 UTC [noupgrade]
[start] 20:49:38 WARNING: Error opening database: open /home/zsolti/.config/syncthing/index-v0.14.0.db/LOCK: permission denied (is another instance of Syncthing running?)
[monitor] 20:49:38 INFO: Syncthing exited: exit status 1
[monitor] 20:49:39 WARNING: 4 restarts in 4.045874202s; not retrying further

There are no other instances running:
Code:

~ % pgrep -i syncthing
~ %

I am running Syncthing as an unpriviliged user:
Code:

# /etc/conf.d/syncthing: config file for /etc/init.d/syncthing

# User and group as which to run
SYNCTHING_USER="zsolti"
SYNCTHING_GROUP="zsolti"

# Configuration directory
SYNCTHING_HOMEDIR="/home/zsolti/.config/syncthing"

# Log file location
SYNCTHING_LOGFILE="/var/log/syncthing/syncthing.log"

# umask used to create files
# The default allows group access
SYNCTHING_UMASK=740

# I/O nice level of syncthing
#SYNCTHING_IONICE="0"

# Nice level of syncthing
#SYNCTHING_NICE="0"

# Where the syncthing GUI should listen. Can be a http(s) URI or a Unix domain socket
#SYNCTHING_GUI_ADDRESS="http://127.0.0.1:8384"
#SYNCTHING_GUI_ADDRESS="unix:/run/syncthing.sock"

# Extra options for syncthing
#SYNCTHING_OPTS=""

The umask on the config directory is 760, however it seems the `index-v0.14.0.db` file doesn't have these for some reason:
Code:

~ % ls -l .config/syncthing
total 36
-rwxrw---- 1 zsolti syncthing  794 Sep 27 19:20 cert.pem
-rwxrw---- 1 zsolti syncthing 9675 Feb 16 19:30 config.xml
-rwxrw---- 1 zsolti syncthing  132 Feb 16 19:42 csrftokens.txt
-rwxrw---- 1 zsolti syncthing  786 Sep 27 19:20 https-cert.pem
-rwxrw---- 1 zsolti syncthing  288 Sep 27 19:20 https-key.pem
d-----xr-x 2 zsolti zsolti    4096 Feb 16 20:14 index-v0.14.0.db
-rwxrw---- 1 zsolti syncthing  288 Sep 27 19:20 key.pem

If I remove the `index-v0.14.0.db` directory and run Syncthing as a regular user, everything works fine. It recreates the database directory, with sufficient permissions (644), however I would like to start syncthing via the OpenRC script if possible.
I would appreciate if someone could tell me what I'm doing wrong :)


Last edited by zsoltiv on Wed Feb 16, 2022 9:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Feb 16, 2022 9:18 pm    Post subject: Reply with quote

umasks are masks. Permission bits must be inverted. It should be 0027 instead of 0750. See 'man umask'.
Back to top
View user's profile Send private message
zsoltiv
n00b
n00b


Joined: 12 Jan 2022
Posts: 2

PostPosted: Wed Feb 16, 2022 9:28 pm    Post subject: Reply with quote

mike155 wrote:
umasks have an inversed notation. It should be 037 instead of 740. See 'man umask'.


Oops. it seems I have misunderstood the meaning of umasks. I have changed it, deleted the db file, and now it is working fine!
Thanks a lot!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum