harbor: "failed to fetch artifacts: unexpected end of JSON input" JFrog Artifactory replication

I have setup an endpoint that connects successfully:

image

And I created a replication rule, that appears correct (I want to pull all images in):

image

However, when triggering, the replication rule it fails with:

the execution X failed: failed to fetch artifacts: unexpected end of JSON input

image

If I look at the core logs I see:

2020-07-08T21:20:46Z [ERROR] [/replication/operation/controller.go:108]: the execution X failed: failed to fetch artifacts: unexpected end of JSON input

The fact that it fails SO FAST without logs, it makes me think that the execution fails before even starting.

I dug into the controller code and nothing jumped out, I also looked at the Jfrog adapter and saw nothing to work with.

I validated that the main API does respond correctly (ex: https://artifactory.example.com/artifactory/api/repositories?type=local&packageType=docker).

It seems tentatively related to @renjithkm86’s issue https://github.com/goharbor/harbor/issues/12363

Artifactory Version: 6.15.1 Harbor Version: v2.0.1 Kubernetes Version: 1.17.5

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (11 by maintainers)

Most upvoted comments

@chlins chiming in for @jimangel

We were able to test syncing a single image like your post demonstrated and it did in fact work – thanks for that.

Example working replication rule: Capture

The issue is that ‘docker-anonymous’ is an entire repo within our Artif instance that contains multiple images: artif

If I try to create a replication rule that looks for everything underneath that repo: Capture2

It then fails with the ‘unexpected end of JSON’ error message.

Like @bitsf commented above, I believe it’s just that every registry V2 api call that is made for pull replication needs to be updated to use the artif specific pathing. In this specific case, it would need to grab the name of the repository from this replication rule setting (‘docker-anonymous’) and add it to the artif V2 call: http://artifactory.example:8081/artifactory/api/docker-anonymous/v2/_catalog, for example.

By the way,my jfrog artifactory deployed by a very simple way: ‘docker run -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-pro:6.19.1’

i get the same error when I try to pull from artifactory too. We have ours behind traefik.