goharbor/harbor · error
failed to get authorization token
Error message
failed to get authorization token: %s
What it means
The Ali ACR GetAuthorizationToken response has GetAuthorizationTokenIsSuccess=false: the HTTP call succeeded but the provider refused to issue a registry authorization token (bad instance, credentials or permissions).
Solutions
- Check the ACR access key/secret and instance ID configuration
- Verify RAM policies grant GetAuthorizationToken for the instance
- Confirm the correct (non-VPC vs VPC) domain is configured
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/pkg/reg/adapter/aliacr/openapi.go:323 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/fd363628838a5a43.
Report an issue: GitHub.
Appendix: source
Thrown at src/pkg/reg/adapter/aliacr/openapi.go:323
break
}
page++
}
return tags, nil
}
// GetAuthorizationToken returns the authorization token for repository.
func (acree *acreeOpenapi) GetAuthorizationToken() (*authToken, error) {
tokenRequest := cr_ee.CreateGetAuthorizationTokenRequest()
// FIXME: use vpc endpoint if vpc is enabled
tokenRequest.SetDomain(acree.domain)
tokenRequest.InstanceId = acree.instanceID
tokenResponse, err := acree.client.GetAuthorizationToken(tokenRequest)
if err != nil {
return nil, err
}
if !tokenResponse.GetAuthorizationTokenIsSuccess {
return nil, fmt.Errorf("failed to get authorization token: %s", tokenResponse.GetHttpContentString())
}
return &authToken{
user: tokenResponse.TempUsername,
password: tokenResponse.AuthorizationToken,
expiresAt: time.Unix(tokenResponse.ExpireTime/1000, 0),
}, nil
}
View on GitHub (pinned to 7b2fd08cc5)