goharbor/harbor · error

failed to get authorization token: %s

Error message

failed to get authorization token: %s

What it means

Error "failed to get authorization token: %s" thrown in goharbor/harbor.

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)

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.