Skip to content

Commit 4526947

Browse files
committed
Added error notification and causes on 403 docker push
1 parent 5f4344d commit 4526947

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

artifactory/utils/container/image.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,12 @@ func (image *Image) GetRemoteRepo(serviceManager artifactory.ArtifactoryServices
152152
if err != nil {
153153
return "", err
154154
}
155+
errorMessage := "error while getting docker repository name. Artifactory response: " + resp.Status + "."
156+
if resp.StatusCode == http.StatusForbidden {
157+
errorMessage = errorMessage + " Possible causes include Xray scan in progress, Xray policy violations, insufficient permissions, invalid authentication method, disabled anonymous access, missing Docker manifests. Please verify the above factors to resolve the issue."
158+
}
155159
if resp.StatusCode != http.StatusOK {
156-
return "", errorutils.CheckErrorf("error while getting docker repository name. Artifactory response: " + resp.Status)
160+
return "", errorutils.CheckErrorf(errorMessage)
157161
}
158162
if dockerRepo := resp.Header["X-Artifactory-Docker-Registry"]; len(dockerRepo) != 0 {
159163
return dockerRepo[0], nil

0 commit comments

Comments
 (0)