Docker Community Forums

Share and learn in the Docker community.

Empty "actor" field in Docker Registry notification message when image is pushed from Jib client

Using a webhook, our Docker Registry 2.7.1 is configured to send Portus 2.4.3 notifications when an image is pushed to the registry.

This is, for instance, the notification event received by Portus, when an image is pushed to the registry using the official Docker 19.03.4 Windows client. In this case, everything works as expected.

Handling 'push' event:
{
  "id": "e4f8ba20-c7e1-4916-919c-a90803854ccc",
  "timestamp": "2020-02-04T11:00:56.708989056Z",
  "action": "push",
  "target": {
    "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
    "size": 1785,
    "digest": "sha256:49433a8241d5e44ca711191b978055f1d2ab5ccc862acf7c4d8d73c274342e91",
    "length": 1785,
    "repository": "testjib/hello-world",
    "url": "https://registry/v2/testjib/hello-world/manifests/sha256:49433a8241d5e44ca711191b978055f1d2ab5ccc862acf7c4d8d73c274342e91",
    "tag": "latest"
  },
  "request": {
    "id": "b1579a99-7f2b-454a-aeb3-f1bf611b320f",
    "addr": "10.255.0.2",
    "host": "registry",
    "method": "PUT",
    "useragent": "docker/19.03.4 go/go1.12.10 git-commit/9013bf5 kernel/4.9.184-linuxkit os/linux arch/amd64 UpstreamClient(Docker-Client/19.03.4 \\(windows\\))"
  },
  "actor": {
    "name": "testjib"
  },
  "source": {
    "addr": "0564da668715:5000",
    "instanceID": "4396b935-e643-4384-8526-2e85839e5427"
  }
}

But when the image is pushed using the GoogleContainerTools Jib client, the notification message differs by an empty “actor” field :

{
  "id": "412c19bc-fe91-4e81-a735-b2ac76f97bf8",
  "timestamp": "2020-02-04T10:46:20.116168774Z",
  "action": "push",
  "target": {
    "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
    "size": 1403,
    "digest": "sha256:7d13e143448e78c7f81c75aeda012513b7f898bfb5f8cc2a6541a13c5d831a16",
    "length": 1403,
    "repository": "testjib/hello-world",
    "url": "https://registry/v2/testjib/hello-world/manifests/sha256:7d13e143448e78c7f81c75aeda012513b7f898bfb5f8cc2a6541a13c5d831a16",
    "tag": "latest"
  },
  "request": {
    "id": "aba2e75f-68fd-4f69-ba85-8a11cd10f828",
    "addr": "10.255.0.2",
    "host": "registry",
    "method": "PUT",
    "useragent": "jib 2.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)"
  },
  "actor": {
  },
  "source": {
    "addr": "0564da668715:5000",
    "instanceID": "4396b935-e643-4384-8526-2e85839e5427"
  }
}

This causes an error in Portus (Cannot find user) and was reported as Portus issue 2243.

For now, I cannot figure which of the three components (client/Registry/Portus) is faulty. Is the “actor” field allowed to be empty in a notification event ? Why is the “actor” field empty only when using the Jib client ?

The problem was also discussed in Jib issue 1997

Is the “actor” field allowed to be empty in a notification event ?

Answer is yes. For instance, when accessing a registry which requires no authentication

I have setup a simple Docker Registry 2.7.1 with “htpasswd” authentication that sends notification events to a simple listener that displays notifications. Using Jib or the Docker client, I never saw a notification event with an empty “actor” field.

Registry logs, Jib client, token authentication : auth.user.name is always empty

time="2020-02-07T17:00:05.062901932Z" level=debug msg="authorizing request" go.version=go1.11.2 http.request.host=registry.company.com http.request.id=1063c4d9-02c3-410f-93a2-17c8eb5cb4eb http.request.method=HEAD http.request.remoteaddr=10.255.0.2 http.request.uri="/v2/testjib/helloworld/blobs/sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" http.request.useragent="jib 2.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)" vars.digest="sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" vars.name="testjib/helloworld"
time="2020-02-07T17:00:05.063122819Z" level=info msg="authorized request" go.version=go1.11.2 http.request.host=registry.company.com http.request.id=1063c4d9-02c3-410f-93a2-17c8eb5cb4eb http.request.method=HEAD http.request.remoteaddr=10.255.0.2 http.request.uri="/v2/testjib/helloworld/blobs/sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" http.request.useragent="jib 2.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)" vars.digest="sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" vars.name="testjib/helloworld"
time="2020-02-07T17:00:05.063188578Z" level=debug msg=GetBlob auth.user.name= go.version=go1.11.2 http.request.host=registry.company.com http.request.id=1063c4d9-02c3-410f-93a2-17c8eb5cb4eb http.request.method=HEAD http.request.remoteaddr=10.255.0.2 http.request.uri="/v2/testjib/helloworld/blobs/sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" http.request.useragent="jib 2.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)" vars.digest="sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" vars.name="testjib/helloworld"
time="2020-02-07T17:00:05.063285983Z" level=debug msg="filesystem.URLFor("/docker/registry/v2/blobs/sha256/ee/ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32/data")" auth.user.name= go.version=go1.11.2 http.request.host=registry.company.com http.request.id=1063c4d9-02c3-410f-93a2-17c8eb5cb4eb http.request.method=HEAD http.request.remoteaddr=10.255.0.2 http.request.uri="/v2/testjib/helloworld/blobs/sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" http.request.useragent="jib 2.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)" trace.duration=15.89µs trace.file="/go/src/github.com/docker/distribution/registry/storage/driver/base/base.go" trace.func="github.com/docker/distribution/registry/storage/driver/base.(*Base).URLFor" trace.id=a8b07e13-3408-4291-a895-f173c5cf585e trace.line=217 vars.digest="sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" vars.name="testjib/helloworld"
time="2020-02-07T17:00:05.063413472Z" level=info msg="response completed" go.version=go1.11.2 http.request.host=registry.company.com http.request.id=1063c4d9-02c3-410f-93a2-17c8eb5cb4eb http.request.method=HEAD http.request.remoteaddr=10.255.0.2 http.request.uri="/v2/testjib/helloworld/blobs/sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32" http.request.useragent="jib 2.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)" http.response.contenttype="application/octet-stream" http.response.duration=1.209919ms http.response.status=200 http.response.written=0
10.0.14.4 - - [07/Feb/2020:17:00:05 +0000] "HEAD /v2/testjib/helloworld/blobs/sha256:ee8bfedf31b33f551c7a754b42fa239622bf58c3596e4de532f19bd898786d32 HTTP/1.1" 200 0 "" "jib 2.0.0 jib-maven-plugin Google-HTTP-Java-Client/1.34.0 (gzip)"