mayflower/docker-ls

docker-rm results in "The operation is unsupported" error

glinders opened this issue · 5 comments

If I use docker-rm to delete a tag, I get:

$ docker-rm --registry http://docker.au.ivc test-image/sha256:09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e
ERROR: invalid API response status 405

The private Docker registry responds with:

registry_1 | time="2016-03-15T02:40:12Z" level=error msg="response completed with error" err.code=unsupported err.message="The operation is unsupported." go.version=go1.5.3 http.request.host=docker.au.ivc http.request.id=c10f5fa1-5858-4824-ba4f-99cbd66c08e0 http.request.method=DELETE http.request.remoteaddr=192.168.12.171 http.request.uri="/v2/test-image/sha256/manifests/09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e" http.request.useragent="Go-http-client/1.1" http.response.contenttype="application/json; charset=utf-8" http.response.duration=2.512954ms http.response.status=405 http.response.written=78 instance.id=0b1cd77a-b90f-457e-808d-c5db2c49fb03 vars.name="test-image/sha256" vars.reference=09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e version=v2.3.1 
registry_1 | 172.17.0.4 - - [15/Mar/2016:02:40:12 +0000] "DELETE /v2/test-image/sha256/manifests/09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e HTTP/1.0" 405 78 "" "Go-http-client/1.1"
nginx_1    | 192.168.12.171 - - [15/Mar/2016:02:40:12 +0000] "DELETE /v2/test-image/sha256/manifests/09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e HTTP/1.1" 405 78 "-" "Go-http-client/1.1" "-"

The registry consists off:

data/docker/registry/v2/repositories/test-image
data/docker/registry/v2/repositories/test-image/_layers
data/docker/registry/v2/repositories/test-image/_layers/sha256
data/docker/registry/v2/repositories/test-image/_layers/sha256/a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
data/docker/registry/v2/repositories/test-image/_layers/sha256/a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4/link
data/docker/registry/v2/repositories/test-image/_layers/sha256/5a132a7e7af11f304041e93efb9cb2a0a7839bccaec5a03cfbdc9a3f5d0eb481
data/docker/registry/v2/repositories/test-image/_layers/sha256/5a132a7e7af11f304041e93efb9cb2a0a7839bccaec5a03cfbdc9a3f5d0eb481/link
data/docker/registry/v2/repositories/test-image/_layers/sha256/fd2731e4c50ce221d785d4ce26a8430bca9a95bfe4162fafc997a1cc65682cce
data/docker/registry/v2/repositories/test-image/_layers/sha256/fd2731e4c50ce221d785d4ce26a8430bca9a95bfe4162fafc997a1cc65682cce/link
data/docker/registry/v2/repositories/test-image/_layers/sha256/1dce7048719ecd644166c00185a7b0fe19bdf5a4b6367d88a56a266943fe3fae
data/docker/registry/v2/repositories/test-image/_layers/sha256/1dce7048719ecd644166c00185a7b0fe19bdf5a4b6367d88a56a266943fe3fae/link
data/docker/registry/v2/repositories/test-image/_layers/sha256/946af08b283ebe2bc30755934b6b2acee29c211eb1ee32e3500fe1ef6dc08090
data/docker/registry/v2/repositories/test-image/_layers/sha256/946af08b283ebe2bc30755934b6b2acee29c211eb1ee32e3500fe1ef6dc08090/link
data/docker/registry/v2/repositories/test-image/_layers/sha256/28a2f68d1120598986362662445c47dce7ec13c2662479e7aab9f0ecad4a7416
data/docker/registry/v2/repositories/test-image/_layers/sha256/28a2f68d1120598986362662445c47dce7ec13c2662479e7aab9f0ecad4a7416/link
data/docker/registry/v2/repositories/test-image/_uploads
data/docker/registry/v2/repositories/test-image/_manifests
data/docker/registry/v2/repositories/test-image/_manifests/revisions
data/docker/registry/v2/repositories/test-image/_manifests/revisions/sha256
data/docker/registry/v2/repositories/test-image/_manifests/revisions/sha256/09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e
data/docker/registry/v2/repositories/test-image/_manifests/revisions/sha256/09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e/link
data/docker/registry/v2/repositories/test-image/_manifests/tags
data/docker/registry/v2/repositories/test-image/_manifests/tags/latest
data/docker/registry/v2/repositories/test-image/_manifests/tags/latest/index
data/docker/registry/v2/repositories/test-image/_manifests/tags/latest/index/sha256
data/docker/registry/v2/repositories/test-image/_manifests/tags/latest/index/sha256/09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e
data/docker/registry/v2/repositories/test-image/_manifests/tags/latest/index/sha256/09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e/link
data/docker/registry/v2/repositories/test-image/_manifests/tags/latest/current
data/docker/registry/v2/repositories/test-image/_manifests/tags/latest/current/link

Am I using the incorrect digest or is there something wrong.

I used docker-rm from zipfile docker-ls-linux-amd64.zip (sha256:9e397140baf7d6aaac46af3141957e02b8c46854aa616f3ff1cc93190f912c9a)

Hi Geert!

Seems I introduced a typo in the README for extra security 😏 — the slash should be a colon:

docker-rm --registry http://docker.au.ivc test-image:sha256:09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e

The documentation is fixed now, sorry for the hassle. Can you confirm that this works for you?

Hi Christian,

Thank for that. Unfortunately, it didn't work. I still get the same response:

registry_1 | time="2016-03-15T18:08:34Z" level=error msg="response completed with error" err.code=unsupported err.message="The operation is unsupported." go.version=go1.5.3 http.request.host=docker.au.ivc http.request.id=82a68e95-8d63-4e29-b7b2-365bc8aac445 http.request.method=DELETE http.request.remoteaddr=192.168.12.171 http.request.uri="/v2/test-image/manifests/sha256:09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e" http.request.useragent="Go-http-client/1.1" http.response.contenttype="application/json; charset=utf-8" http.response.duration=2.260016ms http.response.status=405 http.response.written=78 instance.id=0b1cd77a-b90f-457e-808d-c5db2c49fb03 vars.name=test-image vars.reference="sha256:09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e" version=v2.3.1 
registry_1 | 172.17.0.4 - - [15/Mar/2016:18:08:34 +0000] "DELETE /v2/test-image/manifests/sha256:09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e HTTP/1.0" 405 78 "" "Go-http-client/1.1"
nginx_1    | 192.168.12.171 - - [15/Mar/2016:18:08:34 +0000] "DELETE /v2/test-image/manifests/sha256:09de1cdf2a26692e344cdf4a5265c11760689ec32176405e996d16a0089ff02e HTTP/1.1" 405 78 "-" "Go-http-client/1.1" "-"

I'm using Docker's own registry image. I've tried their version v2 and their latest, v2.3.1.

My YML file for docker-compose is:

registry:
  image: registry:2.3.1
  ports:
    - 127.0.0.1:5000:5000
  environment:
    REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
  volumes:
    - ./data:/data

Which registry version are you using? I know there is a lot of development going on on the registry and that some features are not implemented.

Hi Geert!

We are running v2.3.0 from the official image, but with a custom config — this may be the issue. According to the docs, deletes must be explicitly enabled (either in the YAML or by setting REGISTRY_STORAGE_DELETE_ENABLED=true). Looking at the default config, it seems that deletes are disabled by default in the official image.

Hi Christian,

Thanks for that. Now it works :-)

I've added the environment variable to my YML file:

registry:
  image: registry:2.3.1
  ports:
    - 127.0.0.1:5000:5000
  environment:
    REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
    REGISTRY_STORAGE_DELETE_ENABLED: true
  volumes:
    - ./data:/data

Maybe add that to your documentation (README.md).

Hi Geert!

Thanks for the info; I have linked this issue in the documentation.

Cheers
-Christian