Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listing tags in JFrog Artifactory may fail #2346

Closed
SSW-SCIENTIFIC opened this issue Jun 3, 2024 · 11 comments
Closed

Listing tags in JFrog Artifactory may fail #2346

SSW-SCIENTIFIC opened this issue Jun 3, 2024 · 11 comments
Labels
jira kind/feature A request for, or a PR adding, new functionality locked - please file new issue/PR

Comments

@SSW-SCIENTIFIC
Copy link

SSW-SCIENTIFIC commented Jun 3, 2024

Hello team,

I want to notify I have encountered en error on skopeo v1.15.1 with multiarch images on JFrog Artifactory.

JFrog Artifactory is an artifact management tool that can be behaved as container image registry.
However, for multiarch images, it violates some behaviors related to tags.

For example,

  1. once pushed an multiarch image multi-arch:v1.0.0, which refers sha256:aaaa...aaaa as a amd64, and sha256:bbbb...bbbb as a arm64, to Artifactory,
  2. Artifactory expose sha256:aaaa...aaaa and sha256:bbbb...bbbb as tags, not only multi-arch:v1.0.0,
  3. and sha256:aaaa...aaaa and sha256:bbbb...bbbb are OCI incompliant tags because they contains :,

So finally we got error on skopeo inspect with time="2024-06-03T09:26:46Z" level=fatal msg="Error determining repository tags: registry returned invalid tag \"sha256:aaaa...aaaa": invalid tag format".

This is quite heavy impact issue even if the Artifactory violates OCI specifications, we can no longer use skopeo v1.15.1 or later with Artifactory.

Can you consider that skopeo simply ignores the invalid tags to keep compatibility?
And we will also contact to JFrog support to improve the behavior above.

@marcaurele
Copy link

marcaurele commented Jun 3, 2024

We are having the same problem on our side with skopeo version 1.15.1. It used to work correctly.

@mtrmac mtrmac added kind/feature A request for, or a PR adding, new functionality jira labels Jun 3, 2024
mtrmac added a commit to mtrmac/image that referenced this issue Jun 3, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
@mtrmac
Copy link
Contributor

mtrmac commented Jun 3, 2024

Thanks for your report. Could you test with containers/image#2440 and confirm that that is sufficient to list all tags without failure, please?

mtrmac added a commit to mtrmac/image that referenced this issue Jun 3, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
mtrmac added a commit to mtrmac/image that referenced this issue Jun 3, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
@SSW-SCIENTIFIC
Copy link
Author

SSW-SCIENTIFIC commented Jun 4, 2024

@mtrmac

git clone https://github.com/containers/skopeo.git && cd skopeo
git checkout release-1.15
go get -d github.com/mtrmac/image/v5@jfrog-invalid-tag
go mod edit -replace=github.com/containers/image/v5=github.com/mtrmac/image/[email protected]
make vendor
go mod tidy
DISABLE_DOCS=1 make

and then run bin/skopeo.
It works good for me (ignoring tags with format sha256:... without errors).

Thank you!

@mtrmac mtrmac changed the title [v1.15.1] Error inspecting multiarch container images on JFrog Artifactory Listing tags in JFrog Artifactory may fail Jun 4, 2024
@carlosmmatos
Copy link

@mtrmac I've also confirmed this patch works by ignoring the sha256: values when listing tags.

TomSweeneyRedHat pushed a commit to TomSweeneyRedHat/image that referenced this issue Jun 13, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
Signed-off-by: tomsweeneyredhat <[email protected]>
TomSweeneyRedHat pushed a commit to TomSweeneyRedHat/image that referenced this issue Jun 13, 2024
TomSweeneyRedHat pushed a commit to TomSweeneyRedHat/image that referenced this issue Jun 13, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
Signed-off-by: tomsweeneyredhat <[email protected]>
@Romain-Geissler-1A
Copy link

Romain-Geissler-1A commented Jun 14, 2024

@TomSweeneyRedHat I unfortunately hit this issue as well.

In term of releasing, I see that you are about to cut some releases of containers/image, does it mean there will be a point release 1.15.X of skopeo with a vendored version of containers/image ? If not, would you accept some patch backport sent directly into the fedora package to fix at least this issue for fedora users using Artifactory ?

@mtrmac
Copy link
Contributor

mtrmac commented Jun 17, 2024

@Romain-Geissler-1A I think we should make a new Skopeo upstream version (after #2451 merges here).

@Romain-Geissler-1A
Copy link

Romain-Geissler-1A commented Jun 18, 2024

Thanks for the update.

FYI, since on our side we are also paying customers on JFrog side, I have raised a ticket there and they just replied me this:

Upon reviewing this issue, we found it to be a previously reported problem. A Jira ticket with the internal ID [RTDEV-43592] has already been raised. This ticket describes the issue: “Docker tags are displaying SHA256 for multi-architecture images when we list the tags,” and it has been marked for our product team's review. Please note that [RTDEV-43592] is an internal Jira ticket, so you might not be able to access it

On our side, we are as blind as you on the status of this internal Jfrog ticket, so the only thing I can say is that Jfrog acknowledges they don't fully follow the OCI registry spec on this specific point and for now there exist no fixed Artifatory release.

@SSW-SCIENTIFIC
Copy link
Author

SSW-SCIENTIFIC commented Jun 20, 2024

Sorry for late response.
I have received response from JFrog support, they said that Docker buildx tool pushes tags in a format of sha256:*** for multi-arch images, so not only JFrog Artifactory but also DockerHub store tags with format sha256:***.
By contrast to JFrog Artifactory, DockerHub does not returns tags with that format on TagList API call.

(I feel that they will not fix this behavior even if this is not compliant with neither OCI nor Docker specifications.)

@tomarie
Copy link

tomarie commented Jun 26, 2024

Hi @SSW-SCIENTIFIC & @marcaurele,

I'm Tom, the Product Manager leading Docker & OCI package integrations at @jfrog Artifactory. Thank you for bringing this important issue to our attention and I apologize for not responding sooner.

Firstly, I would like to assure you that we are actively addressing this issue as we speak and we will be ready shortly with a patch that aligns our /tags/list API response with Docker & OCI specifications by omitting non-readable tags from the response.

I’d like to take this opportunity to share two points that are very important to us at @jfrog which are the amazing use patterns we see our community and customers are doing with technologies like OCI and secondly the fact that specifications and community usages are evolving.
When we originally designed our /tags/list API we came across issues where our customers were looking for ways to see *All tags in a repository.
This made sense to us at the time since we believe we should provide trust & transparency always. We also witnessed changes like the one made to buildx a while back where multi-arch images stopped being tagged as Arch/OS and shifted to Digests, making them generic for future OCI use cases which pointed us a little further in the direction of responding with all the content.

The latest change in the containers project reflects OCI's evolution by now enforcing a rule that tags cannot include certain characters (colon specifically). Since Artifactory does not intervene with the Clients tagging process the existence of these characters was not enforced previously and should be looked into by our friends in the client tool communities.
(Please note that it is highly probable that other tools out there still tag images in a manner that now violates this validation).

At the time we did our best to balance between the motivations of Specification and Registry alignment and maintaining trust and transparency and until this last change we had no issues.

With that being said, we truly understand these pains and we embrace change and want to continue to do our best to accommodate our communities & customer use cases and this is why we are of course making these changes.

Furthermore, we will be actively reaching out to our developer community to promote this validation issue on the client level in hopes to prevent invalid characters even reaching a registry.

Lastly, I would like to thank you all for your collaboration and positive discussion and we’re looking forward to collaborating again in the future

Best regards,
Tom

TomSweeneyRedHat pushed a commit to TomSweeneyRedHat/image that referenced this issue Jun 26, 2024
@mtrmac mtrmac mentioned this issue Jun 27, 2024
@mtrmac
Copy link
Contributor

mtrmac commented Jun 27, 2024

The latest change in the containers project reflects OCI's evolution by now enforcing a rule that tags cannot include certain characters (colon specifically). Since Artifactory does not intervene with the Clients tagging process the existence of these characters was not enforced previously and should be looked into by our friends in the client tool communities.
(Please note that it is highly probable that other tools out there still tag images in a manner that now violates this validation).

Thanks for the information. So there is a risk of the “list tags” endpoint returning values with other formats not matching the <reference> format of https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests ?

Right now the c/image code only specifically ignores values that match the digest format. Strings that match neither the tag nor the digest format would still cause a failure to parse the list output. (Such strings could never be referenced, for reading or writing, using the c/image code, either way — but their mere presence might prevent listing other tag values.)

At this point we have no records of such unusual tag values happening; but the validation is new.

TomSweeneyRedHat added a commit to TomSweeneyRedHat/common that referenced this issue Jun 28, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: tomsweeneyredhat <[email protected]>
TomSweeneyRedHat added a commit to TomSweeneyRedHat/common that referenced this issue Jun 28, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: tomsweeneyredhat <[email protected]>
TomSweeneyRedHat added a commit to TomSweeneyRedHat/common that referenced this issue Jun 28, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: tomsweeneyredhat <[email protected]>
TomSweeneyRedHat added a commit to TomSweeneyRedHat/skopeo that referenced this issue Jul 11, 2024
... in JFrog Artifactory may fail

Addresses: containers#2346

and needed if everupgrading from v1.14 in Fedora

Signed-off-by: tomsweeneyredhat <[email protected]>
TomSweeneyRedHat added a commit to TomSweeneyRedHat/skopeo that referenced this issue Jul 11, 2024
Addresses the problem first described in containers#2346
in the release-1.14 branch

Also addresses: https://issues.redhat.com/browse/RHEL-40801
https://issues.redhat.com/browse/RHEL-40805

Signed-off-by: tomsweeneyredhat <[email protected]>
@mtrmac
Copy link
Contributor

mtrmac commented Jul 11, 2024

A fix was now released in Skopeo 1.15.2, I apologize for the time necessary to run that process.

@mtrmac mtrmac closed this as completed Jul 11, 2024
TomSweeneyRedHat added a commit to TomSweeneyRedHat/buildah that referenced this issue Jul 16, 2024
TomSweeneyRedHat added a commit to TomSweeneyRedHat/buildah that referenced this issue Jul 16, 2024
Addresses the problem first described in containers/skopeo#2346

Signed-off-by: tomsweeneyredhat <[email protected]>
TomSweeneyRedHat added a commit to TomSweeneyRedHat/buildah that referenced this issue Jul 17, 2024
Addresses the problem first described in containers/skopeo#2346

Signed-off-by: tomsweeneyredhat <[email protected]>
TomSweeneyRedHat added a commit to TomSweeneyRedHat/podman that referenced this issue Jul 17, 2024
TomSweeneyRedHat added a commit to TomSweeneyRedHat/buildah that referenced this issue Jul 17, 2024
mtrmac added a commit to mtrmac/image that referenced this issue Aug 30, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
Signed-off-by: tomsweeneyredhat <[email protected]>
mtrmac added a commit to mtrmac/image that referenced this issue Aug 30, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
Signed-off-by: tomsweeneyredhat <[email protected]>
mtrmac added a commit to mtrmac/image that referenced this issue Aug 30, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
Signed-off-by: tomsweeneyredhat <[email protected]>
mtrmac added a commit to mtrmac/image that referenced this issue Sep 2, 2024
Per containers/skopeo#2346, that happens
in the wild.

Signed-off-by: Miloslav Trmač <[email protected]>
Signed-off-by: tomsweeneyredhat <[email protected]>
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
jira kind/feature A request for, or a PR adding, new functionality locked - please file new issue/PR
Projects
None yet
Development

No branches or pull requests

6 participants