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

[BUG] Vault trace HttpClient panic when configuring TLS #2565

Open
alin-simionoiuDE opened this issue Feb 15, 2024 · 3 comments
Open

[BUG] Vault trace HttpClient panic when configuring TLS #2565

alin-simionoiuDE opened this issue Feb 15, 2024 · 3 comments
Labels
apm:ecosystem contrib/* related feature requests or bugs bug unintended behavior that has to be fixed

Comments

@alin-simionoiuDE
Copy link

alin-simionoiuDE commented Feb 15, 2024

I have updated my code as specified in the documentation.

We do use TLS when calling vault (copy/paste here how we setup TLS)

	
	vaultapi "github.com/hashicorp/vault/api"
	vaulttrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/hashicorp/vault"


	clientConfig := &vaultapi.Config{
		HttpClient = vaulttrace.NewHTTPClient(),
		Address: address,
		Timeout: 1 * time.Minute,
	}

        if err := clientConfig.ConfigureTLS(
		&vaultapi.TLSConfig{
			CACert: certPath,
		},
   	); err != nil {
 		return nil, err
    }

code panics on clientConfig.ConfigureTLS

anic: interface conversion: http.RoundTripper is *http.roundTripper, not *http.Transport

goroutine 6 [running]:
github.com/hashicorp/vault/api.(*Config).configureTLS(0xc00052c0f0, 0xc0000cb9d0)
	/go/pkg/mod/github.com/hashicorp/vault/api@v1.9.2/client.go:293 +0x52d
github.com/hashicorp/vault/api.(*Config).ConfigureTLS(0xc00052c0f0, 0x2d?)
	/go/pkg/mod/github.com/hashicorp/vault/api@v1.9.2/client.go:358 +0x6a

Version of dd-trace-go
v1.60.0

Describe what happened:
see above

Describe what you expected:
that I can use the vault trace http client when configuring TLS

Steps to reproduce the issue:
See above

Additional environment details (Version of Go, Operating System, etc.):
go version 1.22.0
operating system: I can repro the problem on MacOs 14.3 and on AWS ec2 (linux)

@alin-simionoiuDE alin-simionoiuDE added the bug unintended behavior that has to be fixed label Feb 15, 2024
@github-actions github-actions bot added the needs-triage New issues that have not yet been triaged label Feb 15, 2024
@darccio
Copy link
Contributor

darccio commented Feb 19, 2024

@alin-simionoiuDE Hi! Thanks for reporting this. I can confirm the we are able to reproduce the issue.

Just to double check, is it the first time that you are instrumenting your code with our tracer? I've been reviewing old Vault API versions and it seems that the type cast that panics in your example has been always present. Our integration library sets a custom Roundtripper value, while Vault expects a Transport value.

We'll investigate how to allow using TLS with our custom tracing roundtripper from vault's contrib.

@darccio darccio removed the needs-triage New issues that have not yet been triaged label Feb 19, 2024
@alin-simionoiuDE
Copy link
Author

Yes, I am instrumenting my code using DataDog tracer.

If you don't mind me asking, what do you mean by "...old Vault API versions..."? does that imply there is a newer version of the vault API which won't panic?

@darccio
Copy link
Contributor

darccio commented Feb 19, 2024

@alin-simionoiuDE No, all versions will panic. I checked previous released versions for Vault API to verify if the cause of the panic was an internal implementation detail that changed at some point.

@darccio darccio added the apm:ecosystem contrib/* related feature requests or bugs label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs bug unintended behavior that has to be fixed
Projects
None yet
Development

No branches or pull requests

2 participants