ArangoDB 2.5 can't save document with field value which contains colon sign

210 views
Skip to first unread message

Tomas Bosak

unread,
Mar 16, 2015, 5:15:39 AM3/16/15
to aran...@googlegroups.com
Hi folks,

it seems like in ArangoDB 2.5 documents with fields that contain colon sign in their values, e.g.

{
  "field": "a:"
}

cannot be saved (tried through web interface) and returns error:

  1. code400
  2. errortrue
  3. errorMessage"invalid document type"
  4. errorNum1227

Jan

unread,
Mar 16, 2015, 5:26:18 AM3/16/15
to aran...@googlegroups.com
Hello,

I don't think this is the case. It works when I try it and I don't see any reason for why a colon inside a value wouldn't work.
I think the error "invalid document type" is thrown when trying to save a non-edge (i.e. an object missing "_from" or "_to") in an edge collection.

Can you check whether this is the case?

Best regards
Jan

Tomas Bosak

unread,
Mar 16, 2015, 5:38:05 AM3/16/15
to aran...@googlegroups.com
Hi Jan,

tried it now with newly created document type collection (with default configuration in _system database) through web interface and inserted the document with same result (400 on PUT).

  1. Request URL:
  2. Request Method:
    PUT
  3. Status Code:
    400 Bad Request

Response headers:
  1. HTTP/1.1 400 Bad Request Access-Control-Allow-Credentials: true Server: ArangoDB Access-Control-Allow-Origin: http://localhost:8529 Access-Control-Expose-Headers: etag, content-encoding, content-length, location, server, x-arango-errors, x-arango-async-id Content-Type: application/json; charset=utf-8 Connection: Keep-Alive Content-Length: 80

Request headers:
  1. PUT /_db/_system/_api/document/test/16233273645 HTTP/1.1 Host: localhost:8529 Connection: keep-alive Content-Length: 27 Accept: */* Origin: http://localhost:8529 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36 Content-Type: application/json DNT: 1 Referer: http://localhost:8529/_db/_system/_admin/aardvark/standalone.html Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8,ms;q=0.6

Request payload:
  1. "{\n \"field\": \"a:\"\n}"

Response:
{"error":true,"errorMessage":"invalid document type","code":400,"errorNum":1227}

Jan

unread,
Mar 16, 2015, 5:48:23 AM3/16/15
to aran...@googlegroups.com
I can confirm it works fine using the `collection.save()` and `collection.update()` etc methods and the REST API.

To me the request payload looks like a JSON string. But I think it should rather be a JSON object.
So it might be an issue in the web interface only. I'll have that checked and fixed if this is the case.

Tomas Bosak

unread,
Mar 16, 2015, 5:55:05 AM3/16/15
to aran...@googlegroups.com
That might be the case since when I save just { foo: "bar" } the payload looks like this:

{"foo":"bar"}

However when I want to save { foo: "bar:" } the payload is:

"{\n \"foo\": \"bar:\"\n}"

Ke Rn

unread,
Mar 16, 2015, 6:24:41 AM3/16/15
to aran...@googlegroups.com
Hi,

it is now fixed in the devel branch and 2.5 branch. Thanks for the hint.

- Heiko 
Reply all
Reply to author
Forward
0 new messages