Syncthing stuck and Web GUI unresponsive after adding ignore patterns to several folders in a row

I have experienced this problem today on my laptop. This is an older, mid-range device with a dual-core CPU, 8GB of RAM, and a standard SATA SSD. The OS is Windows 10 x64. The laptop is connected to only one remote device, which is a desktop PC on the same LAN, so the connection between the two is quite fast. The laptop has a very old WiFi card though, which doesn’t handle high bandwidth very well, hence the 1 MB/s limit set in Syncthing.

The stall happened as I was adding ignore patterns to the folders one by one, and after the fifth folder or so, the GUI basically stopped responding to anything. Actually, it is still stuck at the very moment after 30 minutes or so since the problem manifested itself. The Task Manager shows Syncthing running and using some CPU, but the logfile is not being written to at all. I’ve been running with the CMD window open too, but there are no new messages there either.

The GUI is stuck in this state:

I have taken a goroutine dump:

goroutine.txt (750.2 KB)

Please have a look at it when you’ve got some free time. I’m now going to kill and restart Syncthing, as I do need to have the synchronisation up and running.

Edit:

I restarted Syncthing and began to add the ignore patterns one more time. Again, after a few folders, everything stalled, so there is a pattern here.

I took a quick look and I think it’s changing ignores causes a scan which is blocked by lack of folder concurrency because other things are happening.

goroutine 746 [chan receive, 17 minutes]:
github.com/syncthing/syncthing/lib/model.(*folder).doInSync(0xc0010bf880, 0xc00b398240, 0xcb6c60, 0xc000e77530)
	github.com/syncthing/syncthing/lib/model/folder.go:278 +0x145
github.com/syncthing/syncthing/lib/model.(*folder).Scan(0xc0010bf880, 0x0, 0x0, 0x0, 0x0, 0x0)
	github.com/syncthing/syncthing/lib/model/folder.go:265 +0xa9
github.com/syncthing/syncthing/lib/model.(*model).SetIgnores(0xc0000681a0, 0xc000745e5d, 0xb, 0xc003bd1dc0, 0x1, 0x4, 0x0, 0x0)
	github.com/syncthing/syncthing/lib/model/model.go:2083 +0x5af
github.com/syncthing/syncthing/lib/api.(*service).postDBIgnores(0xc00007ec80, 0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api.go:1340 +0x216

Yeah, when I add the patterns, the folder changes its state to “Waiting to Scan”, but normally the GUI is still perfectly functional after doing so. Here, for some reason it becomes completely unresponsive :thinking:.

Did you check for errors with the browser dev tool? Never mind, the web UI is probably blocked by api calls, due to the scans Jakob quoted:

goroutine 746 [chan receive, 17 minutes]:
github.com/syncthing/syncthing/lib/model.(*folder).doInSync(0xc0010bf880, 0xc00b398240, 0xcb6c60, 0xc000e77530)
	github.com/syncthing/syncthing/lib/model/folder.go:278 +0x145
github.com/syncthing/syncthing/lib/model.(*folder).Scan(0xc0010bf880, 0x0, 0x0, 0x0, 0x0, 0x0)
	github.com/syncthing/syncthing/lib/model/folder.go:265 +0xa9
github.com/syncthing/syncthing/lib/model.(*model).SetIgnores(0xc0000681a0, 0xc000745e5d, 0xb, 0xc003bd1dc0, 0x1, 0x4, 0x0, 0x0)
	github.com/syncthing/syncthing/lib/model/model.go:2083 +0x5af
github.com/syncthing/syncthing/lib/api.(*service).postDBIgnores(0xc00007ec80, 0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api.go:1340 +0x216
net/http.HandlerFunc.ServeHTTP(0xc003351710, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2049 +0x4b
github.com/julienschmidt/httprouter.(*Router).Handler.func1(0x1140500, 0xc0025ca700, 0xc00c664100, 0x0, 0x0, 0x0)
	github.com/julienschmidt/httprouter@v1.3.0/router.go:275 +0x1e7
github.com/julienschmidt/httprouter.(*Router).ServeHTTP(0xc000b7bc20, 0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/julienschmidt/httprouter@v1.3.0/router.go:387 +0xc7e
github.com/syncthing/syncthing/lib/api.metricsMiddleware.func1(0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api.go:579 +0x11d
net/http.HandlerFunc.ServeHTTP(0xc003d84498, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2049 +0x4b
github.com/syncthing/syncthing/lib/api.noCacheMiddleware.func1(0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api.go:602 +0x3f3
net/http.HandlerFunc.ServeHTTP(0xc003d844b0, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2049 +0x4b
net/http.(*ServeMux).ServeHTTP(0xc003324900, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2428 +0x1b7
github.com/syncthing/syncthing/lib/api.(*csrfManager).ServeHTTP(0xc003aab080, 0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api_csrf.go:99 +0x1bf
github.com/syncthing/syncthing/lib/api.withDetailsMiddleware.func1(0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api.go:610 +0x2d3
net/http.HandlerFunc.ServeHTTP(0xc0033249c0, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2049 +0x4b
github.com/syncthing/syncthing/lib/api.basicAuthAndSessionMiddleware.func1(0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api_auth.go:56 +0xad4
net/http.HandlerFunc.ServeHTTP(0xc000f10e00, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2049 +0x4b
github.com/syncthing/syncthing/lib/api.redirectToHTTPSMiddleware.func1(0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api.go:592 +0x122
net/http.HandlerFunc.ServeHTTP(0xc003d844f8, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2049 +0x4b
github.com/syncthing/syncthing/lib/api.corsMiddleware.func1(0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api.go:571 +0x291
net/http.HandlerFunc.ServeHTTP(0xc0024719e0, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2049 +0x4b
github.com/syncthing/syncthing/lib/api.debugMiddleware.func1(0x1140500, 0xc0025ca700, 0xc00c664100)
	github.com/syncthing/syncthing/lib/api/api.go:499 +0xae
net/http.HandlerFunc.ServeHTTP(0xc003d84510, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2049 +0x4b
net/http.serverHandler.ServeHTTP(0xc0048f4700, 0x1140500, 0xc0025ca700, 0xc00c664100)
	net/http/server.go:2867 +0xaa
net/http.(*conn).serve(0xc0001b86e0, 0x11436e0, 0xc000c81ac0)
	net/http/server.go:1932 +0x8cd
created by net/http.(*Server).Serve
	net/http/server.go:2993 +0x3b8

Maybe we shouldn’t wait on scans in SetIgnores, just schedule one. Proposed that here: lib/model: Do not wait for scan when setting ignores by imsodin · Pull Request #7891 · syncthing/syncthing · GitHub</ti

1 Like

Yep, the Web GUI was completely out. In fact, it was impossible to even connect to it in the browser anymore.

Thanks a lot of for the quick fix! :slight_smile:

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