Azure-Samples / azure-openai-rag-workshop

Create your own ChatGPT with Retrieval-Augmented-Generation workshop
https://aka.ms/ws/openai-rag
MIT License
97 stars 349 forks source link

Container Apps errors #16

Closed SpannTechWizard closed 6 months ago

SpannTechWizard commented 9 months ago

After running the command "azd provision," the backend container app as well as the indexer container app revision goes from Provisioning - Activating - Degraded. The backend container logs have a message about Qdrant URL needs to be set. The indexer container logs has messages stating the connection was refused.

You cannot move forward in the workshop steps. When you run the "./scripts/index-data.sh" the CLI output says it is indexing 3 files(s) but after a few minutes, the command times out.

Steps to reproduce: Follow the workshop instructions on step 5 and wait for the resources to be deployed. Then check the replicas in both Container Apps.

sinedied commented 9 months ago

It seems Step 4 is missing a part on our side. At the end of this step, you should have a .env file at the root of your project, containing a QDRANT_URL set inside. Replace that line with QDRANT_URL="http://localhost:6333"

At this point it's "normal" that the containers are degraded, we do not have deployed anything yet so it's using a dummy image.

I'll update the docs to fix this, thanks for the catch!

SpannTechWizard commented 9 months ago

I have made that change you mentioned. Now, when I get to step 7 Data ingestion. I ran the azd deploy indexer command. That container revision fails. If you don't check to see if the container revision is health, the next command in the step ./scripts/index-data.sh fails with the following output:

Running "index-files" CLI tool Indexing 3 file(s)... Error indexing files: Unexpected token 's', "stream timeout" is not valid JSON

sinedied commented 9 months ago

Are you following the Qdrant or the AI Search version of the workshop? As the steps are slightly different. In the Qdrant version, at step 7 you're not supposed to run the azd deploy indexer command, but run it locally using docker compose up: https://moaw.dev/workshop/gh:sinedied/openai-rag/docs/workshop-qdrant.md?step=6#running-the-ingestion-process

At this point the ./scripts/index-data.sh targets localhost, so if you did not run docker compose up it's normal that it fails.

Though as a side note, running azd deploy indexer should not result in a failing container at this point. Do you have more information about the failure here? You should be able to see the logs in the Azure portal, in the Log stream section of the container app.

Screenshot 2024-02-15 at 09 15 38
SpannTechWizard commented 9 months ago

I am following the AI Search version. I sync'd my fork of the codebase. When I get to the step to deploy the indexer container, the container fails to build.

sinedied commented 8 months ago

I found the issue, the indexer service has been updated and should not fail now in the AI Search version. Something was broken when Qdrant support was added. You just need to get this updated file in your fork to make it work: https://github.com/Azure-Samples/azure-openai-rag-workshop/blob/main/src/indexer/src/plugins/config.ts

sinedied commented 6 months ago

Closing, as the issue is now fixed.