# 'discourse remap' sollte bei einem Fehler laut und deutlich fehlschlagen

**URL:** <https://meta.discourse.org/t/discourse-remap-should-fail-noisily-and-mightily-when-an-error-occurs/85990>\
**Category:** Bug\
**Created:** [23. April 2018 um 15:13 UTC](https://meta.discourse.org/t/discourse-remap-should-fail-noisily-and-mightily-when-an-error-occurs/85990 "2018-04-23T15:13:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [23. April 2018 um 15:13 UTC](https://meta.discourse.org/t/discourse-remap-should-fail-noisily-and-mightily-when-an-error-occurs/85990/1 "2018-04-23T15:13:34Z")

</div>

had this happen in the middle of a remap:

```plaintext
…
Remapping posts raw
1454 rows affected!
Remapping posts cooked
Error: ERROR: deadlock detected
DETAIL: Process 10050 waits for ShareLock on transaction 552065959; blocked by process 9965.
Process 9965 waits for ShareLock on transaction 552065918; blocked by process 10050.
HINT: See server log for query details.
CONTEXT: while rechecking updated tuple (59101,9) in relation "posts"
Remapping posts edit_reason
0 rows affected!
Remapping posts raw_email
4340 rows affected!
Remapping posts action_code
0 rows affected!
Remapping posts image_url
122356 rows affected!
…continues…

```

Good thing I was watching it or I wouldn’t have known!

Expected behaviour: `discourse remap` should retry and abort the entire process if it cannot succeed

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [12. Juni 2018 um 08:29 UTC](https://meta.discourse.org/t/discourse-remap-should-fail-noisily-and-mightily-when-an-error-occurs/85990/3 "2018-06-12T08:29:44Z")

</div>

I want to get this sorted, but it feels to me like this would require an enormous transaction which would totally lock up the database.

Instead lets just get some basics here first:

On first failure, abort and print a message saying it was only **partially** applied asking users to re-run the remap.

@supermathie does that work for you? @zogstrip do you mind if I reassign this to @Osama ?

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [12. Juni 2018 um 08:30 UTC](https://meta.discourse.org/t/discourse-remap-should-fail-noisily-and-mightily-when-an-error-occurs/85990/4 "2018-06-12T08:30:28Z")

</div>

> [@sam](#):
>
> @zogstrip do you mind if I reassign this to @Osama ?

Not at all 👌

---

<div class="post-metadata">

**Author:** ![Osama](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osama/32/98013_2.png) [@Osama](https://meta.discourse.org/u/Osama)\
**Post date:** [18. Juni 2018 um 11:30 UTC](https://meta.discourse.org/t/discourse-remap-should-fail-noisily-and-mightily-when-an-error-occurs/85990/6 "2018-06-18T11:30:40Z")

</div>

This is done via: 🍬

[https://github.com/discourse/discourse/pull/6005](https://github.com/discourse/discourse/pull/6005)

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [19. Juni 2018 um 04:49 UTC](https://meta.discourse.org/t/discourse-remap-should-fail-noisily-and-mightily-when-an-error-occurs/85990/7 "2018-06-19T04:49:59Z")

</div>


