jfrog / vault-plugin-secrets-artifactory

HashiCorp Vault Secrets Plugin for Artifactory
https://jfrog.com
Apache License 2.0
43 stars 21 forks source link

Can't activate plugin in hashicorp/vault alpine docker image #211

Closed AdrianCozma closed 2 months ago

AdrianCozma commented 2 months ago

Describe the bug Trying to enable the plugin in a Vault instance running in K8s gives the following error:

│ Code: 400. Errors:
│ 
│ * invalid backend version: 2 errors occurred:
│   * Unrecognized remote plugin message: 
│ Failed to read any lines from plugin's stdout
│ This usually means
│   the plugin was not compiled for this architecture,
│   the plugin is missing dynamic-link libraries necessary to run,
│   the plugin is not executable by this process due to file permissions, or
│   the plugin failed to negotiate the initial go-plugin protocol handshake
│ 
│ Additional notes about plugin:
│   Path: /etc/vault.d/plugin/artifactory-secrets-plugin-v1.8.0
│   Mode: -rwxr--r--
│   Owner: 100 [vault] (current: 100 [vault])
│   Group: 1000 [vault] (current: 1000 [vault])
│   ELF architecture: EM_X86_64 (current architecture: amd64)
│ 
│   * Unrecognized remote plugin message: 
│ Failed to read any lines from plugin's stdout
│ This usually means
│   the plugin was not compiled for this architecture,
│   the plugin is missing dynamic-link libraries necessary to run,
│   the plugin is not executable by this process due to file permissions, or
│   the plugin failed to negotiate the initial go-plugin protocol handshake
│ 
│ Additional notes about plugin:
│   Path: /etc/vault.d/plugin/artifactory-secrets-plugin-v1.8.0
│   Mode: -rwxr--r--
│   Owner: 100 [vault] (current: 100 [vault])
│   Group: 1000 [vault] (current: 1000 [vault])
│   ELF architecture: EM_X86_64 (current architecture: amd64)

The problem seems to be that the official Vault image is based on alpine and the binary isn't built for it. The vault configuration is the default one.

I've tried the same setup on a VM (running Ubuntu) and there were no issues.

Vault version: 1.17.2 Vault docker image: https://hub.docker.com/layers/hashicorp/vault/1.17.2/images/sha256-8332cae948325b6149f51e5f868ac0c4e7e5f1c67278ae1e743ff1d5552dfd16?context=explore Artifactory plugin version: 1.8.0 amd64 Artifactory version: SaaS

Requirements for and issue

Expected behavior Artifactory plugin should be successfully activated using the official vault image..

alexhung commented 2 months ago

@AdrianCozma The Docker image is multiplatform so there's a AMD64 version: https://hub.docker.com/layers/hashicorp/vault/1.17.2/images/sha256-10d7ebc9b405c01ffdeedfd5b9b6a41edbe4519b7b5834ab4bc36b849204ac3d?context=explore

If you have specific reason to use the 386 version, then I may consider adding 386 architecture.

AdrianCozma commented 2 months ago

Thanks for the fast reply @alexhung. I am using the amd64 version, it was a bad copy paste on my side. To give more details, I am running vault in GKE and that is where I am seeing the error.

I did a few more tests and locally, running vault with the same image as in GKE, it all works as expected.

alexhung commented 2 months ago

@AdrianCozma So everything is working for you? I can close this issue?