SignatureDoesNotMatch on pulling
We started to get the following errors on pulling images from Docker Hub a few months ago, any ideas what could be the reason and/or how to handle it?
Docker pull error: error parsing HTTP 403 response body:
invalid character '<' looking for beginning of value: "
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
<AWSAccessKeyId>XXX</AWSAccessKeyId>
<StringToSign>GET\n\napplication/json; charset=utf-8\n1537541629\n/docker-images-prod/registry-v2/docker/registry/v2/blobs/sha256/f6/XXX/data</StringToSign>
<SignatureProvided>TlXV0PLDGhaMaIZO4rq/YB9v+rI=</SignatureProvided>
<StringToSignBytes>XXX</StringToSignBytes>
<RequestId>8164C2E132D4373E</RequestId><HostId>rtOV0KXItVcCii6pS2sRXwsSTlBwl4Sg7+ezmhcUCySV0BtjVTR9q7i1ikT821A0VG1S5wfcf4o=</HostId>
</Error>"
...
The errors happens randomly, retrying doesn't help and we haven't spot any regularities. The error possibly comes from AWS storage behind Docker Hub, but it's pretty hard to guess what exactly is wrong from the message. Docker 17.09.1-ce, but similar happens when using Registry HTTP API directly as well as latest docker-py.
@vshlapakov we're sorry that you're running into this issue. in order to help us investigate, do you mind helping us with a little more information?
- what are the exact steps taken to produce the issue
- request trace if possible
@vshlapakov would you have anymore info on this?
@jmwong thanks for such a quick response and sorry for delay. As I said the issue happens randomly with some client images, and for now there's no reliable way to reproduce it - that's why I spent a lot of time trying to resolve the issue by myself before writing here.
Current workflow is based on getting docker image layers manually via Registry HTTP API v2 one-by-one with fallback to docker-py and official docker binary, and when the mentioned error happens on pulling a specific image layer - simple retries & all other approachs fail with the same error on getting the same layer. And when I manually use a docker binary later with the same image - it works fine.
So I created the issue first of all to check if it's a known problem and ask for general cases when it could happen. But now after rewording the problem one more time I think that it could be related with the following things:
- when getting an image, first step is to get an auth token and its ttl by default is 60 secs, so if not refreshing it from time to time on getting a large image - it will expire and probably trigger the mentioned exception
- there's probably some caching on docker hub side, and if the exception is raised once, it will be re-raised each time there's a GET request for the same layer with similar parameters from same IP address. If this is true, it could explain why fallback methods based on docker-py & docker binary fail with the same error.
Could you please confirm or refute the thoughts? Are there any other suggestions to check? I'm almost sure in (1) but having doubts about (2). In the meantime I'll add token refreshing logic and validate the ideas on practice.
@vshlapakov When it happens next time could you try curl that layer using below script?
#!/bin/bash
# call it as <script> library/mysql blobs/sha256:2a72cbf407d67c7a7a76dd48e432091678e297140dce050ad5eccad918a9f8d6
repo=$1
url=$2
token=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:$repo:pull" | jq -r .token)
curl -v https://registry-1.docker.io/v2/$repo/$url -H "Authorization: Bearer $token" -L > /dev/null
And please provide the complete layer digest. If it is private image layer then first 10 chars should be sufficient.
@manishtomar Thanks, just caught it on the same host with curl after a few hours since the SignatureDoesNotMatch issue. Current problem layer digest is sha256:3ed1e0945d, I got HTTP 400 Bad request repeatedly while trying to get it, and everything worked fine with other layers. Could you take a look? If there're any private things, let's continue via email.
UPD right after I did docker pull with the image on my local machine, I was able to download the mentioned layer via curl without any problems :confused:
I got
HTTP 400 Bad requestrepeatedly while trying to get it
I would like to see the curl response with 400 bad request. I am interested in response headers. Can you run it again and paste the logs here?
@manishtomar sure, here it is:
< HTTP/1.1 400 Bad Request
< Date: Mon, 01 Oct 2018 17:00:23 GMT
< Content-Type: application/xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Set-Cookie: __cfduid=df43c25df34fc61b5ffdbedd6e7616d3c1538413222; expires=Tue, 01-Oct-19 17:00:22 GMT; path=/; domain=.production.cloudflare.docker.com; HttpOnly; Secure
< CF-Cache-Status: EXPIRED
< CF-RAY: 46307c31bff42378-FRA
< Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< Set-Cookie: __cfduid=df43c25df34fc61b5ffdbedd6e7616d3c1538413222; expires=Tue, 01-Oct-19 17:00:22 GMT; path=/; domain=.production.cloudflare.docker.com; HttpOnly
< Vary: Accept-Encoding
< x-amz-id-2: B+YSEvhSFQDzmwDx/BekMSaYZmqnsxvCSMWovaF3eo+aRhdF1/ts1By008OiQQklS6e045zU9tw= < x-amz-request-id: 92A28FD2ED69FCB5
* Server cloudflare is not blacklisted
< Server: cloudflare
<
{ [data not shown]
0 0 0 2578 0 0 2936 0 --:--:-- --:--:-- --:--:-- 2936
@vshlapakov Thanks for the info. This really helps. We are in touch with Cloudflare to debug this.
@vshlapakov When this occurs again especially with 403, could you rerun the script given above and send to full log to [email protected]? It will help us track down the bug. Thanks!
Sure, thanks, I will :+1:
@jmwong @manishtomar Any updates on the issue? I already sent 3 emails since our last discussion with all the details attached (request 00059604), no response so far :confused:
@vshlapakov it's been almost a year, but it may be of use to someone else.
I had the same issue just today (pic attached).

A simple sudo hwclock -s solved the problem for me.
@Gr3at Thanks for sharing! Do you use Docker for Mac? Asking as there's a known issue related with time drift, bit it shouldn't occur on Linux or Windows due to the native implementation of Docker.
@Gr3at Thanks for sharing! Do you use Docker for Mac? Asking as there's a known issue related with time drift, bit it shouldn't occur on Linux or Windows due to the native implementation of Docker.
Nope. I'm on Ubuntu 18.04 (LTS). It's the first time i got such an error.
Hi there! I just started experiencing this issue for the first time last Thursday or so. I have a about dozen public images with multiple versions each, and a different, seemingly random combination of them have this problem each day. The problem tends to go away within an hour.
I have some recorded output similar to what was requested by @manishtomar, with one of my public images. Would it be helpful for me to provide this?
I can also note that switching machines (and networks) doesn't seem to have any effect.
Thanks in advance!
@james-perretta Hmm. That shouldn't be required. I believe we've what we need from earlier investigations. I thought the bug went away but it is back. Will look at root causing it.
Unfortunately it looks like this problem is back again - one of our engineers got paged in the early hours of Friday morning last week due to this issue causing unavailable pods in a production cluster. Let us know if there's anything we can do to help debug CC @manishtomar
@awh Apologies I don't work with Docker anymore. Maybe @ddebroy can help.
Facing the same issue below is the error, can someone help me resolve this.
df20fa9351a1: Pulling fs layer error pulling image configuration: error parsing HTTP 403 response body: invalid character '<' looking for beginning of value: "\n
" SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method. AKIAJK7VVPUPZVKSUSIQ GET\n\napplication/json\n1602069549\n/docker-images-prod/registry-v2/docker/registry/v2/blobs/sha256/13/1340b898aad2d587523c1b382a668c99c077cf301b07b7bf0d434f0c62067fbf/data IKXi3uSA//6NGd5UhXd/vqJwk28= 47 45 54 0a 0a 61 70 70 6c 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e 0a 31 36 30 32 30 36 39 35 34 39 0a 2f 64 6f 63 6b 65 72 2d 69 6d 61 67 65 73 2d 70 72 6f 64 2f 72 65 67 69 73 74 72 79 2d 76 32 2f 64 6f 63 6b 65 72 2f 72 65 67 69 73 74 72 79 2f 76 32 2f 62 6c 6f 62 73 2f 73 68 61 32 35 36 2f 31 33 2f 31 33 34 30 62 38 39 38 61 61 64 32 64 35 38 37 35 32 33 63 31 62 33 38 32 61 36 36 38 63 39 39 63 30 37 37 63 66 33 30 31 62 30 37 62 37 62 66 30 64 34 33 34 66 30 63 36 32 30 36 37 66 62 66 2f 64 61 74 61
got the same problem on mac