Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.07k stars 1.19k forks source link

Event grid client requests returned 502 ProviderError #29235

Open sam961124 opened 6 months ago

sam961124 commented 6 months ago

Describe the bug Sending system topics create/list request through EventGridManagementClient returned 502 Bad Gateway error with a response:

{
    "error": {
        "code": "ProviderError",
        "message": "Resource provider 'Microsoft.EventGrid' failed to return collection response for type 'systemTopics'."
    }
}

We have also tried to send request through axios and fetch with Authorization header appended. However, the result is the same. This issue only happened in certain resource group. The weird thing is that it worked fine through Postman with the exact same request.

Screenshots image

Response header image

github-actions[bot] commented 6 months ago

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

kazrael2119 commented 6 months ago

@sam961124 , could you try again now? I can use sdk to create a system topic

github-actions[bot] commented 6 months ago

Hi @sam961124. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

sam961124 commented 6 months ago

@kazrael2119, we still cannot create a system topic or list system topics under some of subscriptions. We have also tried reregistering the EventGrid provider but it didn't work. However, it worked fine if we send requests through Postman or PowerShell. It seems that this issue only happened on the browser.

kazrael2119 commented 6 months ago

@kazrael2119, we still cannot create a system topic or list system topics under some of subscriptions. We have also tried reregistering the EventGrid provider but it didn't work. However, it worked fine if we send requests through Postman or PowerShell. It seems that this issue only happened on the browser.

@sam961124 could you share with me your code and the full log ?

sam961124 commented 6 months ago

@kazrael2119 I think we found the root cause. If we set the Accept-Language in the headers to a single language, then the API works fine. Postman didn't set Accept-Language header, so it worked. Please help take a look from API side if there's some logics related to this header.

jeremymeng commented 6 months ago

If the issue is the same when using our SDK, axios, or fetch, then it is likely a service issue.

github-actions[bot] commented 6 months ago

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