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

[BUG] [Azure.AI.OpenAI] Validation error at #/dataSources/0/AzureCognitiveSearch/parameters/authentication/APIKey/APIKey: Field required #41138

Open
thomas-christiansen opened this issue Jan 10, 2024 · 34 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@thomas-christiansen
Copy link

thomas-christiansen commented Jan 10, 2024

Library name and version

Azure.AI.OpenAI beta.12
https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.12/sdk/openai/Azure.AI.OpenAI/README.md

Describe the bug

All the sudden when I call GetChatCompletionsAsync using the method described in the readme I get this error:
Validation error at #/dataSources/0/AzureCognitiveSearch/parameters/authentication/APIKey/APIKey: Field required

This just started happening today. I havent made any changes to the code or the search index. When I try to run the reqeust in the Azure AI Studio it works just fine.

What is going on?

Here is my code

        var client = new OpenAIClient(new Uri(_apiBase), new AzureKeyCredential(_apiKey!));

        var primeText = "...";

        AzureCognitiveSearchChatExtensionConfiguration searchExtensionConfig = new()
        {
            SearchEndpoint = new Uri(_searchEndpoint),
            IndexName = _searchIndexName,
            Authentication = new OnYourDataApiKeyAuthenticationOptions(_searchKey),
            DocumentCount = 10,
            Strictness = 1,
            RoleInformation = primeText
        };

        var chatCompletionsOptions = new ChatCompletionsOptions()
        {
            DeploymentName = _deploymentId,
            Messages =  {
                new ChatRequestSystemMessage(primeText)
            },
            AzureExtensionsOptions = new AzureChatExtensionsOptions()
            {
                Extensions = { searchExtensionConfig }
            },
            Temperature = 0.8f

        };
     

        var response = await client.GetChatCompletionsAsync(chatCompletionsOptions);

Expected behavior

I should run without errors as it has been doing until today

Actual behavior

The error has started to occur - has any thing changed? I'm not seeing a new nuget package, the latest is v12-beta

Reproduction Steps

The code is in the description

Environment

No response

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 10, 2024
@thomas-christiansen thomas-christiansen changed the title [BUG] Validation error at #/dataSources/0/AzureCognitiveSearch/parameters/authentication/APIKey/APIKey: Field required [BUG] [Azure.AI.OpenAI] Validation error at #/dataSources/0/AzureCognitiveSearch/parameters/authentication/APIKey/APIKey: Field required Jan 10, 2024
@jsquire jsquire added Service Attention Workflow: This issue is responsible by Azure service team. Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jan 10, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.

1 similar comment
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.

@thesnake666
Copy link

Unfortunately I have the same error with the same client code and library version.
Also for me this behavior just started happening today!
Please, help us.
Thanks

@WueF
Copy link

WueF commented Jan 10, 2024

For me exactly the same issue occured today for the first time, without changing anything to code. Library version is exactly the same.

@freistli
Copy link
Member

freistli commented Jan 11, 2024

I experienced the same issue, it suddenly happened several hours ago with my released binary code, nothing changed from code or configuration. 10 hours ago everything still worked.

It turns to be Azure OpenAI API changes its behavior and returns 400 error directly.

@LucGosso
Copy link

LucGosso commented Jan 11, 2024

Same here, similar code, but version beta11. It started 3 days ago, then it didnt return any result from search first. 2 days ago it worked, yesterday on my important demonstration, it didnt work. Same error, about missingkey.

I guess something changed in azure endpoint?

PS i do get this on 2 different subscriptions, resources in Sweden

@kokuljose
Copy link

Same issue is happening for my two client project for past 5+ hours which is live. Azure.AI.OpenAI version is 1.0.0-beta.12

@horakmi2
Copy link

Same Issue here

@mejerrytech
Copy link

Same here.

@yzweig
Copy link

yzweig commented Jan 11, 2024

Same here

@sonfer
Copy link

sonfer commented Jan 11, 2024

I didn't make any changes to my codes that were working yesterday. But it stopped working properly.

@LucGosso
Copy link

LucGosso commented Jan 11, 2024

How do we report this to Azure?

Do you guys have the same? this is Health of the Openai service in portal

image

@LucGosso
Copy link

I pay for services but can report it when its not working, great deal

image

@126463
Copy link

126463 commented Jan 11, 2024

Same issue since this morning, just before a demo.

@LucGosso
Copy link

Filed an issue via X and got a free technical ticket, got the answer from Azure support:


Thank you for connecting with us. I have gone through all the details you shared; I would like to thank you for briefly describing the complete issue. To start troubleshooting your issue, I would suggest that can you please roll back to the previous Azure OpenAI Package using dotnet. You can use this command for rolling it back to the beta.6 version.

Command: dotnet add package Azure.AI.OpenAI --version 1.0.0-beta.6


If someone wants to try before me ... let us know

@kokuljose
Copy link

kokuljose commented Jan 11, 2024

@LucGosso I have downgraded the system to beta-11, yet the issue remains unresolved. It seems that downgrading to beta 6 will necessitate making corresponding changes to the code, particularly in relation to the message defined in azure.ai.openai. This will require careful consideration and thorough implementation to ensure the successful resolution of the error.

@brunobmo
Copy link

Same with me. Noticed that stopped working yesterday...

@claymartin74
Copy link

I have the same issue today... Started happening in production (no deployment).

@edwardkuo
Copy link

I get the same issue. So nuget version is bug?

@126463
Copy link

126463 commented Jan 12, 2024

I get the same issue. So nuget version is bug?

I think so, everything works fine with Playground - Chat Completions with custom data.

@MahdiSheikhi
Copy link

MahdiSheikhi commented Jan 12, 2024

I observed that the system wasn't functioning correctly since yesterday.

However, I've implemented a temporary fix with the following steps:

  • Enabled Identity for the Azure OpenAI resource.
  • Assigned the Contributor role of Azure OpenAI resource on the Azure Search Service.
  • Modified the authentication type of the client object in the code.

I changed the authentication from using an API key:

Authentication = new OnYourDataApiKeyAuthenticationOptions(myApiKey),

to using a System Assigned Managed Identity:

Authentication = new OnYourDataSystemAssignedManagedIdentityAuthenticationOptions(),

These changes have resolved the issue for now.

@PaulCousinsTTEducation
Copy link

To get the system managed identity workaround to be successful you have to enable "Both" under the keys blade of the search service. I also had to assign both the "Contributor" and "Search Index Data Contributor" roles. Only then did it work for me. This was using the beta.12 version.

@thesnake666
Copy link

thesnake666 commented Jan 12, 2024

This morning, without any changes neither in code nor in configuration, the service is back to work :-)

@thomas-christiansen
Copy link
Author

thomas-christiansen commented Jan 12, 2024

I'm getting a different error now:
'NoneType' object has no attribute 'get'

This happens when I include the "Assistant" response to the message history. This has not been an issue before, so this looks like another bug that have been introduced. I know this is a preview library, but come on. You could at least keep it in sync with the azure openai service....

@brunobmo
Copy link

Still the same APIKey error. No changes today. I will go try the workaround proposed using Identity

@moremanu
Copy link

Same issue since yesterday. Tried with two different solutions, different approaches same error.

@freistli
Copy link
Member

The Azure OpenAI service starts getting to normal, but AzureExtensionsContext.Messages doesn't return Citations. I'm going to create another bug

@LucGosso
Copy link

@freistli yes, i have the same behavior now. No Citations.

result.Value.Choices[0].Message.AzureExtensionsContext.Messages.Any()//no citation here, broken service

@freistli
Copy link
Member

freistli commented Jan 13, 2024

I'm getting a different error now: 'NoneType' object has no attribute 'get'

This happens when I include the "Assistant" response to the message history. This has not been an issue before, so this looks like another bug that have been introduced. I know this is a preview library, but come on. You could at least keep it in sync with the azure openai service....

I hit the same issue "NoneType" when using "Assistant" response yesterday, but today it backs to normal without code changing.

@freistli
Copy link
Member

@freistli yes, i have the same behavior now. No Citations.

result.Value.Choices[0].Message.AzureExtensionsContext.Messages.Any()//no citation here, broken service

@LucGosso I created the new bug here: #41241

@thesnake666
Copy link

Yes, confirm, the result is ok for content but the citations field is null

@LucGosso
Copy link

Out of nothing all working now as expected, citation too, without code changes. Do we know what caused this service break?

@thomas-christiansen
Copy link
Author

Can confirm. It is working as it should again.

I wonder when we can expect a stable version of Azure OpenAI and these components....

@GraysonQuartech
Copy link

GraysonQuartech commented Apr 24, 2024

Currently getting this error.... if anyone found a solution where i can still use the api key to validate that would be great. currently doing this.

const client = new OpenAIClient(AZURE_ENDPOINT, new AzureKeyCredential(AZURE_API_KEY));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests