{"record":{"id":"c1f4707c3e44d380","repo":"goharbor/harbor","slug":"projectpolicyviolation-c1f470","errorCode":"PROJECTPOLICYVIOLATION","errorMessage":"current image without vulnerability scanning cannot be pulled due to configured policy in 'Prevent images with vulnerability severity of \"%s\" or higher from running.' To continue with pull, please contact your project administrator for help.","messagePattern":"current image without vulnerability scanning cannot be pulled due to configured policy in 'Prevent images with vulnerability severity of \"(.+?)\" or higher from running\\.' To continue with pull, please contact your project administrator for help\\.","errorType":"error_code","errorClass":"*errors.Error","httpStatus":412,"severity":"error","filePath":"src/server/middleware/vulnerable/vulnerable.go","lineNumber":101,"sourceCode":"\n\t\tvulnerable, err := scanController.GetVulnerable(ctx, art, allowlist, proj.CVEAllowlist.IsExpired())\n\t\tif errors.IsNotFoundErr(err) {\n\t\t\t// When the scanner is disconnected the artifact will be considered not scannable.\n\t\t\t// We'll try to check the existing scan report even when it's not scannable, and only if there is no report, we will skip checking the vulnerability.\n\t\t\tchecker := scanChecker()\n\t\t\tscannable, err := checker.IsScannable(ctx, art)\n\t\t\tif err != nil {\n\t\t\t\tlogger.Errorf(\"check the scannable status of the artifact %s@%s failed, error: %v\", art.RepositoryName, art.Digest, err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif !scannable {\n\t\t\t\tlogger.Debugf(\"artifact %s@%s does not have a scan report, and it is not scannable, skip the checking\", art.RepositoryName, art.Digest)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\t// If the artifact is scannable but there's no report, it's a violation.\n\t\t\tmsg := fmt.Sprintf(`current image without vulnerability scanning cannot be pulled due to configured policy in 'Prevent images with vulnerability severity of \"%s\" or higher from running.' `+\n\t\t\t\t`To continue with pull, please contact your project administrator for help.`, projectSeverity)\n\t\t\treturn errors.New(nil).WithCode(errors.PROJECTPOLICYVIOLATION).WithMessage(msg)\n\t\t} else if err != nil {\n\t\t\tlogger.Errorf(\"get vulnerability summary of the artifact %s@%s failed, error: %v\", art.RepositoryName, art.Digest, err)\n\t\t\treturn err\n\t\t}\n\n\t\tif art.IsImageIndex() {\n\t\t\t// artifact is image index, skip the checking when it is in the allowlist\n\t\t\tskippingAllowlist := []string{image.ArtifactTypeImage, cnab.ArtifactTypeCNAB}\n\t\t\tif slices.Contains(skippingAllowlist, art.Type) {\n\t\t\t\tlogger.Debugf(\"artifact %s@%s is image index and its type is %s in skipping allowlist, \"+\n\t\t\t\t\t\"skip the vulnerability prevention checking\", art.RepositoryName, art.Digest, art.Type)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\n\t\tif !vulnerable.IsScanSuccess() {\n\t\t\tmsg := fmt.Sprintf(`current image with \"%s\" status of vulnerability scanning cannot be pulled due to configured policy in 'Prevent images with vulnerability severity of \"%s\" or higher from running.' `+\n\t\t\t\t`To continue with pull, please contact your project administrator for help.`, vulnerable.ScanStatus, projectSeverity)","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/server/middleware/vulnerable/vulnerable.go#L83-L119","documentation":"Error \"current image without vulnerability scanning cannot be pulled due to configured policy in 'Prevent images with vulnerability severity of \"%s\" or higher from running.' To continue with pull, please contact your project administrator for help.\" thrown in goharbor/harbor.","triggerScenarios":"Thrown at src/server/middleware/vulnerable/vulnerable.go:101 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"}