# "Unknown error saving post" when starting new topic with inline code

**URL:** https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861
**Category:** Support
**Created:** [April 23, 2015, 3:11pm UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861 "2015-04-23T15:11:20Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![gareth](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gareth/32/105346_2.png) [@gareth](https://meta.discourse.org/u/gareth)
#### Post date: [April 23, 2015, 3:11pm UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/1 "2015-04-23T15:11:20Z")

</div>

We just had an issue on our discourse where a user was getting an unhelpful error message trying to create a post with a code sample inline. I guess the code in question was not valid markdown, but the error could be handled more gracefully…

Attempting to post resulted in a lightbox with `Unknown error saving post, try again. Error: 0 error` and in the browser debug toolbar the error was reported as `net::ERR_CONNECTION_RESET`. Nothing appears in the discourse admin error logs.

The code in question is reproduced below. It was included directly in the post without any markdown formatting:

```plaintext
set -e
git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -n | awk 'BEGIN {print "count,file"} {print $1 "," $2}' > churn.csv

```

---

<div class="post-metadata">

### Author: ![gareth](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gareth/32/105346_2.png) [@gareth](https://meta.discourse.org/u/gareth)
#### Post date: [April 23, 2015, 3:12pm UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/2 "2015-04-23T15:12:04Z")

</div>

Although I’m able to create a post on this discourse with the offending code in, so perhaps the bug has already been fixed or is dependent on more than just that code…

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 24, 2015, 2:04am UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/3 "2015-04-24T02:04:42Z")

</div>

Can you reproduce this on [try.discourse.org](http://try.discourse.org) ?

---

<div class="post-metadata">

### Author: ![gareth](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gareth/32/105346_2.png) [@gareth](https://meta.discourse.org/u/gareth)
#### Post date: [April 24, 2015, 3:24pm UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/4 "2015-04-24T15:24:23Z")

</div>

> [@codinghorror](#):
>
> Can you reproduce this on [try.discourse.org](http://try.discourse.org) ?

Sadly not. The person in question can reproduce it, but I can’t myself even when I paste in the same content, on our discourse or on [try.discourse.org](http://try.discourse.org). She tells me the shortest string that reliably reproduces it is:

`--format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -n |`

Thanks for the pointer to [try.discourse.org](http://try.discourse.org) though. Might be worth putting a sticky post at the top of the bugs category to let people know they can try and repro bugs there without cluttering this forum (like I did!)

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [April 24, 2015, 3:57pm UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/5 "2015-04-24T15:57:05Z")

</div>

Is she getting any errors in her browser’s JavaScript console? If something goes wrong with the markdown parser, it should report any errors there.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 25, 2015, 1:38am UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/6 "2015-04-25T01:38:12Z")

</div>

Does this user have any browser plugins or non default browser settings? Does she also have this problem if she tries in a different web browser, one that she does not normally use?

---

<div class="post-metadata">

### Author: ![dani\_m](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@dani\_m](https://meta.discourse.org/u/dani_m)
#### Post date: [April 27, 2015, 10:17am UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/7 "2015-04-27T10:17:16Z")

</div>

Hi All - we thought it would be easier if I responded directly.

I’ve just [posted the string in question on try.discourse.org](http://try.discourse.org/t/testing-adding-code/351) and it has posted with no problems.

Doing this on our discourse, when writing a topic with the following message:

> Some characters here then nothing

it posts to [Sign in to your account](http://discourse.softwire.com/draft.json) successfully

However, when writing a topic with the following message:

> Some characters here and then the code

> set -e  
> git log --all -M -C --name-only --format=‘format:’ "@" | sort | grep -v '^’ | uniq -c | sort -n | awk ‘BEGIN {print “count,file”} {print $1 “,” $2}’ \> churn.csv

It posts to [Sign in to your account](http://discourse.softwire.com/draft.json) but errors with message (failed) net::ERR\_CONNECTION\_RESET

If I then try and post this message, a lightbox appears with "Unknown error saving pistm try again, Error:0 error. Looking in the console, the post to [Sign in to your account](http://discourse.softwire.com/posts) has failed again with net::ERR\_CONNECTION\_RESET

Hope that helps!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 28, 2015, 1:38am UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/8 "2015-04-28T01:38:00Z")

</div>

It looks like there is something between you and the server that is blocking that content, like anti-virus, firewall, or proxy. That is my guess. Does it happen if you post it from a mobile phone?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 28, 2015, 3:08am UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/9 "2015-04-28T03:08:44Z")

</div>

The server isn’t hosted at DO…

```plaintext
$ curl ipinfo.io/31.221.86.178
{
  "ip": "31.221.86.178",
  "hostname": "No Hostname",
  "city": "London",
  "region": "London",
  "country": "GB",
  "loc": "51.5472,-0.1376",
  "org": "AS25180 Exponential-e Ltd",
  "postal": "NW5"
}

```

… so I think it’s your IDS (Intrusion Detection System) interfering, @dani_m.

---

<div class="post-metadata">

### Author: ![gareth](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gareth/32/105346_2.png) [@gareth](https://meta.discourse.org/u/gareth)
#### Post date: [April 29, 2015, 2:27pm UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/10 "2015-04-29T14:27:46Z")

</div>

Aha, thanks for you help guys! Glad we got to the bottom of it

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 29, 2018, 6:42pm UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/11 "2018-09-29T18:42:49Z")

</div>



---

<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: [October 2, 2018, 12:44am UTC](https://meta.discourse.org/t/unknown-error-saving-post-when-starting-new-topic-with-inline-code/27861/12 "2018-10-02T00:44:03Z")

</div>


