# Syncthing killed repeatedly - no errors

**URL:** https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467
**Category:** Support
**Created:** [April 9, 2018, 11:13am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467 "2018-04-09T11:13:48Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 9, 2018, 11:13am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/1 "2018-04-09T11:13:48Z")

</div>

Version: syncthing v0.14.46 “Dysprosium Dragonfly” (go1.10.1 linux-arm) [deb@build.syncthing.net](mailto:deb@build.syncthing.net) - on a Raspi

I have now seen this for the second or third time:  
Syncthing suddenly just not running anymore.  
This time i checked: `sudo service syncthing@sync status`  
With this output:

```
● syncthing@sync.service - Syncthing - Open Source Continuous File Synchronization for sync
   Loaded: loaded (/lib/systemd/system/syncthing@.service; enabled)
   Active: inactive (dead) since Mo 2018-04-09 00:14:26 UTC; 10h ago
     Docs: man:syncthing(1)
  Process: 4304 ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0 (code=killed, signal=PIPE)
 Main PID: 4304 (code=killed, signal=PIPE)

```

In the journal there was no error message at the end. What could be causing this?

I have one suspect:  
I have one folder which is VERY big (more than a million files, \>100GB).  
I have seen this before, that while scanning this folder syncthing stopped working. My guess would be that there is some kind of is-alive-check of the system to verify that the service is still running, but probably when the scan takes too long it is not responding or not generating a heartbeat or whatever triggers the is-alive-check. Thus the service is killed.

When i paused this particular folder the service survived.  
When i first paused it until al other folders were scanned (after restart) and then activated it, syncthing would also survive.

Anyway … it seems connected. (But of course this could be coincidence as well …)

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [April 9, 2018, 11:17am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/2 "2018-04-09T11:17:53Z")

</div>

32 bit arm build, most likely running out of memory while scanning that folder.

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 9, 2018, 11:25am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/3 "2018-04-09T11:25:04Z")

</div>

Sounds reasonable.

I actually had a similar problem with the 32bit dev-build (from another ticket) on my windows machine this morning. There was a popup from windows saying syncthing had a memory problem. Didn’t think about it more though. But synchting was using almost 1GB of RAM at that time.

Two questions:

- Could you add a proper error-message in that case so it’s easy to understand?
- Is there any way to work around this? I mean the machine is 32bit with low RAM, can’t change that. Maybe could you optimize / reduce the memory-usage?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [April 9, 2018, 11:31am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/4 "2018-04-09T11:31:57Z")

</div>

If it dies due to failure to allocate there is a very verbose panic message, I just it just wasn’t captured by systemd or you didn’t see it. If it gets killed by Linux due to OOM, there is no chance to emit a message. The dmesg log will have a message from the kernel about it.

Generally speaking it’s fairly optimized as is. The known exceptions are very large files (which soon will be better with variable block size) and large folders where a lot has changed (because all of the changed files get queued).

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 9, 2018, 5:25pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/5 "2018-04-09T17:25:58Z")

</div>

Yep you were right: (from `dmesg` log)

```
[998745.207835] Out of memory: Kill process 21850 (syncthing) score 826 or sacrifice child
[998745.207975] Killed process 21850 (syncthing) total-vm:1340936kB, anon-rss:856940kB, file-rss:0kB, shmem-rss:0k
```

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 9, 2018, 5:27pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/6 "2018-04-09T17:27:52Z")

</div>

> [@calmh](#):
>
> The known exceptions are very large files (which soon will be better with variable block size)

When is soon? But anyway i think in my case it’s a lot of small files, a few medium sized and no huge files.

So the problem must be related to the second part:

> [@calmh](#):
>
> and large folders where a lot has changed (because all of the changed files get queued)

Could this be done with the help of a temp file? Maybe just if memory runs low?

Databases do this all the time, when sorting stuff that does not fit in memory, they use temp files on disk.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [April 9, 2018, 7:36pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/7 "2018-04-09T19:36:06Z")

</div>

Set scanProgressInterval to a negative value in the config and see if that helps, or enable swap.

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 10, 2018, 7:38pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/8 "2018-04-10T19:38:24Z")

</div>

I tried enabling swap. I increased it two times. My final setup is this:

- RAM: 1G
- SWAP: 2G

Result:

- Syncthing crashed again:

 ![Syncthing%20Master%20USB%20HDD%20Scan%2013%25%20-%20crash%20-%20obfuscated](https://forum-uploads.syncthingcdn.net/original/2X/8/8b4b97160c8135e7638a9480f5e14cc3aecefa2f.png)

I have the feeling that the last update degenerated the needed memory for a scan.

Before it was at least able to download what it got here.

(Not sure though. Could also be that it never had to do a full scan yet, while just downloading stuff …)

I will try again with more swap, but not sure if the system supports that.

But maybe you can take a look again on your side, too.

Greetings Fred;

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 10, 2018, 7:39pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/9 "2018-04-10T19:39:11Z")

</div>

> [@AudriusButkevicius](#):
>
> scanProgressInterval

What does this do?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [April 10, 2018, 9:08pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/10 "2018-04-10T21:08:36Z")

</div>

Disables the cache which allows to calculates scan progress, so your scans won’t have progress but they won’t consume as much memory.

There are a few other settings that could reduce memory usage, yet I suspect it shouldn’t be this high to start with. Can you try redownloading the binary to make sure it’s not corrupt?

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 11, 2018, 7:44am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/11 "2018-04-11T07:44:02Z")

</div>

> [@Finomosec](#):
>
> I will try again with more swap, but not sure if the system supports that.

I can not further increase swap. It just won’t work. Ill’ try the scanProgressInterval setting next.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [April 11, 2018, 7:47am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/12 "2018-04-11T07:47:15Z")

</div>

Did you try redownloading the binary? Can you post your config?

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 11, 2018, 7:24pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/13 "2018-04-11T19:24:55Z")

</div>

> [@AudriusButkevicius](#):
>
> Did you try redownloading the binary?

I don’t think that could / should be a problem. Did this ever happen?  
I use apt-get to install it. How should it be corrupted without being totally broken?

> [@AudriusButkevicius](#):
>
> Can you post your config?

Here it is (anonymized): [config.xml](https://forum-uploads.syncthingcdn.net/original/2X/0/0d6da51883dcea267711485b741f95cc55a7eb53.xml) (41.4 KB)

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 11, 2018, 7:37pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/14 "2018-04-11T19:37:19Z")

</div>

> [@AudriusButkevicius](#):
>
> Set scanProgressInterval to a negative value in the config and see if that helps

Ok i did this and restarted the scan NOW (21:35 Uhr German time).  
So let’s see what happens.

Currently at: 118 MB RAM

Last scan: 2018-04-10 20:33:25 (which did crash)

Update: 22:19 Uhr German time  
So far the scan is still running and the RAM usage did only increase slightly to: 129 MiB

Disk I/O for read and writes varies between 0.2 and 4MB/s.

I’ll let you know tomorrow if it was successful.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [April 11, 2018, 7:43pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/15 "2018-04-11T19:43:54Z")

</div>

> [@Finomosec](#):
>
> Did this ever happen?

Yes, multiple times

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 12, 2018, 5:35am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/16 "2018-04-12T05:35:42Z")

</div>

> [@Finomosec](#):
>
> I’ll let you know tomorrow if it was successful.

The scan was yet again not successful.

But looking in `dmesg` it does not seem like a memory related problem this time:

```
[Mi Apr 11 18:05:54 2018] systemd[1]: Starting Syncthing - Open Source Continuous File Synchronization for sync...
[Mi Apr 11 18:05:54 2018] systemd[1]: Started Syncthing - Open Source Continuous File Synchronization for sync.
[Mi Apr 11 18:08:10 2018] systemd[1]: Got automount request for /proc/sys/fs/binfmt_misc, triggered by 7551 (du)
[Mi Apr 11 18:08:10 2018] systemd[1]: Mounting Arbitrary Executable File Formats File System...
[Mi Apr 11 18:08:10 2018] systemd[1]: Mounted Arbitrary Executable File Formats File System.
[Mi Apr 11 19:10:26 2018] systemd[1]: Starting Session c11 of user pi.
[Mi Apr 11 19:10:26 2018] systemd[1]: Started Session c11 of user pi.
[Mi Apr 11 19:10:39 2018] systemd[1]: Starting Session c12 of user pi.
[Mi Apr 11 19:10:39 2018] systemd[1]: Started Session c12 of user pi.
[Mi Apr 11 19:13:09 2018] systemd[1]: Starting Session c13 of user pi.
[Mi Apr 11 19:13:09 2018] systemd[1]: Started Session c13 of user pi.
[Mi Apr 11 21:11:22 2018] systemd[1]: syncthing@sync.service: main process exited, code=exited, status=2/INVALIDARGUMENT
[Mi Apr 11 21:11:22 2018] systemd[1]: Unit syncthing@sync.service entered failed state.
[Mi Apr 11 21:11:22 2018] systemd[1]: syncthing@sync.service holdoff time over, scheduling restart.
[Mi Apr 11 21:11:22 2018] systemd[1]: Cannot add dependency job for unit syncthing-inotify@sync.service, ignoring: Unit syncthing-inotify@sync.service failed to load: No such file or directory.
[Mi Apr 11 21:11:22 2018] systemd[1]: Stopping Syncthing - Open Source Continuous File Synchronization for sync...
[Mi Apr 11 21:11:22 2018] systemd[1]: Starting Syncthing - Open Source Continuous File Synchronization for sync...
[Mi Apr 11 21:11:22 2018] systemd[1]: Started Syncthing - Open Source Continuous File Synchronization for sync.
[Mi Apr 11 22:43:54 2018] systemd[1]: Stopping User Manager for UID 1000...
[Mi Apr 11 22:43:57 2018] systemd[1]: Stopped User Manager for UID 1000.
[Mi Apr 11 22:43:57 2018] systemd[1]: Stopping user-1000.slice.
[Mi Apr 11 22:43:57 2018] systemd[1]: Removed slice user-1000.slice.
[Do Apr 12 00:38:42 2018] systemd[1]: Starting Cleanup of Temporary Directories...
[Do Apr 12 00:38:48 2018] systemd[1]: Started Cleanup of Temporary Directories.
[Do Apr 12 01:12:51 2018] systemd[1]: syncthing@sync.service: main process exited, code=exited, status=2/INVALIDARGUMENT
[Do Apr 12 01:12:51 2018] systemd[1]: Unit syncthing@sync.service entered failed state.
[Do Apr 12 01:12:51 2018] systemd[1]: syncthing@sync.service holdoff time over, scheduling restart.
[Do Apr 12 01:12:51 2018] systemd[1]: Cannot add dependency job for unit syncthing-inotify@sync.service, ignoring: Unit syncthing-inotify@sync.service failed to load: No such file or directory.
[Do Apr 12 01:12:51 2018] systemd[1]: Stopping Syncthing - Open Source Continuous File Synchronization for sync...
[Do Apr 12 01:12:51 2018] systemd[1]: Starting Syncthing - Open Source Continuous File Synchronization for sync...
[Do Apr 12 01:12:51 2018] systemd[1]: Started Syncthing - Open Source Continuous File Synchronization for sync.
[Do Apr 12 05:26:36 2018] systemd[1]: syncthing@sync.service: main process exited, code=exited, status=2/INVALIDARGUMENT
[Do Apr 12 05:26:36 2018] systemd[1]: Unit syncthing@sync.service entered failed state.
[Do Apr 12 05:26:36 2018] systemd[1]: syncthing@sync.service holdoff time over, scheduling restart.
[Do Apr 12 05:26:36 2018] systemd[1]: Cannot add dependency job for unit syncthing-inotify@sync.service, ignoring: Unit syncthing-inotify@sync.service failed to load: No such file or directory.
[Do Apr 12 05:26:36 2018] systemd[1]: Stopping Syncthing - Open Source Continuous File Synchronization for sync...
[Do Apr 12 05:26:36 2018] systemd[1]: Starting Syncthing - Open Source Continuous File Synchronization for sync...
[Do Apr 12 05:26:36 2018] systemd[1]: Started Syncthing - Open Source Continuous File Synchronization for sync.

```

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 12, 2018, 6:24am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/17 "2018-04-12T06:24:46Z")

</div>

Apparently the scan completed now. The folder is syncing now (after i rebooted the whole device).

Thanks for the help!

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [April 12, 2018, 11:07am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/18 "2018-04-12T11:07:25Z")

</div>

Would it make sense to use a disk-spilling queue in both scanner and puller? Scanner is a bit more problematic as we store a file info (without block though), not just file name. It seems pretty doable to use an adjusted version of the index sorter for this. It’s not the nicest solution considering the disk io discussions going on, but better than OOM crashes and short of walking the folders twice, I don’t see a possibility to have progress updates without intermediately storing files to be processed. I’d definitely propose to use some heuristic criterion for spilling, not a fixed max size, to prevent spilling on systems that can take the memory spike.

---

<div class="post-metadata">

### Author: ![Finomosec](https://forum.syncthing.net/user_avatar/forum.syncthing.net/finomosec/32/4143_2.png) [@Finomosec](https://forum.syncthing.net/u/Finomosec)
#### Post date: [April 12, 2018, 5:27pm UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/19 "2018-04-12T17:27:45Z")

</div>

Sorry, i’m back again …

Now i have OOM problems again, but this time **while syncing** (the scan completes ok with the new settings):

[SyncthingCrashedAgain.txt](https://forum-uploads.syncthingcdn.net/original/2X/2/2c5289a1d464cb0b780cb8641ad4cca16c4c4455.txt) (193.2 KB)

This happened several times now. But this time in noticed it in the logs.

The memory usage rises up to at least 1.9G (displayed in the UI).

I will pause the big folder now:  
It’s a little bit above 1 million files and about 78GB in size with about 30k folders.

---

<div class="post-metadata">

### Author: ![afalout](https://forum.syncthing.net/user_avatar/forum.syncthing.net/afalout/32/4498_2.png) [@afalout](https://forum.syncthing.net/u/afalout)
#### Post date: [April 15, 2018, 5:08am UTC](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467/20 "2018-04-15T05:08:57Z")

</div>

+1 for “soon” 🙂

It is sorely needed…

I had to move Syncthing from my NAS box (4GB) to the main PC (16GB) to get it working. And now of course watching for changes does not work (on CIFS mounts)

Thanks!

[Next page](https://forum.syncthing.net/t/syncthing-killed-repeatedly-no-errors/11467.md?page=2)
