LanceMcCarthy / akeyless-action

Use AKeyless static secrets and dynamic secrets in your GitHub Actions workflows.
MIT License
11 stars 4 forks source link

Error: Client could not be found in cache #96

Closed LanceMcCarthy closed 10 months ago

LanceMcCarthy commented 10 months ago

There is an ongoing issue I am investigating where attempting to fetch any secret from the Akeyless portal/gateway results in the following error

getDynamicSecretValue Failed: 
{
  "status":400,
  "body":{"error":"Client could not be found in cache"},
  ....
}

This seems to be specific to the JavaScript SDK's comms with the Akeyless server. I am in communication with the Akeyless team and will update this Issue once more information is known.

Emergency Need

If you have a mission-critical situation, then you can use the alternative approach of using the REST API. Here's an example of using PowerShell to get the secret using a REST call:

$AKEYLESS_ACCESS_ID="p-123456"
$AKEYLESS_ACCESS_KEY="get-me-from-akeyless-portal"

$AuthBody = @{ "access-id" = "p-123456"; "$AKEYLESS_ACCESS_ID" = "$AKEYLESS_ACCESS_KEY"; "access-type" = "access_key"; }

$AuthParameters = @{ Method = "POST"; Uri =  "https://api.akeyless.io/auth"; Body = ($AuthBody | ConvertTo-Json); ContentType = "application/json"; }

$token = (Invoke-RestMethod @AuthParameters).token
$SecretBody = @{ "name" = "/my-secret/path"; "token" = "$token"; }
$SecretParameters = @{ Method = "POST"; Uri =  "https://api.akeyless.io/get-dynamic-secret-value"; Body = ($SecretBody | ConvertTo-Json); ContentType = "application/json"; }
$dynamicSecret = Invoke-RestMethod @SecretParameters
LanceMcCarthy commented 10 months ago

Akeyless reported back to me that the code 400 intermittent issue behind the error has been resolved. I verified this by re-triggering the same failed builds.