Azure-Samples / graphrag-accelerator

One-click deploy of a Knowledge Graph powered RAG (GraphRAG) in Azure
https://github.com/microsoft/graphrag
MIT License
1.65k stars 250 forks source link

[BUG] HTTP/1.1 500 Internal Server Error using Perform a local search across the knowledge graph index API #119

Closed aantonellims closed 1 month ago

aantonellims commented 1 month ago

Describe the bug

Hello,

I'm trying to run the 1-Quickstart.ipynb notebook, but facing issue when trying to perform local/global search : b'{"detail":"Internal Server Error"}'

Testing APIs directly from the APIM, I'm reaching to call others API, but not the POST (Local/Global) APIs with the same facing the same 503 Internal Server error issue :

HTTP/1.1 500 Internal Server Error apim-trace-id: be717058c5b1415395302df95c031d25 content-length: 33 date: Wed, 31 Jul 2024 14:19:53 GMT ocp-apim-apiid: GraphRAG ocp-apim-operationid: local_query_query_local_post ocp-apim-subscriptionid: master request-context: appId=cid-v1:4b6ca155-c32d-428c-a2cd-643e3ade65df vary: Origin

here is the trace :

pi-inspector (0.261 ms) { "request": { "scheme": { "received": "https", "original": "https" }, "method": "POST", "url": "https://apim-xxxxx.azure-api.net/query/local", "headers": [ { "name": "sec-ch-ua", "value": "\"Not)A;Brand\";v=\"99\",\"Microsoft Edge\";v=\"127\",\"Chromium\";v=\"127\"" }, { "name": "ocp-apim-subscription-key", "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, { "name": "sec-ch-ua-mobile", "value": "?0" }, { "name": "X-Forwarded-For", "value": "167.xx.xx.xx" }, { "name": "sec-ch-ua-platform", "value": "\"Windows\"" }, { "name": "Sec-Fetch-Site", "value": "cross-site" }, { "name": "Sec-Fetch-Mode", "value": "cors" }, { "name": "Sec-Fetch-Dest", "value": "empty" }, { "name": "Cache-Control", "value": "no-cache, no-store" }, { "name": "Content-Length", "value": "58" }, { "name": "Content-Type", "value": "application/json" }, { "name": "Accept", "value": "/" }, { "name": "Accept-Encoding", "value": "gzip,deflate,br,zstd" }, { "name": "Accept-Language", "value": "en-GB,en;q=0.9,en-US;q=0.8,fr-FR;q=0.7,fr;q=0.6" }, { "name": "Host", "value": "apim-xxxxxx.azure-api.net" }, { "name": "Referer", "value": "https://apimanagement.hosting.portal.azure.net/" } ] } } api-inspector (0.004 ms) { "configuration": { "api": { "from": "/", "to": { "scheme": "http", "host": "graphrag.graphrag.io", "port": 80, "path": "/", "queryString": "", "query": {}, "isDefaultPort": true }, "version": null, "revision": "1" }, "operation": { "method": "POST", "uriTemplate": "/query/local" }, "user": "-", "product": "-" } }

cors (0.017 ms) "Origin header was missing or empty and the request was classified as not cross-domain. CORS policy was not applied." cors (0.001 ms) "Origin header was missing or empty and the request was classified as not cross-domain. CORS policy was not applied."

Backend

(2,820.200 ms)↑ Back to top forward-request (0.119 ms) { "message": "Request is being forwarded to the backend service. Timeout set to 300 seconds", "request": { "method": "POST", "url": "http://graphrag.graphrag.io/query/local", "headers": [ { "name": "Host", "value": "graphrag.graphrag.io" }, { "name": "Content-Length", "value": 58 }, { "name": "sec-ch-ua", "value": "\"Not)A;Brand\";v=\"99\",\"Microsoft Edge\";v=\"127\",\"Chromium\";v=\"127\"" }, { "name": "Request-Id", "value": "|9cf4011c-4cbb6e6b4932d40a.9cf4011d_" }, { "name": "ocp-apim-subscription-key", "value": "xxxxxxxxxxxxxxxxxxxxxxxx" }, { "name": "sec-ch-ua-mobile", "value": "?0" }, { "name": "X-Forwarded-For", "value": "167.xx.xx.xx,20.xx.xx.xx" }, { "name": "sec-ch-ua-platform", "value": "\"Windows\"" }, { "name": "Sec-Fetch-Site", "value": "cross-site" }, { "name": "Sec-Fetch-Mode", "value": "cors" }, { "name": "Sec-Fetch-Dest", "value": "empty" }, { "name": "Cache-Control", "value": "no-cache, no-store" }, { "name": "Content-Type", "value": "application/json" }, { "name": "Accept", "value": "/" }, { "name": "Accept-Encoding", "value": "gzip,deflate,br,zstd" }, { "name": "Accept-Language", "value": "en-GB,en;q=0.9,en-US;q=0.8,fr-FR;q=0.7,fr;q=0.6" }, { "name": "Referer", "value": "https://apimanagement.hosting.portal.azure.net/" }, { "name": "Request-Context", "value": "appId=cid-v1:4b6ca155-c32d-428c-a2cd-643e3ade65df" } ] } } forward-request (2,820.081 ms) { "response": { "status": { "code": 500, "reason": "Internal Server Error" }, "headers": [ { "name": "Connection", "value": "keep-alive" }, { "name": "Content-Length", "value": "33" }, { "name": "Date", "value": "Wed, 31 Jul 2024 14:19:54 GMT" } ] } } Outbound (0.226 ms)↑ Back to top transfer-response (0.226 ms) { "message": "Response has been sent to the caller in full" }

To Reproduce Steps to reproduce the behavior:

  1. Go to 'APIM'
  2. Click on 'Perform a local search across the knowledge graph index.'

a. Ocp-Apim-Subscription-Key : copy key from APIM subscription... b. request body : Request body : raw : {"index_name": "idx-grph-001","query":"summarize the content"}

  1. HTTP request look like

POST https://apim-xxxxxx.azure-api.net/query/local HTTP/1.1 Host: apim-4iclbhcsx6i6k.azure-api.net Content-Type: application/json

{"index_name":"idx-grph-001","query":"summarize the data"}

  1. See error

HTTP/1.1 500 Internal Server Error apim-trace-id: be717058c5b1415395302df95c031d25 content-length: 33 date: Wed, 31 Jul 2024 14:19:53 GMT ocp-apim-apiid: GraphRAG ocp-apim-operationid: local_query_query_local_post ocp-apim-subscriptionid: master request-context: appId=cid-v1:4b6ca155-c32d-428c-a2cd-643e3ade65df vary: Origin

Expected behavior

Screenshots see above trace provided.

Additional context Add any other context about the problem here.

can someone help on this issue ?

thanks in advance,

aantonellims commented 1 month ago

looking AKS GraphRAG Query pod logs :

KeyError: 'Could not automatically map gpt4o to a tokeniser. Please use tiktoken.get_encoding to explicitly get the tokeniser you expect.'