# FATAL: update before replace for cid 2

**URL:** https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332
**Category:** Support
**Created:** [June 4, 2014, 10:30am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332 "2014-06-04T10:30:28Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [June 4, 2014, 10:30am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/1 "2014-06-04T10:30:29Z")

</div>

I get this message on windows. What’s the problem here?

---

<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: [June 4, 2014, 11:09am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/2 "2014-06-04T11:09:07Z")

</div>

It’s a bug (condition that shouldn’t happen). Can you reproduce it with `STTRACE=model,net,files`?

(Technically, it’s getting a repository update message before it has the initial contents. That doesn’t make sense.)

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [June 4, 2014, 11:40am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/3 "2014-06-04T11:40:28Z")

</div>

Seems that i can’t reproduce it.

---

<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: [June 4, 2014, 1:06pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/4 "2014-06-04T13:06:04Z")

</div>

It’s probably a rare race condition. I’ve seen it myself.

---

<div class="post-metadata">

### Author: ![anigris](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@anigris](https://forum.syncthing.net/u/anigris)
#### Post date: [June 4, 2014, 4:41pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/5 "2014-06-04T16:41:54Z")

</div>

I can reproduce it! On my NAS version 0.8.12 starts normally, but after populating repos, when try to connect to other nodes every time appears that error and Syncthing shuts down. No other output on console. What can I do to help you to understand the matter?

Ah, today tryed 0.8.13 on NAS and: “illegal instruction, (core dump)” and no way to start Syncthing!

---

<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: [June 4, 2014, 9:24pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/6 "2014-06-04T21:24:45Z")

</div>

> [@anigris](#):
>
> “illegal instruction, (core dump)”

This seems to be an effect of upgrading the Go compiler. Can you give this build a spin (I’m assuming linux/386 since that should be the affected build)?

[https://nym.se/t/syncthing-linux-386-v0.8.13-5-g20a018d.tar.gz](https://nym.se/t/syncthing-linux-386-v0.8.13-5-g20a018d.tar.gz)

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [June 5, 2014, 11:08am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/7 "2014-06-05T11:08:48Z")

</div>

I get this error with v0.8.13 on windows 64bit and arm…

So v0.8.13 is unusable?

---

<div class="post-metadata">

### Author: ![anigris](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@anigris](https://forum.syncthing.net/u/anigris)
#### Post date: [June 5, 2014, 7:11pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/8 "2014-06-05T19:11:45Z")

</div>

Ehm… with 386 binary I have not trouble yet! 🙂 Only with ARM V5 binary on NAS! And 386 binary on ARM doesn’t work. Could you point me to an ARM V5 binary to try? Thank you.

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [June 5, 2014, 8:05pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/9 "2014-06-05T20:05:00Z")

</div>

I have trouble with ARM v7 and win 64

---

<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: [June 6, 2014, 5:06pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/10 "2014-06-06T17:06:41Z")

</div>

There is no fix for this issue (“update before replace for cid x”) to try, the binary above is just for the case that the 32 bit build crashed with “illegal instruction”.

For those of you who can reproduce it, the output from the command above would be useful in nailing it down.

---

<div class="post-metadata">

### Author: ![anigris](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@anigris](https://forum.syncthing.net/u/anigris)
#### Post date: [June 6, 2014, 5:41pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/11 "2014-06-06T17:41:43Z")

</div>

Sure! Is the ARM V5 binary that crashes with “illegal instruction”! Linux I386 and AMD64 work great! I’ll try with strace, but don’t know if it’s installed on NAS OS!

---

<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: [June 6, 2014, 8:12pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/12 "2014-06-06T20:12:46Z")

</div>

> [@anigris](#):
>
> Is the ARM V5 binary that crashes with “illegal instruction”!

Can you paste the full crash trace on that?

Edit: Actually, never mind, I think I know what the problem is. Try this one:

[https://nym.se/t/syncthing-linux-armv5-v0.8.13-11-gb2f66cf.tar.gz](https://nym.se/t/syncthing-linux-armv5-v0.8.13-11-gb2f66cf.tar.gz)

---

<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: [June 7, 2014, 1:13pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/13 "2014-06-07T13:13:34Z")

</div>

[https://github.com/calmh/syncthing/issues/344](https://github.com/calmh/syncthing/issues/344) for the issue

---

<div class="post-metadata">

### Author: ![anigris](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@anigris](https://forum.syncthing.net/u/anigris)
#### Post date: [June 9, 2014, 11:46am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/14 "2014-06-09T11:46:44Z")

</div>

Also the error “FATAL: update before replace for cid X” can be solved deleting repository indexes and rebuilding them. Today with 0.8.14 AMD64 Syncthing crashd! Deleting indexes and rebuilding restored functionality. No other kind of trace, only the error “cid 1”. This solved for me!

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [June 10, 2014, 9:51am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/15 "2014-06-10T09:51:09Z")

</div>

Yes, i get cid 2 with existing index files:

[https://github.com/calmh/syncthing/issues/344#issuecomment-45589812](https://github.com/calmh/syncthing/issues/344#issuecomment-45589812)

After deleting the index files i get “cid 1” error:

[https://github.com/calmh/syncthing/issues/344#issuecomment-45594072](https://github.com/calmh/syncthing/issues/344#issuecomment-45594072)

---

<div class="post-metadata">

### Author: ![anigris](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@anigris](https://forum.syncthing.net/u/anigris)
#### Post date: [June 10, 2014, 1:37pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/16 "2014-06-10T13:37:03Z")

</div>

Wonderful! This new binary solved Illegal Instruction and also cid errors! It would be perfect if it would not have the same freeze if started on NAS before other nodes! As always restarting on NAS after other nodes solved any trouble, and all ok! Thank You!

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [June 11, 2014, 10:58am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/17 "2014-06-11T10:58:43Z")

</div>

with: syncthing v0.8.14-2-g4cfe303 (go1.3rc1 windows-amd64) i get now this:

```
[KFHXR] 12:02:47 FATAL: update before replace for cid 3

```

I created [https://github.com/calmh/syncthing/issues/359](https://github.com/calmh/syncthing/issues/359) for this.

---

<div class="post-metadata">

### Author: ![anigris](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/45deac/32.png) [@anigris](https://forum.syncthing.net/u/anigris)
#### Post date: [June 11, 2014, 2:02pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/18 "2014-06-11T14:02:38Z")

</div>

☹ Also ARM V5 binary today new “cid 2” error. Need to delete index files.

---

<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: [June 11, 2014, 2:52pm UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/19 "2014-06-11T14:52:23Z")

</div>

The index files should have nothing to do with it, really…

If possible I’d like to see those logs again with the latest build?

---

<div class="post-metadata">

### Author: ![jedie](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jedie](https://forum.syncthing.net/u/jedie)
#### Post date: [June 12, 2014, 7:13am UTC](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332/20 "2014-06-12T07:13:05Z")

</div>

I added debug info here: [https://github.com/calmh/syncthing/issues/359#issuecomment-45836778](https://github.com/calmh/syncthing/issues/359#issuecomment-45836778)

[Next page](https://forum.syncthing.net/t/fatal-update-before-replace-for-cid-2/332.md?page=2)
