Runtime error: index out of range [79] with length 0

Report a Dgraph Bug

runtime error: index out of range [79] with length 0

What version of Dgraph are you using?


Have you tried reproducing the issue with the latest release?


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

Steps to reproduce the issue (command/config used to run Dgraph).

graph is:

session <-[edge]- visit [1…n] -[edge]-> page


  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( {
      ranks as sum(b)
  q(func: uid(ranks)) {
  q1(func: uid(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 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], 0xc030ef1800, 0xc02db20af8, 0x2, 0x2, 0xc0cc601b10, 0x6)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0x230
[dgraph-alpha-0 alpha]*groupResult).aggregateChild(0xc005a8f270, 0xc030ef1800, 0x1, 0x1)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0x291
[dgraph-alpha-0 alpha]*SubGraph).formResult(0xc030ef1500, 0xc0544a7280, 0xc05a5eefe0, 0x2bcf318, 0x68)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0x65b
[dgraph-alpha-0 alpha]*SubGraph).processGroupBy(0xc030ef1500, 0xc09e70d980, 0xc00060b7f8, 0x0, 0x1, 0xc00060aa58, 0x0)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0x78
[dgraph-alpha-0 alpha]*SubGraph).valueVarAggregation(0xc030ef1500, 0xc09e70d980, 0xc00060b7f8, 0x0, 0x1, 0x0, 0x0, 0x0)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0xe01
[dgraph-alpha-0 alpha]*SubGraph).populatePostAggregation(0xc030ef1500, 0xc09e70d980, 0xc00060b7f8, 0x1, 0x1, 0x0, 0x0, 0x1)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0x1a9
[dgraph-alpha-0 alpha]*Request).ProcessQuery(0xc02db214f8, 0x1e0c1c0, 0xc0665c4db0, 0xc060f46000, 0x7f444d5427d0)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0xd23
[dgraph-alpha-0 alpha]*Request).Process(0xc02db214f8, 0x1e0c1c0, 0xc0665c4db0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0x7c
[dgraph-alpha-0 alpha], 0xc0665c4db0, 0xc001b7eb40, 0x0, 0x0, 0x14)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0x241
[dgraph-alpha-0 alpha]*Server).doQuery(0xc02db21a26, 0x1e0c1c0, 0xc04dfdf020, 0xc0788e90a0, 0x0, 0x0, 0x0, 0x0)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0x4e9
[dgraph-alpha-0 alpha]*Server).Query(0xc007305a26, 0x1e0c180, 0xc08e99d8c0, 0xc0788e90a0, 0x0, 0x0, 0x1e0c1c0)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +0xa6
[dgraph-alpha-0 alpha], 0xc034e20620, 0xc001baa400)
[dgraph-alpha-0 alpha] 	/ext-go/1/src/ +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?

Marked as a bug, needs investigation.

Hi @cajbecu ,

Can you share the schema and the data set? It would help us debug this faster.

@cajbecu Gentle reminder we need data and schema to reproduce this issue

1 Like