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

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:

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
1 Like

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…

Can you reproduce this on 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. 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 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!)

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.

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?

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

I’ve just posted the string in question on try.discourse.org 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 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 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 has failed again with net::ERR_CONNECTION_RESET

Hope that helps!

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?

1 Like

The server isn’t hosted at DO…

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

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