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

docker service crash after querying empty database #586

Closed
AndreSteenbergen opened this issue Feb 14, 2017 · 6 comments
Closed

docker service crash after querying empty database #586

AndreSteenbergen opened this issue Feb 14, 2017 · 6 comments
Assignees
Labels
kind/bug Something is broken.
Milestone

Comments

@AndreSteenbergen
Copy link

AndreSteenbergen commented Feb 14, 2017

to reproduce this issue run:

docker run --rm -p 8090:8080 --name DGraph -v DGraph:/dgraph dgraph/dgraph dgraph --bindall=true --schema=my.schema

then without mutating, just querying, the docker instance results in:

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xcf1569]

runtime stack:
runtime.throw(0xeaf4b1, 0x2a)
        /usr/local/go/src/runtime/panic.go:566 +0x95
runtime.sigpanic()
        /usr/local/go/src/runtime/sigpanic_unix.go:12 +0x2cc

goroutine 73 [syscall, locked to thread]:
runtime.cgocall(0xa937b0, 0xc421e29688, 0x0)
        /usr/local/go/src/runtime/cgocall.go:131 +0x110 fp=0xc421e29658 sp=0xc421e29618
github.com/dgraph-io/dgraph/rdb._Cfunc_rdb_iter_value(0x7f9fc5633000, 0xc420015ce8, 0x0)
        github.com/dgraph-io/dgraph/rdb/_obj/_cgo_gotypes.go:518 +0x4e fp=0xc421e29688 sp=0xc421e29658
github.com/dgraph-io/dgraph/rdb.(*Iterator).Value(0xc4201284f8, 0xc4201c1a70)
        /home/ubuntu/go/src/github.com/dgraph-io/dgraph/rdb/iterator.go:63 +0xa7 fp=0xc421e296e8 sp=0xc421e29688
github.com/dgraph-io/dgraph/worker.getInequalityTokens(0xc42008860f, 0x8, 0xc420214680, 0x20, 0xc42008860b, 0x2, 0x0, 0x0, 0x0, 0x0, ...)
        /home/ubuntu/go/src/github.com/dgraph-io/dgraph/worker/tokens.go:22 +0x13b fp=0xc421e297f8 sp=0xc421e296e8
github.com/dgraph-io/dgraph/worker.processTask(0xc420145680, 0xc400000001, 0x0, 0x0, 0x0)
        /home/ubuntu/go/src/github.com/dgraph-io/dgraph/worker/task.go:130 +0x343 fp=0xc421e29b00 sp=0xc421e297f8

etc. the only way to recover is restart the server

@manishrjain manishrjain added the kind/bug Something is broken. label Feb 16, 2017
@manishrjain manishrjain added this to the v0.7.3 milestone Feb 16, 2017
@pawanrawal
Copy link
Contributor

Hi @AndreSteenbergen

I am unable to reproduce this, in fact I can't start the docker container because in -v DGraph:/dgraph , the path to the volume in the instance needs to be absolute (moby/moby#4830), so it should be something like -v $(pwd)/DGraph:/dgraph.

Just to clarify, I ran

docker run --rm -p 8090:8080 --name Dgraph -v $(pwd)/DGraph:/dgraph dgraph/dgraph:latest dgraph --bindall=true --schema=my.schema

and my pwd contained a DGraph directory with a my.schema file in it.

Could you try the above command and let me know if the issue persists?

@AndreSteenbergen
Copy link
Author

I am using docker 1.13.1 on windows. It is a named volume, that is created on the host machine, instead of the running directory. The command works for me. And the query is this: (the json parsing can be done better...)

       async Task<ulong> GetUid(string type, Guid id)
        {
            if (guidToGraphUid.Count > 100000000)
                guidToGraphUid.Clear();

            if (guidToGraphUid.ContainsKey(id)) return guidToGraphUid[id];
            var qry = $@"
{{
  obj(eq(""objectId"", ""{id.ToString("N")}"")) @filter(eq(""type"", ""{type}"")) {{
    _uid_
  }}
}}";
            var x = await _httpClient.PostAsync("", new StringContent(qry));
            if (x.IsSuccessStatusCode)
            {
                dynamic obj = JObject.Parse(await x.Content.ReadAsStringAsync());
                if (obj != null)
                {
                    JArray resultSet = obj.obj;
                    if (resultSet != null)
                    {
                        foreach (dynamic resultObject in resultSet)
                        {
                            string theUid = resultObject._uid_;
                            return guidToGraphUid[id] = HexLiteral2Unsigned(theUid);
                        }
                    }
                }
            }
            return 0;
        }

@AndreSteenbergen
Copy link
Author

Maybe the filter part is the problem

@pawanrawal
Copy link
Contributor

Hi @AndreSteenbergen I am unfamiliar with the code that you have here. Could you also upload the raw query and the contents of your schema file so that I can run it through our HTTP endpoint and reproduce the crash.

@pawanrawal pawanrawal modified the milestones: v0.8, v0.7.3 Feb 21, 2017
@AndreSteenbergen
Copy link
Author

scalar (
    objectId : id @index
    type : string @index
    name : string @index
)

and the query:

{
  obj(eq("objectId", "d507e730cc4f4ce2847743d23eda02f2")) @filter(eq("type", "website")) {
    _uid_
  }
}

@pawanrawal
Copy link
Contributor

This was associated with #642 and was a bug in Dgraph. It has been fixed and merged to master.

@manishrjain manishrjain added the kind/bug Something is broken. label Mar 21, 2018
arijitAD pushed a commit that referenced this issue Oct 15, 2020
* update pending golint issues for exported methods,vars,const

* update pending golint issues for error strings

* remove golint ignore text for Golint Stutter Warnings and fix reported lint issues

* remove golint annoying to use ignore
fix golint issues for annoying to use
node becomes Node, blockState becomes BlockState, networkState becomes NetworkState

* fixing new lint issues after merge with develop

* removing all disable linting, fixing new lint errors

* update Node to node and update interface methods to lowerCase

* fix lint errs after merge with develop
add comment on decode default case instruction that decodes and ignore return and remove useless cast

* fixing minor issues after merge with development
adding comments on exported funcs and other minor lint errs after merge with development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken.
Development

No branches or pull requests

4 participants