Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to relate: Unable to save document error #42

Open
TobiEiss opened this issue Nov 29, 2016 · 5 comments
Open

failed to relate: Unable to save document error #42

TobiEiss opened this issue Nov 29, 2016 · 5 comments

Comments

@TobiEiss
Copy link

I cant persist a new entry into a edge-collection.
The result of a debug-session: we get 404 from http-rest-arango-endpoint.

I get the same error with the "relate-example" (README).

@diegogub
Copy link
Owner

Hello @TobiEiss , I will check this. Thanks fro report. Which Arangodb version are you using? and wich aranGO version?

@TobiEiss
Copy link
Author

TobiEiss commented Nov 30, 2016

@diegogub arango version 3.1.1

And i found the Problem:

  • The request-link is wrong (was right in an older version).

A little (dirty) workaround:
instead of (README-example):

// Relate documents
s.DB("test").Col("ed").Relate(d1.Id,d2.Id,map[string]interface{}{ "is" : "friend" })

use:

edge := map[string]interface{}{}
edge["is"] = d1.ID
edge["friend"] = d2.ID
err := s.DB("test").Col("ed").Save(edge)

AND change in collection.go (line 135)
if col.Type == 2 || col.Type == 3 {

@stefanwuthrich
Copy link

I try'd this fix and get following :

session.go:129: --------------------------------------------------------------------------------
session.go:130: REQUEST
session.go:131: --------------------------------------------------------------------------------
session.go:132:

session.go:133: Payload:
session.go:134:
{
"friend": "docs1/196952",
"is": "docs1/196948"
}
session.go:170: --------------------------------------------------------------------------------
session.go:171: RESPONSE
session.go:172: --------------------------------------------------------------------------------
session.go:173: Status: 400
session.go:174: Header:
session.go:175:
{
"Connection": [
"Keep-Alive"
],
"Content-Length": [
"81"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Server": [
"ArangoDB"
]
}
session.go:176: Body:
session.go:180:
{
"error": true,
"errorMessage": "invalid edge attribute",
"code": 400,
"errorNum": 1233
}
(newest arangodb version, with master and v2 branch of aranGO)

@TobiEiss
Copy link
Author

Ah, okay. My workaround is for master-branch

@stefanwuthrich
Copy link

for me it did not work on master and v2 branch

victorspringer added a commit to victorspringer/aranGO that referenced this issue Mar 14, 2017
- Changed doc/label (SaveEdge/Relate) parameter type to map[string]interface{}
- Updated POST URL inside SaveEdge to the new one according to the latest ArangoDB version
victorspringer added a commit to victorspringer/aranGO that referenced this issue Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants