Skip to content

pull through cache (proxy): docker pull error "unexpected EOF" due to common blob expiration #2367

Description

@russellcardullo

This happens consistently when trying to pull an image that shares a layer with another image that has been expired. Because the TTL is 7 days we have images which we are unable to pull for multiple days until that image hits the TTL.

Steps to reproduce:

  1. Patch the latest version of distribution to set the expiry to something small (10 minutes). This is to make the problem reproducible quickly

At https://github.com/docker/distribution/blob/06fa77aa11a3913096efcb9b5bd25db8ef55a939/registry/proxy/proxymanifeststore.go#L15
Change to: const repositoryTTL = time.Duration(10 * time.Minute)

  1. Build and run distribution configured as proxy to registry-1.docker.io
docker build -t registry .
docker run -d -p5000:5000 \
  -e REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io \
  -e REGISTRY_STORAGE_CACHE_BLOBDESCRIPTOR=inmemory \
  --name registry registry
  1. Pull the library/python image from the local registry proxy
docker rmi localhost:5000/library/python
docker pull localhost:5000/library/python
  1. Wait a few minutes and pull the library/node image
docker rmi localhost:5000/library/python
docker rmi localhost:5000/library/node
docker pull localhost:5000/library/node
  1. After waiting 10 minutes from step 3 you should see a message in registry logs about deleting blobs:
time="2017-08-15T17:25:21.516625079Z" level=debug msg="filesystem.Stat("/docker/registry/v2/blobs/sha256/81/81a1ab6955f8a17045fb4c2866b21c91445837507e86d489b03744557e6ed209/data")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=32.961µ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).Stat" trace.id=c635fc90-4397-4fa3-b10c-f32ed9578170 trace.line=138 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:21.516820044Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_manifests/revisions/sha256/81a1ab6955f8a17045fb4c2866b21c91445837507e86d489b03744557e6ed209/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=107.87µ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).Delete" trace.id=0ff8eb93-21c9-4200-822d-01cd733c4d91 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:21.516941798Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/81a1ab6955f8a17045fb4c2866b21c91445837507e86d489b03744557e6ed209/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=54.834µ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).Delete" trace.id=e8c98a94-f16e-435e-b1ff-05a6db79329c trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:22.411773597Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/968120d8cbe8c99ab47504ffeb49e16ce3b773d14ba4eb78c7a5eca6ad34e00c/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=167.598µ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).Delete" trace.id=ef753f71-1268-4194-9dd4-44a5d1c52e8b trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:22.411921019Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/96/968120d8cbe8c99ab47504ffeb49e16ce3b773d14ba4eb78c7a5eca6ad34e00c" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:22.412218761Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/96/968120d8cbe8c99ab47504ffeb49e16ce3b773d14ba4eb78c7a5eca6ad34e00c")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=246.403µ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).Delete" trace.id=1c013292-4444-4b5c-b308-23ca41022912 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:22.564524978Z" level=debug msg="filesystem.PutContent("/scheduler-state.json")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=30.512342ms 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).PutContent" trace.id=37717880-31f6-434b-b53b-8d995df33d65 trace.line=96 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:22.870933249Z" level=debug msg="filesystem.Stat("/")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=46.644µ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).Stat" trace.id=64602e0e-95de-411c-8874-7149fcc69d3b trace.line=138 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:25.771801383Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/2b032b8bbe8bc215ad3337035d0183fc353841ec6478d1c481e6e13628ad9e00/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=167.598µ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).Delete" trace.id=e372ab76-7ee4-4f64-a39a-d32d69cc3ec1 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:25.771924435Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/2b/2b032b8bbe8bc215ad3337035d0183fc353841ec6478d1c481e6e13628ad9e00" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:25.779106183Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/2b/2b032b8bbe8bc215ad3337035d0183fc353841ec6478d1c481e6e13628ad9e00")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=7.123118ms 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).Delete" trace.id=ec999c6f-bf75-4eae-87e8-2502741a661f trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:27.561749439Z" level=debug msg="filesystem.PutContent("/scheduler-state.json")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=27.048315ms 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).PutContent" trace.id=3419b00d-1ea6-42e2-8f4f-6dadca82d361 trace.line=96 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:32.872650715Z" level=debug msg="filesystem.Stat("/")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=52.137µ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).Stat" trace.id=0b9a662b-29f2-4b19-bc23-ae0c13957819 trace.line=138 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:33.955121366Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/032924b710ba95b71e9a2d971e705bab895ddf7a219994c2cf8761f6959e62ed/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=177.186µ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).Delete" trace.id=310fddc4-a281-4e1b-8386-4512515c1786 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:33.955241721Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/03/032924b710ba95b71e9a2d971e705bab895ddf7a219994c2cf8761f6959e62ed" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:33.956808833Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/03/032924b710ba95b71e9a2d971e705bab895ddf7a219994c2cf8761f6959e62ed")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=1.512178ms 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).Delete" trace.id=b6b3f5c5-ab15-4b2f-ab65-7e0310b58ea3 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:34.708783931Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/a9a5b35f6ead105e66a9af969454ac09b5772eeb0c6281972c48d2ce882e8eba/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=156.311µ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).Delete" trace.id=bc8112d8-f7cc-4ae8-b20b-8ddd0b191504 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:34.708953327Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/a9/a9a5b35f6ead105e66a9af969454ac09b5772eeb0c6281972c48d2ce882e8eba" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:34.723095091Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/a9/a9a5b35f6ead105e66a9af969454ac09b5772eeb0c6281972c48d2ce882e8eba")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=14.092723ms 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).Delete" trace.id=1351974e-bb2b-459a-a5c6-112ef82d163d trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:37.126646541Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/450f5ea3e7eafb6df380c997fa891c13693af5ef46eb7a8ac6c54b58d00fecbb/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=166.699µ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).Delete" trace.id=f878de6c-a418-4c27-aa03-13e137fe9d53 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:37.12677958Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/45/450f5ea3e7eafb6df380c997fa891c13693af5ef46eb7a8ac6c54b58d00fecbb" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:37.127005209Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/45/450f5ea3e7eafb6df380c997fa891c13693af5ef46eb7a8ac6c54b58d00fecbb")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=172.193µ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).Delete" trace.id=e4e7a4ac-2356-4a5c-a4ed-d1e0682175d5 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:37.565964096Z" level=debug msg="filesystem.PutContent("/scheduler-state.json")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=30.373808ms 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).PutContent" trace.id=95f3b9b9-0b4a-4fac-8aba-07092f4d68e9 trace.line=96 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:38.457333866Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/b1dca9769b8b2f680ff0ed0de230c1d8984715ea8608e8a7df08b44a982f1fb3/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=161.006µ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).Delete" trace.id=06ada939-1974-4378-8b58-24afcbb8424e trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:38.45747999Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/b1/b1dca9769b8b2f680ff0ed0de230c1d8984715ea8608e8a7df08b44a982f1fb3" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:38.458513945Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/b1/b1dca9769b8b2f680ff0ed0de230c1d8984715ea8608e8a7df08b44a982f1fb3")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=973.127µ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).Delete" trace.id=25f52868-4bd1-49f1-a9cd-453c12d29162 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:39.423246535Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/0d7cffe4bfd71fa93d626a4a0761dc02083eda97bfc757feafdc168a9b24fbda/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=162.504µ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).Delete" trace.id=2567d11e-85a8-467d-9521-edc039c08729 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:39.423393558Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/0d/0d7cffe4bfd71fa93d626a4a0761dc02083eda97bfc757feafdc168a9b24fbda" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:39.430487012Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/0d/0d7cffe4bfd71fa93d626a4a0761dc02083eda97bfc757feafdc168a9b24fbda")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=7.03922ms 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).Delete" trace.id=901fd0c0-2812-4164-8d08-50006117bfcd trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:39.604583279Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/ad74af05f5a24bcf9459ae1cf7718628c2aeb6b587eb51b6eeaf639aca3e566f/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=159.508µ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).Delete" trace.id=fedb294a-0a8b-426f-8569-15704de2eae6 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:39.604724709Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/ad/ad74af05f5a24bcf9459ae1cf7718628c2aeb6b587eb51b6eeaf639aca3e566f" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:39.620825712Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/ad/ad74af05f5a24bcf9459ae1cf7718628c2aeb6b587eb51b6eeaf639aca3e566f")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=16.030289ms 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).Delete" trace.id=973070df-b3b6-44c4-8bbb-b41a73c29417 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:42.561907601Z" level=debug msg="filesystem.PutContent("/scheduler-state.json")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=27.883109ms 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).PutContent" trace.id=7570e3b4-5552-4673-a9a3-a4b9064b2e95 trace.line=96 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:42.871661741Z" level=debug msg="filesystem.Stat("/")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=55.633µ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).Stat" trace.id=513ab546-9e48-4ec8-a111-b154db454013 trace.line=138 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:44.872937411Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e/link")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=163.802µ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).Delete" trace.id=6b8af6d0-ba88-4fb8-a41d-6c758d3df506 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:44.873077842Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/32/3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m 
time="2017-08-15T17:25:44.907699933Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/32/3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e")" environment=development go.version=go1.8.3 instance.id=cb5c9bf9-bc57-422c-9da2-51eefab7bfc6 service=registry trace.duration=34.561764ms 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).Delete" trace.id=75af8054-f141-4211-9fa8-8182d8fd3a08 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m 
  1. Try to pull library/node again and see an error
docker rmi localhost:5000/library/python
docker rmi localhost:5000/library/node
docker pull localhost:5000/library/node # <--- this causes an error

Using default tag: latest
latest: Pulling from library/node
ad74af05f5a2: Retrying in 1 second
2b032b8bbe8b: Retrying in 1 second
a9a5b35f6ead: Downloading [==================================================>]  43.23MB/43.23MB
3245b5a1c52c: Waiting
afa075743392: Waiting
9fb9f21641cd: Waiting
2e38fbae54d2: Waiting
64e77472dc48: Waiting
unexpected EOF

Logs from registry on failed pull:
distribution-logs-EOF-pull.txt

Repeatedly trying docker pull localhost:5000/library/node fails until 10 minutes after the first pull at which point it succeeds.

If you hit the API directly for one of the blobs that is stuck retrying you get back a 200 OK but with an empty body:

$ curl -svO localhost:5000/v2/library/node/blobs/sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5000 (#0)
> GET /v2/library/node/blobs/sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e HTTP/1.1
> Host: localhost:5000
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Cache-Control: max-age=31536000
< Content-Length: 131858814
< Content-Type: application/octet-stream
< Docker-Content-Digest: sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e
< Docker-Distribution-Api-Version: registry/2.0
< Etag: "sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e"
< X-Content-Type-Options: nosniff
< Date: Tue, 15 Aug 2017 17:49:08 GMT
<
{ [0 bytes data]
* transfer closed with 131858814 bytes remaining to read
* Closing connection 0

Docker version/info

$ docker version
Client:
 Version:      17.06.0-ce
 API version:  1.30
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:31:53 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.06.0-ce
 API version:  1.30 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   02c1d87
 Built:        Fri Jun 23 21:51:55 2017
 OS/Arch:      linux/amd64
 Experimental: true


$ docker info
Containers: 4
 Running: 1
 Paused: 0
 Stopped: 3
Images: 55
Server Version: 17.06.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfb82a876ecc11b5ca0977d1733adbe58599088a
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.36-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.855GiB
Name: moby
ID: NWWG:VGBP:CL62:HAK7:WMUH:AVT2:7AN2:4DCR:DDT5:ST3A:HDSW:VNZI
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 30
 Goroutines: 41
 System Time: 2017-08-15T17:08:28.029292033Z
 EventsListeners: 1
No Proxy: *.local, 169.254/16
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Activity

  1. russellcardullo commented on Aug 15, 2017

    @russellcardullo
    Author

    Logs from when I did the curl that returned an empty body. Followed same steps as above and waited for the blob delete first before curling to reproduce the issue:

    time="2017-08-15T17:48:57.47164281Z" level=debug msg="filesystem.Delete("/docker/registry/v2/repositories/library/python/_layers/sha256/3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e/link")" environment=development go.version=go1.8.3 instance.id=5e2554a1-7f24-4ce4-86a5-ec89a6db4516 service=registry trace.duration=171.594µs trace.file="/go/src/g
    ithub.com/docker/distribution/registry/storage/driver/base/base.go" trace.func="github.com/docker/distribution/registry/storage/driver/base.(*Base).Delete" trace.id=82123249-5f31-4e63-bd29-b5d044ab311f trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m
    time="2017-08-15T17:48:57.471795426Z" level=info msg="Deleting blob: /docker/registry/v2/blobs/sha256/32/3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" environment=development go.version=go1.8.3 instance.id=5e2554a1-7f24-4ce4-86a5-ec89a6db4516 service=registry version=v2.6.0-rc.1-213-g06fa77aa.m
    time="2017-08-15T17:48:57.501263925Z" level=debug msg="filesystem.Delete("/docker/registry/v2/blobs/sha256/32/3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e")" environment=development go.version=go1.8.3 instance.id=5e2554a1-7f24-4ce4-86a5-ec89a6db4516 service=registry trace.duration=29.339554ms 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).Delete" trace.id=111cbd57-bf6a-49d8-a7b2-39014bd47d83 trace.line=178 version=v2.6.0-rc.1-213-g06fa77aa.m
    time="2017-08-15T17:49:08.086811253Z" level=debug msg="authorizing request" go.version=go1.8.3 http.request.host="localhost:5000" http.request.id=63c9269e-0405-42fb-850b-8d720b2a3b34 http.request.method=GET http.request.remoteaddr="172.17.0.1:56752" http.request.uri="/v2/library/node/blobs/sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e"
    http.request.useragent="curl/7.54.0" vars.digest="sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" vars.name="library/node"
    time="2017-08-15T17:49:08.087504918Z" level=debug msg=GetBlob go.version=go1.8.3 http.request.host="localhost:5000" http.request.id=63c9269e-0405-42fb-850b-8d720b2a3b34 http.request.method=GET http.request.remoteaddr="172.17.0.1:56752" http.request.uri="/v2/library/node/blobs/sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" http.request.u
    seragent="curl/7.54.0" vars.digest="sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" vars.name="library/node"
    time="2017-08-15T17:49:08.087617182Z" level=debug msg="filesystem.URLFor("/docker/registry/v2/blobs/sha256/32/3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e/data")" go.version=go1.8.3 http.request.host="localhost:5000" http.request.id=63c9269e-0405-42fb-850b-8d720b2a3b34 http.request.method=GET http.request.remoteaddr="172.17.0.1:56752" http.re
    quest.uri="/v2/library/node/blobs/sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" http.request.useragent="curl/7.54.0" trace.duration=19.776µ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=69b858a4-4
    f79-41b1-9bc5-d5beea2bd77c trace.line=190 vars.digest="sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" vars.name="library/node"
    time="2017-08-15T17:49:08.087717561Z" level=debug msg="filesystem.Reader("/docker/registry/v2/blobs/sha256/32/3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e/data", 0)" go.version=go1.8.3 http.request.host="localhost:5000" http.request.id=63c9269e-0405-42fb-850b-8d720b2a3b34 http.request.method=GET http.request.remoteaddr="172.17.0.1:56752" http
    .request.uri="/v2/library/node/blobs/sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" http.request.useragent="curl/7.54.0" trace.duration=36.156µ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).Reader" trace.id=83bdf71
    5-df65-43a2-9e5f-9b943075e6b2 trace.line=108 vars.digest="sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" vars.name="library/node"
    time="2017-08-15T17:49:08.087854896Z" level=info msg="response completed" go.version=go1.8.3 http.request.host="localhost:5000" http.request.id=63c9269e-0405-42fb-850b-8d720b2a3b34 http.request.method=GET http.request.remoteaddr="172.17.0.1:56752" http.request.uri="/v2/library/node/blobs/sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e" ht
    tp.request.useragent="curl/7.54.0" http.response.contenttype="application/octet-stream" http.response.duration=2.134429ms http.response.status=200 http.response.written=0
    172.17.0.1 - - [15/Aug/2017:17:49:08 +0000] "GET /v2/library/node/blobs/sha256:3245b5a1c52cbf0ae23d948fb94ef7b321e3dc54e13c3f6cf79951ed8237f03e HTTP/1.1" 200 0 "" "curl/7.54.0"
    
  2. russellcardullo commented on Aug 15, 2017

    @russellcardullo
    Author

    Reproduced again to capture pprof output for goroutines. Attached logs and pprof capture taken immediately after the curl returned an empty body.

    distribution_logs.with_pprof.txt
    pprof_goroutines.txt

  3. abaumann commented on Jan 8, 2018

    @abaumann

    We seem to be hitting this same EOF error after 7 days using the Google Pipelines API - any updates on this issue or ways around it? They recently added caching to GCR for images rather than always pulling from the original registry and this behavior is new

  4. jsravn commented on Apr 11, 2018

    @jsravn

    The workaround is to restart and delete the cache before the 7 day ttl. We run it in k8s w/ emptyDir, so can just delete the pod. It's not ideal though as we lose the entire cache weekly.

  5. Fundebug commented on May 2, 2018

    @Fundebug

    I solve the problem by just rebuild the image and push it to the registry.

  6. antoniou commented on May 14, 2018

    @antoniou

    We also had to work around it by restarting our Docker Registry systemd unit before the cache expires:

    RuntimeMaxSec=604740
    

    https://www.freedesktop.org/software/systemd/man/systemd.service.html#RuntimeMaxSec=

  7. docwhat commented on Sep 25, 2018

    @docwhat

    Is there anything I can do to get this fixed sooner rather than later?

    This is really annoying and hard to track down.

    I've been searching for months, off and on.

  8. manishtomar commented on Sep 26, 2018

    @manishtomar
    Contributor

    @docwhat Until the bug is fixed your best option is to clean the cache before the expiry time.

  9. xulz commented on Dec 20, 2018

    @xulz

    any plan or status update on the issue fixing?
    The issue has been raised 16 month...

  10. warmchang commented on Jan 8, 2019

    @warmchang

    Any plan to fix this issue? Thanks.

  11. manishtomar commented on Jan 8, 2019

    @manishtomar
    Contributor

    There are no plans on getting this fixed anytime soon. It will be great if someone can root cause this and provide a patch.

  12. andyzhangx commented on Jan 9, 2019

    @andyzhangx
    Contributor

    OMG, I hit this issue every few weeks, any expert could fix this issue? Is there better any workaround except "restart"? This severe issue makes the proxy very unstable

  13. andyzhangx commented on Jan 9, 2019

    @andyzhangx
    Contributor

    is it possible to configure the TTL time 7 days? I could accept restart registry proxy every 3 months ..

  14. andyzhangx commented on Jan 9, 2019

    @andyzhangx
    Contributor

    what drawback if I set repositoryTTL value to one year or more long time ? Only occupies the disk space? My disk has 1TB, it could host huge amount of repos.
    https://github.com/docker/distribution/blob/06fa77aa11a3913096efcb9b5bd25db8ef55a939/registry/proxy/proxymanifeststore.go#L15

  15. manishtomar commented on Jan 9, 2019

    @manishtomar
    Contributor

    @andyxning That is totally acceptable. It will be nice if there can be a PR to make this configurable so that its easy for others have this workaround.

  16. 37 remaining items

  17. vglaiju commented on Jun 20, 2024

    @vglaiju

    @andyxning Schema1 is disabled by default in Registry 2.7. You will need to enable it in config file:

    compatibility:
      schema1:
        enabled: true

    @manishtomar Thank you for suggesting this, i m facing this during image push.
    Please suggest, Is this compatibility to be enabled in the deployment yaml of registry?

  18. milosgajdos commented on Jun 20, 2024

    @milosgajdos
    Member

    Schema1 will be deprecated in v3 release and v2 release is essentially in maintenance mode. If I were you I'd strongly advise you to rebuild your v1 images into v2.

  19. jakob-tsd commented on Aug 19, 2025

    @jakob-tsd

    For posterity and other people hitting this on podman, this is how the bug looks like through podman:

    $ podman pull docker.io/pipelinecomponents/yamllint:0.31.1
    Trying to pull docker.io/pipelinecomponents/yamllint:0.31.1...
    Getting image source signatures
    Copying blob 60d2faee92e7 done
    Copying blob 9fe2741cae98 done
    Copying blob c3cdf40b8bda done
    Copying blob 747139edbf51 [--------------------------------------] 0.0b / 768.0b
    Copying blob 91515a6c4420 done
    Copying blob 4abcf2066143 done
    Copying blob b62713ed4827 done
    Copying blob 3a6cecfe7003 done
      unexpected EOF
    Error: Error writing blob: error setting up to decompress blob: error happened during read: unexpected EOF
    

    And if you use the Debian package, you can disable the blobdescriptor cache through /etc/docker/registry/config.yml.

    I changed the relevant line to

        blobdescriptor: DISABLED-BECAUSE-BROKEN-ISSUE-2367
    

    but of course blah (or even empty) works just as well.

  20. ondrejkopka commented on Nov 25, 2025

    @ondrejkopka

    hi, is possible to fix this please? i use latest version and i face EOF issue every day (just changed blobdescriptor so i'll see if that helps)

  21. lesliexlxiao commented on Dec 12, 2025

    @lesliexlxiao

    Is it true that the latest official code still has the following issues?

    T0: Blob exists normally

    • Redis LinkSet: ✓
    • Redis BlobHash: ✓
    • Redis RepoHash: ✓
    • File: ✓

    T1: TTL expires, expiration callback triggers

    • Scheduler acquires lock: ttles.Lock()

    T2: Execute blobs.Delete()

    • Clear() only deletes BlobHash
    • ❌ LinkSet still exists!
    • ❌ RepoHash still exists!

    T3: Client request arrives

    • Stat() checks:
      • SISMEMBER repository::nginx::blobs → ✓ exists (LinkSet not deleted)
      • HMGET blobs::sha256:abc123 → ✗ does not exist (BlobHash already deleted)
    • Returns ErrBlobUnknown, triggers pull

    T4: Enter ServeBlob()

    • mu.Lock()
    • inflight[dgst] does not exist, add marker
    • mu.Unlock()
    • Start pulling...

    T5: Pull completes

    • Commit() writes file ✓
    • SetDescriptor() restores Redis ✓
    • scheduler.AddBlob() waits for scheduler lock...

    T6: Expiration callback continues execution

    • v.RemoveBlob() deletes file ✗
    • delete(entries, key)
    • ttles.Unlock()

    T7: AddBlob acquires lock, creates new entry2

    T8: 💥 Data inconsistency

    • Redis: ✓ exists
    • File: ✗ already deleted
  22. docwhat commented on Dec 16, 2025

    @docwhat

    🧠 🌩️ I'm just brainstorming since fixing this properly seems difficult.

    ⚠️ Warning: It's been a few years since I've read the code for distribution, so my information may be wrong.

    Could the server deal with the problem in a better way?

    As an example, when a layer is requested, maybe it could detect that the layer is missing and then it could return a 404. It's not perfect, but it shows what really happened.

    Ideally, it would then go and mark the image as broken or maybe just delete it. A little confusing since the user would be like "it was there a minute ago!".

    Unfortunately, if I remember correctly, finding the images that use that layer is not cheap so that's probably not acceptable.

    The client has that information, though. Is there a REST API call to "verify" that all the parts of an image exist? Maybe the client could call that when a layer is 404. Then the verify can mark the image as bad.

    I don't like that it depends on the client being a good team player, but what can you do.

    Hmmm. I suppose this also could be a DoS vector, depending on how expensive the verify function is (if it doesn't exist already).

    Maybe it could do quick checks before serving an image to ensure the layers are there and if not, return a error right away?

    Even if an image has a 100 layers, doing HEAD checks wouldn't take that long, would it? If we change the database schema, we could save when the last HEAD check was performed and what it returned.

    Most of the backends return size and a checksum. Those could be used to be doubly sure the layer in good shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority/P1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions