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

GraphQL reports panic on query transactions in all latest releases including 1.5.0-beta3 #1351

Open
astudnev opened this issue Oct 10, 2024 · 5 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed Stale

Comments

@astudnev
Copy link

v1.5.0-beta3 has this issue, as well all previous v1.5X and 1.4.1 build

Example of query is:

  block(number: 62865016) {
    transactions {
      from {
        address
      }
      to {
        address
      }
      hash
      index
      gasUsed
    }
  }
}

returns error:

{"errors":[{"message":"panic occurred: runtime error: index out of range [9] with length 0","path":["block","transactions",9,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [7] with length 0","path":["block","transactions",7,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [5] with length 0","path":["block","transactions",5,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [2] with length 0","path":["block","transactions",2,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [8] with length 0","path":["block","transactions",8,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [1] with length 0","path":["block","transactions",1,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [0] with length 0","path":["block","transactions",0,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [4] with length 0","path":["block","transactions",4,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [3] with length 0","path":["block","transactions",3,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [6] with length 0","path":["block","transactions",6,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [10] with length 0","path":["block","transactions",10,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [19] with length 0","path":["block","transactions",19,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [11] with length 0","path":["block","transactions",11,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [12] with length 0","path":["block","transactions",12,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [13] with length 0","path":["block","transactions",13,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [14] with length 0","path":["block","transactions",14,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [15] with length 0","path":["block","transactions",15,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [16] with length 0","path":["block","transactions",16,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [17] with length 0","path":["block","transactions",17,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [18] with length 0","path":["block","transactions",18,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [28] with length 0","path":["block","transactions",28,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [20] with length 0","path":["block","transactions",20,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [21] with length 0","path":["block","transactions",21,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [31] with length 0","path":["block","transactions",31,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [22] with length 0","path":["block","transactions",22,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [23] with length 0","path":["block","transactions",23,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [24] with length 0","path":["block","transactions",24,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [25] with length 0","path":["block","transactions",25,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [26] with length 0","path":["block","transactions",26,"gasUsed"]},{"message":"panic occurred: runtime error: index out of range [27] with length 0","path":["block","transactions",27,"gasUsed"]},

and in logs:

graphql: panic occurred: runtime error: index out of range [24] with length 0
goroutine 1492143 [running]:
github.com/graph-gophers/graphql-go/log.(*DefaultLogger).LogPanic(0xc029211488?, {0x4382458, 0xc079d91b30}, {0x30339e0, 0xc060c0c708})
	/go/pkg/mod/github.com/graph-gophers/[email protected]/log/log.go:21 +0x65
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2.1()
	/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:187 +0x83
panic({0x30339e0?, 0xc060c0c708?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
github.com/ethereum/go-ethereum/graphql.(*Transaction).getReceipt(0xc08270e460, {0x4382458, 0xc079d91b30})
	/go/src/github.com/ethereum/go-ethereum/graphql/graphql.go:453 +0x86
github.com/ethereum/go-ethereum/graphql.(*Transaction).GasUsed(0x2?, {0x4382458?, 0xc079d91b30?})
	/go/src/github.com/ethereum/go-ethereum/graphql/graphql.go:469 +0x1d
reflect.Value.call({0x317d960?, 0xc07c3aa4c0?, 0x3293?}, {0x31fe463, 0x4}, {0xc03342df38, 0x1, 0x1?})
	/usr/local/go/src/reflect/value.go:596 +0xca6
reflect.Value.Call({0x317d960?, 0xc07c3aa4c0?, 0xc05eac0870?}, {0xc03342df38?, 0x31de9c0?, 0xc075b83580?})
	/usr/local/go/src/reflect/value.go:380 +0xb9
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2(0xc077e1e900?, {0x4382458?, 0xc079d91b30?}, 0xc06333ea08, 0xc05c339380, 0xc029211eb8, {0x4382458, 0xc079d91b30})
	/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:211 +0x3fc
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection({0x4382458, 0xc079d91b30}, 0xc0808b3300, 0xc03f8eea50, 0xc05c339380, 0xc06333ea08, 0x1)
	/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:231 +0x1a5
github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func1(0xc05c339380)
	/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:81 +0x1b2
created by github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections in goroutine 1492138
	/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:77 +0x1af

@astudnev astudnev changed the title GraphQL reports panic on query transactions in all latest releases till 1.5.0-beta3 GraphQL reports panic on query transactions in all latest releases including 1.5.0-beta3 Oct 10, 2024
@astudnev
Copy link
Author

Possible cause of this reported in log:

context: context.Background.WithValue(type *http.contextKey, val <not Stringer>).WithValue(type *http.contextKey, val 192.168.5.212:8545).WithCancel.WithCancel.WithCancel
ERROR[10-10|12:16:36.999] Invalid receipt array RLP                hash=4442e8..c4cb37 err="rlp: too few elements for types.Log, decoding into ([]*types.ReceiptForStorage)[0](types.storedReceiptRLP).Logs[0]"

and the hash there is NOT the hash of the block i query, which is kind of strange

@Raneet10
Copy link
Member

Hey @astudnev can you try out the latest tag (v1.5.0) ?

@andreyvg
Copy link

this request causes panic on 1.5.0 release too
curl -X POST http://<matic-nost>:8545/graphql -H 'accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3' -H 'accept: application/json' -H 'user-agent: Ruby' -H 'content-type: application/json' -d '{"query":"query {\n block(number: 63425354){\n transactions {\n\n from {\n address\n }\n to {\n address\n }\n index\n status\n gasUsed\n cumulativeGasUsed\n createdContract{\n address\n }\n logs {\n index\n account {\n address\n }\n topics\n data\n }\n\n }\n }\n }"}' --compressed -o /dev/null -sSf curl: (22) The requested URL returned error: 400

@ssandeep ssandeep added good first issue Good for newcomers help wanted Extra attention is needed labels Oct 25, 2024
Copy link

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

Copy link

github-actions bot commented Dec 3, 2024

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed Stale
Projects
None yet
Development

No branches or pull requests

6 participants
@ssandeep @andreyvg @astudnev @Raneet10 @pratikspatil024 and others