[Solved] Invalid argument (is another instance of Syncthing running?)

First off: thanks all for the great software! I’ve been using syncthing as my only file sync solution for… dunno, a long time, feels like forever. :slight_smile:

I’ve been unable to start syncthing on one of my machines for a while now and don’t know how to solve it. All I can get out of it is this:

[monitor] 14:41:17 INFO: Starting syncthing
[NE3US] 14:41:18 INFO: syncthing v1.0.0 "Erbium Earthworm" (go1.11.4 linux-amd64) deb@build.syncthing.net 2018-12-26 16:23:05 UTC [noupgrade]
[NE3US] 14:41:19 INFO: Single thread SHA256 performance is 92 MB/s using minio/sha256-simd (62 MB/s using crypto/sha256).
[NE3US] 14:41:20 INFO: Hashing performance is 47.01 MB/s
[NE3US] 14:41:20 FATAL: Error opening database: sync /home/syncthinger/.config/syncthing/index-v0.14.0.db: invalid argument (is another instance of Syncthing running?)
[monitor] 14:41:20 INFO: Syncthing exited: exit status 1

This is on a VPS using a separate user syncthinger and launched via systemctl or by hand. Of course, I checked, and no, there is no second syncthing process running. That would have been too easy :expressionless:

This started when I moved the homedir of syncthinger to an CIFS share. Since I began using it, my usage pattern has expanded “a bit” (because it’s awesome and convenient :wink: ) and it started using up most of the system’s disk. So I moved the entire homedir to CIFS (a storage box I rent) and mounted it like this in /etc/fstab:

//<mystoragebox>/syncthinger_home /home/syncthinger cifs iocharset=utf8,rw,credentials=/etc/cifs-credentials.txt,uid=syncthinger,gid=syncthinger,file_mode=0660,dir_mode=0770 0 0

The files are all there. I found some advice on similar situations and deleted the /home/syncthinger/.config/syncthing/index-v0.14.0.db. And sure enough, it gets recreated on launch, with these files:

syncthinger:~/.config/syncthing$ ls -l index-v0.14.0.db/
total 11
-rw-r--r--+ 1 syncthinger syncthinger  16 Jan 16 14:56 CURRENT
-rw-r--r--+ 1 syncthinger syncthinger   0 Jan 16 14:56 LOCK
-rw-r--r--+ 1 syncthinger syncthinger 798 Jan 16 14:56 LOG

Luckily, the VPS is not critical to the syncing between the other devices (yay for P2P!) but it does make syncs much more timely and reliable, especially since none of my devices are always online, so I’d like to get it back up and running.

If anyone has an idea what to do about it, that would be great. Thanks all!

The database cannot live on CIFS, unfortunately.


@calmh ah, that explains that, thank you! I didn’t find this detail, my google-foo leaves much to be desired, apparently. :stuck_out_tongue: Given that I have a fair number of shares in /home/syncthinger, I just moved /home/syncthinger/.config/syncthing to a local folder, and symlinked it, and it seems to be purring along now.

1 Like

I know there is a lot of knowledge by the core team, i tried to find this answer in the docs but its not there. Wouldn’t it be nice to put this into the docs with an explanation ? I find a-lot of answers and discussions here on the forum which have not landed into the docs (centralised place). I understand it is a community effort and keeping the docs in good condition is a job on its own.

If it came up often enough it could go in the FAQ.

But it’s easy to look at a log and say “yeah ok, that won’t work because $reason” after the fact. Exhaustively documenting all the things that won’t work beforehand is something else.

I’m sure there are an infinite number of setups that won’t work for whatever reason. Database on CIFS from Linux is apparently one of them, we know that now. Maybe the other network filesystems suffer from the same thing, or maybe they don’t. Maybe CIFS works too with appropriate locking support enabled, or when the client is Windows. Pretty sure exotics like s3fs or gmailfs won’t work either. Anyone wanting to figure this out and document it is welcome to do so. Don’t forget to keep it up to date. :slight_smile:

In this case the OP was good enough to mention the CIFS mount. In general we sort of rely on the fact that it works for most people with normal computers in normal circumstances, and hope that when people run into oddities they think “hmm, this probably works for most people, wonder what is specific about my setup”…


“Syncthing might not work for reasons if your setup isn’t exactly average” would make a great FAQ :smile:


All working Syncthing setups are alike; each broken setup is broken in its own way.


Yes I agree, its sometimes nice to see so many unusual use-cases popping up on the forum. :smiley:

I actually think as long as google indexes this forum, this particular problem will be much easier to sort for future fellow CIFS victims. That being said, I don’t really see a good section to put this in under docs.syncthing.net, maybe a “Troubleshooting” section might be a nice place to collect things that have been debugged on the forums before?

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