Skip to content

HTTP logs are leaking to stderr from v0.8.0 onwards #239

@shreyas-goenka

Description

@shreyas-goenka

We make the following function call in our code, without setting (ExactVersion).logger. Thus the discardLogger should be used and no logs should have been emitted. However, when we upgraded our hc-install dependency from version 0.7.0 to 0.8.0, we started seeing these GET HTTP requests leak into our stderr logs.

Our function call:

	// Download Terraform to private bin directory.
	installer := &releases.ExactVersion{
		Product:    product.Terraform,
		Version:    TerraformVersion,
		InstallDir: binDir,
		Timeout:    1 * time.Minute,
	}
	execPath, err = installer.Install(context.Background())
	if err != nil {
		return "", fmt.Errorf("error downloading Terraform: %w", err)
	}

Leaking logs:

2024/08/22 12:54:28 [DEBUG] GET https://releases.hashicorp.com/terraform/1.5.5/index.json
2024/08/22 12:54:28 [DEBUG] GET https://releases.hashicorp.com/terraform/1.5.5/terraform_1.5.5_SHA256SUMS.72D7468F.sig
2024/08/22 12:54:28 [DEBUG] GET https://releases.hashicorp.com/terraform/1.5.5/terraform_1.5.5_SHA256SUMS
2024/08/22 12:54:28 [DEBUG] GET https://releases.hashicorp.com/terraform/1.5.5/terraform_1.5.5_darwin_arm64.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions