question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] 502 (Bad gateway) when using CheckExistence() for Event Grid

See original GitHub issue

Describe the bug Hi, I’m trying to use the following method to check existence of Azure Event Grid existence:

client.Resources.CheckExistence(Configuration.ResourceGroupName, "Microsoft.EventGrid", "", "topics", "test", "2020-06-01");

I managed to get a result few times, but most executions fails with Service request failed. error.

Expected behavior I should receive Response object with no error.

Actual behavior (include Exception or Stack Trace) In response I’m getting the following exception:

Service request failed.
Status: 502 (Bad Gateway)

Content:


Headers:
Cache-Control: no-cache
Pragma: no-cache
x-ms-failure-cause: REDACTED
x-ms-request-id: REDACTED
x-ms-correlation-request-id: REDACTED
x-ms-routing-request-id: REDACTED
Strict-Transport-Security: REDACTED
X-Content-Type-Options: REDACTED
Date: Tue, 09 Feb 2021 20:11:35 GMT
Connection: close
Content-Length: 151
Content-Type: application/json; charset=utf-8
Expires: -1

To Reproduce Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

I’m authenticating and creating the client as follows:

var credentials = new ClientSecretCredential(Configuration.TenantId, Configuration.ClientId, Configuration.ClientSecret);
var client = new ResourcesManagementClient(Configuration.SubscriptionId, credentials);

Then I’m performing a bunch of other operations(like checking if RG exists and perfoming deployment - those operations succeed):

var rgExists = client.ResourceGroups.CheckExistence(Configuration.ResourceGroupName);
client.Deployments.StartCreateOrUpdate((..)

But the command client.Resources.CheckExistence(Configuration.ResourceGroupName, "Microsoft.EventGrid", "", "topics", "test", "2020-06-01") fails.

Environment:

  • Azure.ResourceManager.Resources 1.0.0-preview.2, Azure.Identity 1.3.0
  • VS Code 1.53.0
.NET SDK (reflecting any global.json):
Version:   5.0.102
Commit:    71365b4d42

Runtime Environment:
OS Name:     Windows
OS Version:  10.0.18363
OS Platform: Windows
RID:         win10-x64
Base Path:   C:\Program Files\dotnet\sdk\5.0.102\

Host (useful for support):
 Version: 5.0.2
 Commit:  cb5f173b96

.NET SDKs installed:
 2.1.805 [C:\Program Files\dotnet\sdk]
 3.1.102 [C:\Program Files\dotnet\sdk]
 5.0.102 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
 Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
 Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jbocklecommented, Feb 24, 2021

I’m seeing the same issue with this api https://docs.microsoft.com/en-us/rest/api/resources/resources/checkexistencebyid also, however the response is BadRequest for me.

P.S. the api version listed in the docs appears to be incorrect, if I use resources/getbyid which references the same api version 2020-06-01, I get an error that its not a supported api version.

1reaction
jsquirecommented, Feb 18, 2021

Thank you, @ahamad-MS. I believe the ARM tag is what we’re looking for. I’ve retagged based on your feedback.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting bad gateway errors in Application Gateway
Learn how to troubleshoot Application Gateway Server Error: 502 - Web server received an invalid response while acting as a gateway or proxy ......
Read more >
How To Fix a 502 Bad Gateway Error
The 502 bad gateway error means that the server received an invalid response from an inbound server. Check out these common causes and ......
Read more >
How to Fix 502 Bad Gateway Error
This article will go over some troubleshooting steps to follow when a 502 Bad Gateway error occurs, both for the server and client-side....
Read more >
Troubleshooting HTTP 502 bad gateway
An HTTP 502 - bad gateway server error response code indicates that the server, while acting as a gateway or proxy, received an...
Read more >
Troubleshooting 502 Bad Gateway with nginx-ingress ...
This error typically occurs when a server acting as a gateway or proxy receives an invalid response from an upstream server. In the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found