Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported path for sys health endpoint #26458

Open
dkyanakiev opened this issue Apr 17, 2024 · 2 comments
Open

Unsupported path for sys health endpoint #26458

dkyanakiev opened this issue Apr 17, 2024 · 2 comments

Comments

@dkyanakiev
Copy link

Describe the bug
Hi,
I started encountering this bug and unfortunately I wasn't able to track when it was introduced.
I have a cli/tui that interacts with vault, however it started failing doing a health check to get version to do the initial setup.
The idea is to check if the vault instance is enterprise one and do a setup depending on it

The code block is straight forward:

         cfg := api.DefaultConfig()
	cfg.Address = vaultyCfg.VaultAddr

	tlsCfg := &api.TLSConfig{}

	if vaultyCfg.VaultCaCert != "" {
		tlsCfg.CACert = vaultyCfg.VaultCaCert
	}

	if vaultyCfg.VaultClientCert != "" {
		tlsCfg.ClientCert = vaultyCfg.VaultClientCert
	}

	if vaultyCfg.VaultClientKey != "" {
		tlsCfg.ClientKey = vaultyCfg.VaultClientKey
	}

	err := cfg.ConfigureTLS(tlsCfg)
	if err != nil {
		log.Error().Err(err).Msgf("Failed to configure TLS: %v", err)
		return err
	}

	client, err := api.NewClient(cfg)
	if err != nil {
		log.Error().Err(err).Msg("Failed to create Vault client")
		return err
	}

	client.SetToken(vaultyCfg.VaultToken)

	// Check if the client is successfully created by making a request to Vault

	health, err := client.Sys().Health()
	if err != nil {
		log.Error().Err(err).Msg("Failed to do healthcheck with Vault")
		return err
	}

However this is currently resulting in:

Failed to start Vault client: Error making API request.

Namespace: myns/
URL: GET https://<myURL>/v1/sys/health?drsecondarycode=299&performancestandbycode=299&sealedcode=299&standbycode=299&uninitcode=299
Code: 404. Errors:

* unsupported path
exit status 1

I've tried against a HCP Vault instance and a local dev server - no issue.
However the moment I try against a the vault instances we have configured I run into this issue. Is there something that

To Reproduce
Code block is above. Try to access the /v1/sys/health endpoint

Expected behavior
To receive a HealthResponse correctly

Environment:

  • Vault Server Version (retrieve with vault status): 1.15.4+ent
  • Vault API Version : github.com/hashicorp/vault/api v1.12.2
  • Server Operating System/Architecture: macOS Sonoma 14.1.1
@dkyanakiev
Copy link
Author

Anyone know how to work around this?

@dkyanakiev dkyanakiev changed the title Unsupported path for Sys().Health() Unsupported path for sys health endpoint May 1, 2024
@hsimon-hashicorp
Copy link
Contributor

As you are running an enterprise version, are you able to open a support ticket for this? You may receive a faster response that way.
Thanks!
https://support.hashicorp.com/hc/en-us/requests/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants