goharbor/harbor · error

[tencent-tcr.newAdapter] Can not get TCR instance info…

Error message

[tencent-tcr.newAdapter] Can not get TCR instance info. RequestId=%s

What it means

Returned by newAdapter when the Tencent Cloud TCR DescribeInstances call for the registry host succeeds but TotalCount is zero — no TCR instance matches the registry name derived from the host. It includes the SDK RequestId for troubleshooting with Tencent Cloud support. The input at fault is the registry endpoint/instance name configured for the adapter.

Solutions

  1. Verify the registry URL host matches an existing TCR instance name (*.tencentcloudcr.com)
  2. Check the instance exists in the Tencent account and region used by the credentials
  3. Use the RequestId to look up the API call in Tencent Cloud logs
  4. Confirm the AK/SK belong to the account that owns the instance
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/pkg/reg/adapter/tencentcr/adapter.go:149 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/87ee5d4684f6aaec. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/reg/adapter/tencentcr/adapter.go:149

		return
	}

	var req = tcr.NewDescribeInstancesRequest()
	req.AllRegion = common.BoolPtr(true)
	req.Filters = []*tcr.Filter{
		{
			Name:   common.StringPtr("RegistryName"),
			Values: []*string{common.StringPtr(strings.ReplaceAll(registryURL.Host, ".tencentcloudcr.com", ""))},
		},
	}
	var resp *tcr.DescribeInstancesResponse
	resp, err = client.DescribeInstances(req)
	if err != nil {
		log.Errorf("DescribeInstances error=%s", err.Error())
		return
	}
	if *resp.Response.TotalCount == 0 {
		err = fmt.Errorf("[tencent-tcr.newAdapter] Can not get TCR instance info. RequestId=%s", *resp.Response.RequestId)
		return
	}
	var instanceInfo = resp.Response.Registries[0]
	log.Debugf("[tencent-tcr.InstanceInfo] registry.URL=%s, host=%s, PublicDomain=%s, RegionName=%s, RegistryId=%s",
		registry.URL, registryURL.Host, *instanceInfo.PublicDomain, *instanceInfo.RegionName, *instanceInfo.RegistryId)

	// rebuild TCR SDK client
	client = &tcr.Client{}
	client.Init(*instanceInfo.RegionName).
		WithCredential(tcrCredential).
		WithProfile(cfp).
		WithHttpTransport(rateLimiterTransport)

	var credential = NewAuth(instanceInfo.RegistryId, client)
	var transport = commonhttp.GetHTTPTransport(
		commonhttp.WithInsecure(registry.Insecure),
		commonhttp.WithCACert(registry.CACertificate),
	)

View on GitHub (pinned to 7b2fd08cc5)