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

panic when type assertions in function handleUnbatchedGraphQLRequest #3258

Closed
360AIVul opened this issue Jul 13, 2023 · 1 comment
Closed

Comments

@360AIVul
Copy link

version : 1.20.0

  1. run AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true PERSISTENCE_DATA_PATH=/r3p/vdb/wea/ ./weaviate-server --port=8080 --scheme=http

  2. send curl -X POST -H 'Content-Type: application/json' -d '[{"operationName":"r3","query":"r3","variables":[1337]}]' http://127.0.0.1:8080/v1/graphql/batch

  3. panic

panic: interface conversion: interface {} is []interface {}, not map[string]interface {}

goroutine 2111 [running]:
github.com/weaviate/weaviate/adapters/handlers/rest.handleUnbatchedGraphQLRequest({0x1c0b108, 0xc005a6ba10}, 0x14800000735?, {0x1bfb8a0, 0xc000564000}, 0xc005a6b8c0, 0x0, 0xc0004c48b8, 0xc0028bcd98)
        /r3p/vdb/wea/wea1200/adapters/handlers/rest/handlers_graphql.go:222 +0x6ee
created by github.com/weaviate/weaviate/adapters/handlers/rest.setupGraphQLHandlers.func2
        /r3p/vdb/wea/wea1200/adapters/handlers/rest/handlers_graphql.go:179 +0x36d

if Variables is not map[string]interface{}, it may panic

//handlers_graphql.go:222 
    if unbatchedRequest.Variables != nil {
      variables = unbatchedRequest.Variables.(map[string]interface{})
    }
@etiennedi etiennedi added the bug label Aug 22, 2023
@etiennedi
Copy link
Member

Thank you for the report. We will fix this asap.

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

No branches or pull requests

2 participants