Report a Dgraph Bug
runtime error: index out of range [79] with length 0
What version of Dgraph are you using?
dgraph/dgraph:v20.07.0
Have you tried reproducing the issue with the latest release?
no
What is the hardware spec (RAM, OS)?
Linux dgraph-alpha-0 4.19.56-coreos-r1 #1 SMP Tue Jul 30 06:40:10 -00 2019 x86_64 x86_64 x86_64 GNU/Linux
128GB RAM
Steps to reproduce the issue (command/config used to run Dgraph).
graph is:
session <-[edge]- visit [1…n] -[edge]-> page
query:
{
var(func: eq(session.xid, "some xid")) {
~visit {
date as visit.added_at
b as math(since(date)/(24*60*60))
}
}
page_uid as var(func: uid(b)) @groupby(visit.page) {
ranks as sum(b)
}
q(func: uid(ranks)) {
uid
val(ranks)
}
q1(func: uid(page_uid)) {
uid
val(page_uid)
}
}
Expected behaviour and actual result.
not an error
current: runtime error: index out of range [79] with length 0
[dgraph-alpha-0 alpha] 2020/08/18 15:19:03 http: panic serving 10.2.42.128:62493: runtime error: index out of range [79] with length 0
[dgraph-alpha-0 alpha] goroutine 167265644 [running]:
[dgraph-alpha-0 alpha] net/http.(*conn).serve.func1(0xc001ba5540)
[dgraph-alpha-0 alpha] /usr/local/go/src/net/http/server.go:1772 +0x139
[dgraph-alpha-0 alpha] panic(0x1ad6be0, 0xc0656de440)
[dgraph-alpha-0 alpha] /usr/local/go/src/runtime/panic.go:975 +0x3e3
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/query.aggregateGroup(0xc005a8f270, 0xc030ef1800, 0xc02db20af8, 0x2, 0x2, 0xc0cc601b10, 0x6)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/query/groupby.go:152 +0x230
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/query.(*groupResult).aggregateChild(0xc005a8f270, 0xc030ef1800, 0x1, 0x1)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/query/groupby.go:63 +0x291
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/query.(*SubGraph).formResult(0xc030ef1500, 0xc0544a7280, 0xc05a5eefe0, 0x2bcf318, 0x68)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/query/groupby.go:256 +0x65b
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/query.(*SubGraph).processGroupBy(0xc030ef1500, 0xc09e70d980, 0xc00060b7f8, 0x0, 0x1, 0xc00060aa58, 0x0)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/query/groupby.go:376 +0x78
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/query.(*SubGraph).valueVarAggregation(0xc030ef1500, 0xc09e70d980, 0xc00060b7f8, 0x0, 0x1, 0x0, 0x0, 0x0)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/query/query.go:1140 +0xe01
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/query.(*SubGraph).populatePostAggregation(0xc030ef1500, 0xc09e70d980, 0xc00060b7f8, 0x1, 0x1, 0x0, 0x0, 0x1)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/query/query.go:1245 +0x1a9
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/query.(*Request).ProcessQuery(0xc02db214f8, 0x1e0c1c0, 0xc0665c4db0, 0xc060f46000, 0x7f444d5427d0)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/query/query.go:2735 +0xd23
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/query.(*Request).Process(0xc02db214f8, 0x1e0c1c0, 0xc0665c4db0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/query/query.go:2766 +0x7c
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/edgraph.processQuery(0x1e0c1c0, 0xc0665c4db0, 0xc001b7eb40, 0x0, 0x0, 0x14)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/edgraph/server.go:1053 +0x241
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/edgraph.(*Server).doQuery(0xc02db21a26, 0x1e0c1c0, 0xc04dfdf020, 0xc0788e90a0, 0x0, 0x0, 0x0, 0x0)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/edgraph/server.go:984 +0x4e9
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/edgraph.(*Server).Query(0xc007305a26, 0x1e0c180, 0xc08e99d8c0, 0xc0788e90a0, 0x0, 0x0, 0x1e0c1c0)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/edgraph/server.go:897 +0xa6
[dgraph-alpha-0 alpha] github.com/dgraph-io/dgraph/dgraph/cmd/alpha.queryHandler(0x1e05c80, 0xc034e20620, 0xc001baa400)
[dgraph-alpha-0 alpha] /ext-go/1/src/github.com/dgraph-io/dgraph/dgraph/cmd/alpha/http.go:236 +0x44e
[dgraph-alpha-0 alpha] net/http.HandlerFunc.ServeHTTP(0x1c15628, 0x1e05c80, 0xc034e20620, 0xc001baa400)
[dgraph-alpha-0 alpha] /usr/local/go/src/net/http/server.go:2012 +0x44
[dgraph-alpha-0 alpha] net/http.(*ServeMux).ServeHTTP(0x2ba3180, 0x1e05c80, 0xc034e20620, 0xc001baa400)
[dgraph-alpha-0 alpha] /usr/local/go/src/net/http/server.go:2387 +0x1a5
[dgraph-alpha-0 alpha] net/http.serverHandler.ServeHTTP(0xc000426460, 0x1e05c80, 0xc034e20620, 0xc001baa400)
[dgraph-alpha-0 alpha] /usr/local/go/src/net/http/server.go:2807 +0xa3
[dgraph-alpha-0 alpha] net/http.(*conn).serve(0xc001ba5540, 0x1e0c100, 0xc046490ac0)
[dgraph-alpha-0 alpha] /usr/local/go/src/net/http/server.go:1895 +0x86c
[dgraph-alpha-0 alpha] created by net/http.(*Server).Serve
[dgraph-alpha-0 alpha] /usr/local/go/src/net/http/server.go:2933 +0x35c
What I want to achieve:
- each visit contributes to page’s rank by a certain score ( b ) , which they are summed to a
rank
variable. in the end you get <page, rank> by visits
Any ideas?