{"record":{"id":"72b1e60c633c1f18","repo":"goharbor/harbor","slug":"volcenginecr-getauthorizationtoken-output-nil","errorCode":null,"errorMessage":"[VolcengineCR] GetAuthorizationToken output nil","messagePattern":"\\[VolcengineCR\\] GetAuthorizationToken output nil","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/volcenginecr/auth.go","lineNumber":68,"sourceCode":"\t\tregistry:  registry,\n\t\tauthCache: &authCache{},\n\t}\n}\n\nfunc (c *volcCredential) Modify(r *http.Request) (err error) {\n\tif c.client == nil {\n\t\treturn errNilVolcCrClient\n\t}\n\tif !c.isCacheAuthValid() {\n\t\tlog.Debugf(\"update token %s\\n\", r.Host)\n\t\tauthResp, err := c.client.GetAuthorizationToken(&cr.GetAuthorizationTokenInput{\n\t\t\tRegistry: &c.registry,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif authResp == nil || authResp.Username == nil || authResp.Token == nil || authResp.ExpireTime == nil {\n\t\t\treturn errors.New(\"[VolcengineCR] GetAuthorizationToken output nil\")\n\t\t}\n\t\tc.authCache.username = *authResp.Username\n\t\tc.authCache.password = *authResp.Token\n\t\texpireTime, err := time.Parse(time.RFC3339, *authResp.ExpireTime)\n\t\tif err != nil {\n\t\t\tlog.Errorf(\"fail to parse expire time returned: %v\", err)\n\t\t\treturn fmt.Errorf(\"[VolcengineCR] fail to parse expire time returned: %v\", err)\n\t\t}\n\t\tc.authCache.expireAt = &expireTime\n\t} else {\n\t\tlog.Debug(\"token cached\")\n\t}\n\tr.SetBasicAuth(c.authCache.username, c.authCache.password)\n\treturn nil\n}\n\nfunc (c *volcCredential) isCacheAuthValid() bool {\n\tif c.authCache == nil || c.authCache.expireAt == nil {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/volcenginecr/auth.go#L50-L86","documentation":"volcCredential.Modify called GetAuthorizationToken successfully but the response (or its Username/Token/ExpireTime fields) is nil; the guard rejects the partial SDK output before caching credentials, since a usable token was not really obtained.","triggerScenarios":"Thrown at src/pkg/reg/adapter/volcenginecr/auth.go:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request — the volcengine SDK can return incomplete output transiently","Verify the registry credential configuration (access key/region) for the Volcengine CR instance"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}