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

CosmosDB is not working Chat history can't be saved at this time #409

Open
cyrilgarnea opened this issue Nov 22, 2023 · 11 comments
Open

CosmosDB is not working Chat history can't be saved at this time #409

cyrilgarnea opened this issue Nov 22, 2023 · 11 comments
Labels

Comments

@cyrilgarnea
Copy link

As in the title, when I deploy the app from the Azure OpenAI Studio, I cannot save the chat history.

Yes, I checked the "Enable chat history in the web app" box before deploying. The cosmos db is visible in my resources.

Is it a bug? Or can it be solved by properly setting some environment variable?

Thanks a lot

@sarah-widder
Copy link
Contributor

Hi @cyrilgarnea it may be an issue with authentication between your app and the CosmosDB. You may be able to resolve this by adding an environment variable "AZURE_COSMOSDB_ACCOUNT_KEY" and setting the value to an account key from your cosmosdb resource. Hope that helps.

@cyrilgarnea
Copy link
Author

Hi @sarah-widder, Thanks for the tip, the account_key did not exist in my environment variables. However, it did not solve the issue.
Do I need to provide the endpoint of the CosmosDB ? Set an environment variable as the "PRIMARY CONNECTION STRING" in addition to the AZURE_COSMOSDB_ACCOUNT_KEY as the PRIMARY KEY ?

@nickorrnah
Copy link

Any updates on this? I am also running into this issue now using the most recent updates. Have a previous version from a month or so ago that seems to work fine however.

@jainrahulsethi
Copy link

Facing the same issue right now with the latest app. Can someone kindly look into it?

@carrickcheah
Copy link

same issue...

@sarah-widder
Copy link
Contributor

@carrickcheah @cyrilgarnea @jainrahulsethi Can you share the full error message you're seeing today? Note: "Chat history can't be saved at this time" will be at the beginning of a lot of different error messages, so there are a lot of different possible causes.

@carrickcheah
Copy link

carrickcheah commented Aug 20, 2024

@sarah-widder i tried deployed few times...but the message still appear? image attached.

"Chat history is not enabled
CosmosDB database db_conversation_history on account https://hr202408.documents.azure.com:443/ not found. Please contact the site administrator."

ques3
ques5
ques2
ques1

db-hr-assist.azurewebsites.net

@sarah-widder
Copy link
Contributor

@carrickcheah can you confirm that the db_conversation_history container is present on the cosmosdb resource? Maybe it was deleted.

@qi-yuan-cresset
Copy link

@sarah-widder I'm having exactly the same issue with the same error message. I can confirm that the db_conversation_history container is present on the cosmosdb resource, in fact the same container is being used by another web app with no problem. Can you help with this issue?

@Nicozzo
Copy link

Nicozzo commented Sep 26, 2024

Hi. I was having the same problem of “Chat history is not enabled” and instead of copying from Settings > Key the Primary Key in AZURE_COSMOSDB_ACCOUNT_KEY. Copy the primary connection string specifically the value after AccountKey= in AZURE_COSMOSDB_ACCOUNT_KEY. This fixed my error. Then in my local python environment I copied the value to both env.file and .env.sample file. I hope it helps

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants