k3s-io/k3s · error

%s: %s

Error message

%s: %s

What it means

Error "%s: %s" thrown in k3s-io/k3s.

Source

Thrown at pkg/clientaccess/token.go:549

	defer resp.Body.Close()
	b, err := io.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	warnings, _ := net.ParseWarningHeaders(resp.Header["Warning"])
	for _, warning := range warnings {
		if warning.Code == 299 && len(warning.Text) != 0 {
			logrus.Warnf("%s", warning.Text)
		}
	}

	if resp.StatusCode < 200 || resp.StatusCode > 299 {
		status := metav1.Status{}
		if err := json.Unmarshal(b, &status); err == nil && status.Kind == "Status" {
			return nil, &apierrors.StatusError{ErrStatus: status}
		}
		return nil, fmt.Errorf("%s: %s", resp.Request.URL, resp.Status)
	}
	return b, nil
}

// FormatToken takes a username:password string or join token, and a path to a certificate bundle, and
// returns a string containing the full K10 format token string. If the credentials are
// empty, an empty token is returned. If the certificate bundle does not exist or does not
// contain a valid bundle, an error is returned.
func FormatToken(creds, certFile string) (string, error) {
	if len(creds) == 0 {
		return "", nil
	}

	b, err := os.ReadFile(certFile)
	if err != nil {
		return "", err
	}
	return FormatTokenBytes(creds, b)

View on GitHub (pinned to 6ba341e396)

When it happens

Trigger: Thrown at pkg/clientaccess/token.go:549 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of k3s-io/k3s@6ba341e396 (2026-08-15). Data as JSON: /api/errors/3cf8118b1594398a. Report an issue: GitHub.