goharbor/harbor · error

[VolcengineCR] fail to parse expire time returned

Error message

[VolcengineCR] fail to parse expire time returned: %v

What it means

Returned in the VolcEngine CR authorizer's Modify when the token expiration timestamp returned by GetAuthorizationToken cannot be parsed as RFC3339. The auth token itself was received, but its ExpireTime field is in an unexpected format, so the auth cache expiry cannot be established and the cached credential would never be refreshed reliably.

Solutions

  1. Check the raw ExpireTime value returned by the VolcEngine CR API
  2. Verify the VolcEngine SDK version matches the CR API's time format
  3. Upgrade the SDK if the service changed its timestamp format
  4. Retry once; malformed responses can be transient
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/pkg/reg/adapter/volcenginecr/auth.go:75 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/1026918c83b8d1a9. Report an issue: GitHub.

Appendix: source

Thrown at src/pkg/reg/adapter/volcenginecr/auth.go:75

		return errNilVolcCrClient
	}
	if !c.isCacheAuthValid() {
		log.Debugf("update token %s\n", r.Host)
		authResp, err := c.client.GetAuthorizationToken(&cr.GetAuthorizationTokenInput{
			Registry: &c.registry,
		})
		if err != nil {
			return err
		}
		if authResp == nil || authResp.Username == nil || authResp.Token == nil || authResp.ExpireTime == nil {
			return errors.New("[VolcengineCR] GetAuthorizationToken output nil")
		}
		c.authCache.username = *authResp.Username
		c.authCache.password = *authResp.Token
		expireTime, err := time.Parse(time.RFC3339, *authResp.ExpireTime)
		if err != nil {
			log.Errorf("fail to parse expire time returned: %v", err)
			return fmt.Errorf("[VolcengineCR] fail to parse expire time returned: %v", err)
		}
		c.authCache.expireAt = &expireTime
	} else {
		log.Debug("token cached")
	}
	r.SetBasicAuth(c.authCache.username, c.authCache.password)
	return nil
}

func (c *volcCredential) isCacheAuthValid() bool {
	if c.authCache == nil || c.authCache.expireAt == nil {
		return false
	}
	if time.Now().After(*c.authCache.expireAt) {
		return false
	}
	return true
}

View on GitHub (pinned to 7b2fd08cc5)