POST to Mocking Service throws 500 error: socket hang up


#1

Has anyone seen this? Any idea why it’s happening? Thanks!

When I use Try It with a POST, I get:

Status

500

Headers

accept-ranges: bytes
connection: keep-alive
content-encoding: gzip
content-length: 34
content-type: text/html; charset=utf-8
date: Thu, 07 Aug 2014 19:48:17 GMT
vary: Accept-Encoding
x-varnish-cache: MISS

Body

socket hang up

This used to work. I am using “Prefill with example” to create my post.

GET still works fine.


#2

I’ve not seen it, interesting! (And not in a good way, of course.) Can you message me directly with the RAML file (including your baseUri that has the mocking service endpoint in it) and we can take a look?

Thanks!


#3

Hi @scordatura,
I created the RAML file you shared with @usarid (I needed to invent some of the included files since were missing) and I’m getting a 200.

I think it could have been a temporary issue (I don’t think that any valid scenario you have in your other files will alter the test, but I could try those away if you send these too).


#4

Thanks for looking into this, @nohorbee!

I am able to reproduce this on the GA too, but when investigating, I found that the problem seems to be that I wrote the schema incorrectly.

I will post details later, when I am sure of them.


#5

Hi @scordatura, Were you able to check if it was your schema finally?
Do you need some additional assistance?

Please, let me know, and I’ll try to help.
Cheers!


#6

Thanks @nohorbee, the problem was that my schema was incorrectly structured.

I don’t know why exactly that caused a 500 server hang up as opposed to some other error … maybe you can figure that out.

My schemas are working now, so any insight about the server hang up would be appreciated, but the lack of it isn’t holding up production or anything.

bad schema that causes Mocking service to throw a 500 server hang up

{
    "$schema": "http://json-schema.org/draft-03/schema#",
    "type": "object",
    "properties": {
        "thing_type": "integer",
        "is_a_thing": "boolean",
        "designator": "string",
        "name": "string"
    }
}

good schema that works fine with Mocking service

{
  "type": "object",
  "$schema": "http://json-schema.org/draft-03/schema#",
  "type": "object",
  "properties": 
  {
    "test-thing":
    {
      "type": "object",
      "properties":
      {
        "thing_type": 
        {
          "type":"integer",
          "required":true
          },
        "is_a_thing": 
        {
          "type":"boolean",
          "required":false
          },
        "designator": 
        {
          "type":"string",
          "required":false
          },
        "name": 
        {
          "type":"string",
          "required":false
        }
      } 
    } 
  }
}

object that is VALID with the good schema

{
  "test-thing": {
    "thing_type": 1,
    "is_a_thing": true,
    "designator": "Experimental",
    "name": "foo_test_thing"
  }
}

object that is NOT valid with good schema

{
  "test-thing": {
    "thing_type": "oh no",
    "is_a_thing": 22,
    "designator": false,
    "name": "foo_test_thing"
  }
}