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

Errors are unhelpful #61

Closed
felixfbecker opened this issue Jul 31, 2019 · 3 comments · Fixed by dgraph-io/dgraph#4317
Closed

Errors are unhelpful #61

felixfbecker opened this issue Jul 31, 2019 · 3 comments · Fixed by dgraph-io/dgraph#4317

Comments

@felixfbecker
Copy link

felixfbecker commented Jul 31, 2019

I am running a mutation that fails with this error:

Error: 2 UNKNOWN: Input for predicate contents of type scalar is uid
    at Object.exports.createStatusError (/Users/felix/git/sourcegraph/lsif/server/node_modules/grpc/src/common.js:91:15)
    at Object.onReceiveStatus (/Users/felix/git/sourcegraph/lsif/server/node_modules/grpc/src/client_interceptors.js:1204:28)
    at InterceptingListener._callNext (/Users/felix/git/sourcegraph/lsif/server/node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (/Users/felix/git/sourcegraph/lsif/server/node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (/Users/felix/git/sourcegraph/lsif/server/node_modules/grpc/src/client_interceptors.js:845:24) {
  code: 2,
  metadata: Metadata { _internal_repr: {}, flags: 0 },
  details: 'Input for predicate contents of type scalar is uid'
}

The mutation contains thousands of nquads, so I have no idea which one is wrong. I would expect the error to include some properties about which nquad failed to get added, at least the name of the predicate. The error code also always seems to be 2, and the stack trace doesn't include the user code.

As a comparison, errors from the node Postgres client pg have properties that specify the query, position, even the name of a column contraint that failed.

@campoy
Copy link

campoy commented Aug 6, 2019

Thanks for the report, @felixfbecker

I do wonder whether this is an issue with the error message itself (so dgraph-io/dgraph) or the way it ends up being displayed (this repo).

@paulftw, could you check whether we could improve the error message on this repository by at least showing which of all of the mutations was actually wrong?

@felixfbecker
Copy link
Author

Actually I noticed that the name of the predicate here was "contents", it was just not clear because it wasn't quoted and made sense as a sentence. But I think overall that would not help a lot - I'd still need a proper stack trace, maybe the index of the nquad in the list, the actual UID values of subject and object - anything that helps to find the bug

@campoy
Copy link

campoy commented Aug 6, 2019

Yeah, I think the message can be improved, yeah.
I'm sure @paulftw will have a look at the issue (later on, as he's in a different timezone).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants