migrating database to schema version 10 failed

Good day. I’ve upgraded my syncthing to version 1.10 and I have issues with migrating the database.

[start] 15:34:42 INFO: syncthing v1.10.0 "Fermium Flea" (go1.15.5 linux-amd64) portage@localhost 2020-11-21 06:12:18 UTC [noupgrade]
[YRZUL] 15:34:42 INFO: My ID: ***
[YRZUL] 15:34:43 INFO: Single thread SHA256 performance is 164 MB/s using crypto/sha256 (164 MB/s using minio/sha256-simd).
[YRZUL] 15:34:43 INFO: Hashing performance is 142.79 MB/s
[YRZUL] 15:34:43 INFO: Migrating database to schema version 9...
[YRZUL] 15:34:44 INFO: Migrating database to schema version 10...
[YRZUL] 15:34:44 WARNING: Database schema: failed migrating to version 10: proto: wrong wireType = 2 for field Invalid
[YRZUL] 15:34:44 INFO: Exiting

Is there any way to fix that except for starting from scratch? Thx in advance.

From the migrations in your log, you are coming from something in between v0.14.53 and v1.4.0, right? Version 10 is v1.6.0. Looks like some change since then broke the migration to 10. Given debian stable is on v1.0.1 and thus will have to go through this transition as well, I am interested in fixing this. Could you please create a copy of the index-v0.14.0.db directory in your syncthing config folder for testing before taking any further steps. To get your synchronisation up and running again, I suggest downloading v1.6.0 from github, and run that until the migration is done. Then upgrade to the latest version.

I am having a look at the code to see if the cause becomes clear like that. If not I’d very much appreciate if you could do some tests on the copied database (or privately make the db available for testing).

Actually this suggests a previous db migration failed at a later step and now it is retrying to do an earlier migration that already happened and fails due to that. Could you please check your Syncthing logs for migration errors before the one you posted here.

The problem described in the above paragraph is relevant regardless of if it was the cause for the issue in this topic or not, thus: https://github.com/syncthing/syncthing/pull/7140

Here is index-v0.14.0.db you requested https://hdd.tomsk.ru/file/tczenmkf Sorry for using our local file transfer service; much to my surprise I’ve discovered that I know nothing of more common file sharing services. I’ve cloned 1.6.0 and I’m about to run the migration tomorrow if you have no test to perform on my database, it can wait a couple of days.

Thanks for the db.

Ah sorry, should have been more clear in my last post: If my suspicion there about earlier failed db migrations is right, running v1.6.0 won’t help. Could you please check the logs for this:

Sorry but I can’t locate the logfile. /etc/conf.d/syncthing is like this:

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

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

# Configuration directory
#SYNCTHING_HOMEDIR="/var/lib/syncthing/.config/syncthing"

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

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

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

# Nice level of syncthing
#SYNCTHING_NICE="0"

# Extra options for syncthing
#SYNCTHING_OPTS=""

I have nothing in /var/log/syncthing except for empty file keep_net-p2p_syncthing-0

And /etc/logrotate.d/syncthing is:

/var/log/syncthing/syncthing.log {
    missingok
    notifempty
    sharedscripts
    copytruncate
}

Any advice on where can one find the log?

You’ll need to ask whoever created that config file and presumably the corresponding init script - which is not the Syncthing project, but probably your distro’s packager.

Okay, I had no luck locating the logfile you mentioned on my own, guess I’ll go ask Gentoo community for help. The only thing I can provide is a console output which I did in the first post.

That’s what I am looking for, just for previous runs of Syncthing.

Oh. Now I get it. These logs can well be lost by now.

So I’ve fetched the code for 1.6

git clone --depth 1 -b v1.6.0-rc.5 https://github.com/syncthing/syncthing`

checked the version

$ go version
go version go1.15.5 linux/amd64

ran the build

$ go run build.go

and got syncthing 1.6 version. It doesn’t run though:

$ ./bin/syncthing 
panic: qtls.ClientSessionState not compatible with tls.ClientSessionState

goroutine 1 [running]:
github.com/lucas-clemente/quic-go/internal/handshake.init.2()
	/home/gentoo/usualmortal/go/pkg/mod/github.com/lucas-clemente/quic-go@v0.15.7/internal/handshake/unsafe.go:26 +0x205

Is there something else to do or should I consider starting syncing my devices from scratch?

Yes. I don’t expect anymore that running v1.6.0 will help.

For the record: That’s quic which is tightly coupled to go versions unfortunately. You could build with -tags noquic to get around that.

Or use our 1.6.0 binaries from GitHub. (But unclear if running 1.6.0 would help, as mentioned.)

All right, thank you all. I’ll continue to use syncthing nevertheless, this software is great. Keep up the good work.

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