Azure-Samples / graphrag-accelerator

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

When deploying the graphrag backend docker image to ACR #67

Closed rnpramasamyai closed 4 months ago

rnpramasamyai commented 4 months ago

I was getting below errors When I ran "bash deploy.sh -p deploy.parameters.json": Error 1. When deploying the graphrag backend docker image to ACR

image

Error 2. Assigning 'Cognitive Services OpenAI Contributor' AOAI role to managed identity

image

Pls help me to deploy this repo on azure and pls update deployment documentation.

timothymeyers commented 4 months ago

@rnpramasamyai - For Error 2, can you please confirm that you have the required RBAC permissions in your subscription to do the deployment?

https://github.com/Azure-Samples/graphrag-accelerator/blob/main/docs/DEPLOYMENT-GUIDE.md#rbac-permissions

timothymeyers commented 4 months ago

@rnpramasamyai - For Error 1, can you remove > /dev/null 2>&1 from this line in deploy.sh and try rerunning to get more context on the error?

mobehairy commented 4 months ago

@rnpramasamyai - For Error 2, can you please confirm that you have the required RBAC permissions in your subscription to do the deployment?

https://github.com/Azure-Samples/graphrag-accelerator/blob/main/docs/DEPLOYMENT-GUIDE.md#rbac-permissions

I am facing the same issue, my account has contributor and rbac administrator roles how to troubleshoot?

rnpramasamyai commented 4 months ago

@timothymeyers, Error 2: I rechecked permissions, I have granted those two permissions to my Azure account and am trying to deploy a bash script using that account.

Error 1: I removed > /dev/null 2>&1 code from line 532 and then I got below error:

image
vansen commented 4 months ago

I am running into the same issue for Error 2. i can confirm the following permissions are granted on subscription level: image Is there any solution/hint on how to troubleshoot please? Thank you

rnpramasamyai commented 4 months ago

I am getting below error:

image
vansen commented 4 months ago

that seems to be a different error, I get a more generic one: image

Though to my understanding the role assignment should deal with this error, but unfor. does not as it seems.

rnpramasamyai commented 4 months ago

Any help to fix issues?.

mobehairy commented 4 months ago

Yes, after making sure of permissions granted to my account i found that we should put $GRAPHRAG_API_BASE for Azure OpenAI (AOAI) to be the endpoint Open your Azure OpenAI (AOAI) resource on Azure and get endpoint https://.openai.azure.com/

vansen commented 4 months ago

Thanks - but I have already set this to the correct value. So unfortunately not the solution in my case.

mobehairy commented 4 months ago

ok, you need to make sure of $servicePrincipalId and $scope

to make sure that they are the correct IDs, Put in section >> assignAOAIRoleToManagedIdentity() echo $servicePrincipalId echo $scope and make sure that it get the correct IDs

GabrieleCastellani commented 4 months ago

I had the same issue. I had installed the new AOAI service from the new AI Hub portal. Installing the old one (with the OpenAI Logo) did the trick. image

Also be sure that you have specified the right GRAPHRAG_API_BASE

"GRAPHRAG_API_BASE": "https://xxx.openai.azure.com/",

This made the trick

rnpramasamyai commented 4 months ago

I tried to redeploy this repo on azure using bash deploy.sh -p deploy.parameters.json, I faced the following errors:

  1. Couldn't build docker image and push it to ACR.
  2. Couldn't assign 'Cognitive Services OpenAI Contributor' AOAI role to managed identity.
  3. Couldn't assign 'ACRPull' role to AKS to access container registry.
  4. Couldn't peer apim vnet to aks.
  5. Checking for GraphRAG availability was failed.

Pls help me to fix issues.

vansen commented 4 months ago

Yes, that pointed me into the right direction. I was switching the subscription earlier, but the OpenAI Service was still in the old subscription, therefore the access to that was of course not possible. Now I got it working. Thanks

timothymeyers commented 4 months ago

@rnpramasamyai

For 1, see #45 for some tips. This looks like a challenge with the Azure CLI that has popped up over the years. Also see https://github.com/Azure/azure-cli/issues/22301

For 2, this error comes from this method in deploy.sh. Line 267 is what is failing but that is because the scope local variable is not being set correctly on 265. Is your GRAPHRAG_API_BASE variable set correctly in deploy.parameters.json? It should look like "GRAPHRAG_API_BASE": "https://<aoai-name>.openai.azure.com/"

For 3, I might need more context on what you're seeing, but it likely is a result of this line failing. You can remove > /dev/null 2>&1 from the line to get more error output.

For 4, I need to see more output.

For 5, I'm not sure how you got to this point given the above issues, but if you actually have a pod running, you can check the logs for the graphrag-index and graphrag-query pods in AKS (via the Portal or using 'kubectl) to see what errors they are running into.

rnpramasamyai commented 4 months ago

I am using following versions: azure-cli 2.61.0 core 2.61.0 telemetry 1.1.0

Dependencies: msal 1.28.0 azure-mgmt-resource 23.1.1

I commented bash functions if an error occurred.

rnpramasamyai commented 4 months ago

@timothymeyers I fixed all above issues. Now I got another issue: Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp 127.0.0.1:8080: connect: connection refused

I got the above error after running helm upgrade -i graphrag command