Andrey Bushman
Andrey Bushman

Reputation: 12516

VaultSharp: Why I get the "no handler for route" error?

Windows 10 x64

Vault works in the docker container on my computer. I can get my secret successfully by the container console:

enter image description here

But I get the exception when I try to do the same through C# code (VaultSharp, .Net Framework 4.8):

try
{
    IAuthMethodInfo authMethod = new TokenAuthMethodInfo("myroot");

    var vaultClientSettings = new VaultClientSettings(
        "http://localhost:8200", authMethod);

    IVaultClient vaultClient = new VaultClient(vaultClientSettings);
    
    Secret<SecretData> kv2Secret = await vaultClient.V1.Secrets.KeyValue.V2
        .ReadSecretAsync(path: "secret/dev/crm", mountPoint: "kv");
}
catch (Exception ex)
{
    throw ex; // ERROR: {"errors":["no handler for route 'kv/data/secret/dev/crm'"]}
}

Why I get it and how can I solve this problem?

Upvotes: 0

Views: 2018

Answers (1)

Andrey Bushman
Andrey Bushman

Reputation: 12516

It seems like bug. I found the decission of my problem here.

Upvotes: -1

Related Questions