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] net/http throwing http2: no cached connection was available #296

Open
conradj3 opened this issue Jan 4, 2025 · 0 comments
Open

[BUG] net/http throwing http2: no cached connection was available #296

conradj3 opened this issue Jan 4, 2025 · 0 comments

Comments

@conradj3
Copy link

conradj3 commented Jan 4, 2025

Description
It seems there is a bug with net/http package, when leverage Golang version go1.23.2. When attempting to call an API using this client/account packages for example it simply returned no cached connection available when $env:GODEBUG='http2debug=1' is set, when its not it just returns an EOF most likely because of the reuse of the connection that's not there. The Octopus server is running TLS and at 1.2. The api calls work via web browser / PowerShell.

Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.

package main

import (
	"fmt"
	"net/url"

	"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/accounts"
	"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/client"
)

func GetAccountByIDExample() {
	var (
		apiKey     string = "<APIKEY>"
		octopusURL string = "https://<FQDN>/Octopus"
		spaceID    string = "Default"

		// account values
		accountID string = "<USERID>"
	)

	apiURL, err := url.Parse(octopusURL)
	if err != nil {
		_ = fmt.Errorf("error parsing URL for Octopus API: %v", err)
		return
	}

	octopusClient, err := client.NewClient(nil, apiURL, apiKey, "")
	if err != nil {
		_ = fmt.Errorf("error creating API client: %v", err)
		return
	}

	// get account by its ID
	account, err := accounts.GetByID(octopusClient, spaceID, accountID)
	if err != nil {
		_ = fmt.Errorf("error getting account: %v", err)
		return
	}

	fmt.Printf("account: (%s)\n", account.GetID())
}
func main() {
	GetAccountByIDExample()
}

Expected Behavior
It should establish a client connection to Octopus and query the accounts with query id. It should just return the same value as provided in the vars via std out.

Any Logs and/or Other Supporting Information

Environment and/or Versions

  • Octopus Server Version: [2024.2.9313]
  • go version go1.23.2 windows/amd64

Additional Context
Add any other context about the problem here.

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

1 participant