goharbor/harbor · error

[ ][ ]

Error message

[%d][%s]

What it means

Returned by FetchArtifacts when the Huawei SWR dockyard repositories API (filter=center::self) responds with a non-2xx status. It embeds the HTTP status code and raw body, indicating the repository listing request was rejected before any artifact data could be parsed.

Solutions

  1. Inspect the embedded status code and response body for the SWR error
  2. Validate Huawei Cloud credentials and registry URL
  3. Retry transient 5xx failures; fix configuration for 4xx
  4. Ensure the account can list self-owned repositories in the region
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/pkg/reg/adapter/huawei/image_registry.go:52 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/f34cc27d646d7e86. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/reg/adapter/huawei/image_registry.go:52

	urls := fmt.Sprintf("%s/dockyard/v2/repositories?filter=center::self", a.registry.URL)

	r, err := http.NewRequest(http.MethodGet, urls, nil)
	if err != nil {
		return resources, err
	}

	r.Header.Add("content-type", "application/json; charset=utf-8")

	resp, err := a.client.Do(r)
	if err != nil {
		return resources, err
	}

	defer resp.Body.Close()
	code := resp.StatusCode
	if code >= 300 || code < 200 {
		body, _ := io.ReadAll(resp.Body)
		return resources, fmt.Errorf("[%d][%s]", code, string(body))
	}
	body, err := io.ReadAll(resp.Body)
	if err != nil {
		return resources, err
	}
	repos := []hwRepoQueryResult{}
	err = json.Unmarshal(body, &repos)
	if err != nil {
		return resources, err
	}
	for _, repo := range repos {
		resource := parseRepoQueryResultToResource(repo)
		resource.Registry = a.registry
		resources = append(resources, resource)
	}
	return resources, nil
}

View on GitHub (pinned to 7b2fd08cc5)