{"record":{"id":"554a9cada643a786","repo":"goharbor/harbor","slug":"empty-realm","errorCode":null,"errorMessage":"empty realm","messagePattern":"empty realm","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pkg/reg/adapter/gitlab/client.go","lineNumber":49,"sourceCode":"\t\"github.com/goharbor/harbor/src/pkg/reg/util\"\n)\n\n// Client is a client to interact with GitLab\ntype Client struct {\n\tclient   *common_http.Client\n\turl      string\n\tusername string\n\ttoken    string\n}\n\n// NewClient creates a new GitLab client.\nfunc NewClient(registry *model.Registry) (*Client, error) {\n\trealm, _, err := util.Ping(registry)\n\tif err != nil && !liberrors.IsChallengesUnsupportedErr(err) {\n\t\treturn nil, err\n\t}\n\tif realm == \"\" {\n\t\treturn nil, fmt.Errorf(\"empty realm\")\n\t}\n\tlocation, err := url.Parse(realm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient := &Client{\n\t\turl:      location.Scheme + \"://\" + location.Host,\n\t\tusername: registry.Credential.AccessKey,\n\t\ttoken:    registry.Credential.AccessSecret,\n\t\tclient: common_http.NewClient(\n\t\t\t&http.Client{\n\t\t\t\tTransport: common_http.GetHTTPTransport(\n\t\t\t\t\tcommon_http.WithInsecure(registry.Insecure),\n\t\t\t\t\tcommon_http.WithCACert(registry.CACertificate),\n\t\t\t\t),\n\t\t\t\tTimeout: config.RegistryHTTPClientTimeout(),\n\t\t\t}),\n\t}","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/pkg/reg/adapter/gitlab/client.go#L31-L67","documentation":"Error \"empty realm\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/pkg/reg/adapter/gitlab/client.go:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}