# migrating database to schema version 10 failed

**URL:** https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928
**Category:** Support
**Created:** [November 23, 2020, 8:42am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928 "2020-11-23T08:42:49Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![usualMortal](https://forum.syncthing.net/user_avatar/forum.syncthing.net/usualmortal/32/9000_2.png) [@usualMortal](https://forum.syncthing.net/u/usualMortal)
#### Post date: [November 23, 2020, 8:42am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/1 "2020-11-23T08:42:49Z")

</div>

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.

---

<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: [November 23, 2020, 10:43am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/3 "2020-11-23T10:43:04Z")

</div>

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).

---

<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: [November 23, 2020, 11:03am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/4 "2020-11-23T11:03:40Z")

</div>

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](https://github.com/syncthing/syncthing/pull/7140)

---

<div class="post-metadata">

### Author: ![usualMortal](https://forum.syncthing.net/user_avatar/forum.syncthing.net/usualmortal/32/9000_2.png) [@usualMortal](https://forum.syncthing.net/u/usualMortal)
#### Post date: [November 23, 2020, 3:45pm UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/5 "2020-11-23T15:45:29Z")

</div>

Here is index-v0.14.0.db you requested [https://hdd.tomsk.ru/file/tczenmkf](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.

---

<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: [November 23, 2020, 5:24pm UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/6 "2020-11-23T17:24:21Z")

</div>

Thanks for the db.

> [@usualMortal](#):
>
> 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.

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:

> [@imsodin](#):
>
> 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.

---

<div class="post-metadata">

### Author: ![usualMortal](https://forum.syncthing.net/user_avatar/forum.syncthing.net/usualmortal/32/9000_2.png) [@usualMortal](https://forum.syncthing.net/u/usualMortal)
#### Post date: [November 24, 2020, 8:24am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/8 "2020-11-24T08:24:21Z")

</div>

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?

---

<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: [November 24, 2020, 8:28am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/9 "2020-11-24T08:28:59Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![usualMortal](https://forum.syncthing.net/user_avatar/forum.syncthing.net/usualmortal/32/9000_2.png) [@usualMortal](https://forum.syncthing.net/u/usualMortal)
#### Post date: [December 6, 2020, 9:46am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/10 "2020-12-06T09:46:37Z")

</div>

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.

---

<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: [December 6, 2020, 11:59am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/11 "2020-12-06T11:59:19Z")

</div>

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

---

<div class="post-metadata">

### Author: ![usualMortal](https://forum.syncthing.net/user_avatar/forum.syncthing.net/usualmortal/32/9000_2.png) [@usualMortal](https://forum.syncthing.net/u/usualMortal)
#### Post date: [December 7, 2020, 5:52am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/12 "2020-12-07T05:52:46Z")

</div>

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?

---

<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: [December 7, 2020, 9:33am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/13 "2020-12-07T09:33:33Z")

</div>

> [@usualMortal](#):
>
> 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.

---

<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: [December 7, 2020, 10:30am UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/14 "2020-12-07T10:30:01Z")

</div>

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

---

<div class="post-metadata">

### Author: ![usualMortal](https://forum.syncthing.net/user_avatar/forum.syncthing.net/usualmortal/32/9000_2.png) [@usualMortal](https://forum.syncthing.net/u/usualMortal)
#### Post date: [December 7, 2020, 5:49pm UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/15 "2020-12-07T17:49:16Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [January 6, 2021, 5:49pm UTC](https://forum.syncthing.net/t/migrating-database-to-schema-version-10-failed/15928/16 "2021-01-06T17:49:28Z")

</div>

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