0

I've been using GCP SecretManager in .Net core project ,while accessing one of the secret placed in GCP it throws an error


Grpc.Core.RpcException: 'Status(StatusCode="Unavailable", Detail="failed to connect to all addresses", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {"created":"@1621849302.013000000","description":"Failed to pick subchannel","file":"......\src\core\ext\filters\client_channel\client_channel.cc","file_line":5397,"referenced_errors":[{"created":"@1621849296.458000000","description":"failed to connect to all addresses","file":"......\src\core\ext\filters\client_channel\lb_policy\pick_first\pick_first.cc","file_line":398,"grpc_status":14}]}")'


 public String AccessSecretVersion(string projectId = "strategic-ivy-310114", string secretId = "connectionString", string secretVersionId = "1")
    {
        var credential = GoogleCredential.FromFile(@"C:\Learning\SampleApps\CosmosWithSecret\CosmosDBApp\CosmosDb_Demo_Crud\strategic-ivy-615459-a0f786577j32.json");
        // Create the client.
        SecretManagerServiceClient client = SecretManagerServiceClient.Create();

        // Build the resource name.
        SecretVersionName secretVersionName = new SecretVersionName(projectId, secretId, secretVersionId);

        // Call the API.
        AccessSecretVersionResponse result = client.AccessSecretVersion(secretVersionName);

        // Convert the payload to a string. Payloads are bytes by default.
        String payload = result.Payload.Data.ToStringUtf8();
        return payload;
    }
Masoud Andalibi
  • 3,168
  • 5
  • 18
  • 44
Sachin Kalia
  • 1,027
  • 14
  • 24
  • This appears to be an issue with grpc. From [this thread](https://github.com/grpc/grpc/issues/23340), it appears the root cause could be related to a proxy. Are you using an http(s) proxy? – sethvargo May 24 '21 at 14:58

1 Answers1

0

I've also got this error.

I'm running the application on Windows, and what actually worked for me was to run it from WSL. For some reason it crashes on Windows.

Ceres Rohana
  • 101
  • 1
  • 2