Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent "connection reset by peer" while pushing image #785

Closed
peter-svensson opened this issue Jul 30, 2015 · 81 comments
Closed

Intermittent "connection reset by peer" while pushing image #785

peter-svensson opened this issue Jul 30, 2015 · 81 comments

Comments

@peter-svensson
Copy link

We're running docker-registry-v2 on an AWS EC2 instance - backed by an EBS volume (switched from S3 since we thought that might be the underlying issue).
From another AWS EC2 instance we're running a Bamboo CI agent which are building docker images and pushes them to our docker-registry.
Several times each day we get failed builds caused by docker push getting connection reset by peer.

[info] time="2015-07-30T10:00:31+02:00" level=fatal msg="Error pushing to registry: Put https://docker-registry.**.**/v2/userhq/blobs/uploads/e60ca766-eb26-4adf-8cdb-fe7a127e3e4c?_state=a7vvRPLZLleaqCBw4xGmaxJZ-Z0Jc0SsFUUtcrnlqft7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiZTYwY2E3NjYtZWIyNi00YWRmLThjZGItZmU3YTEyN2UzZTRjIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA4OjAwOjI2LjA0MzcwNzk2WiJ9&digest=sha256%3A1407c3b1319f21131f9da23c859ac406d2ae1051190611046c1666fc86dc5376: read tcp 1.2.3.4:443: connection reset by peer" 

Configuration and host information below, how can I debug this issue?

The docker registry is fronted by nginx configured as below:

user  nginx;
worker_processes  1;

events {
  worker_connections 1024;
  use epoll;
  multi_accept on;
}

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

http {
    include               /etc/nginx/mime.types;
    default_type          application/octet-stream;

    log_format            main  '$remote_addr - $remote_user [$time_local] "$request" '
                            '$status $body_bytes_sent "$http_referer" '
                            '"$http_user_agent" "$http_x_forwarded_for"';

    access_log            /var/log/nginx/access.log  main;

    sendfile              on;
    keepalive_timeout     65;
    ssl_session_timeout   10m;

    ssl_certificate       /etc/nginx/ssl/server.crt;
    ssl_certificate_key   /etc/nginx/ssl/server.key;

    ssl_ciphers                 "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
    ssl_protocols               TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers   on;
    ssl_session_cache           shared:SSL:10m;
    add_header                  Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
    add_header                  X-Frame-Options DENY;
    add_header                  X-Content-Type-Options nosniff;
    ssl_session_tickets         off;
    ssl_stapling                on; 
    ssl_stapling_verify         on;

    server {
        listen 443 ssl;
        server_name myregistrydomain.com;

        client_max_body_size 0;

        chunked_transfer_encoding on;

        client_body_buffer_size 100m;

        location /v2/ {
            # Do not allow connections from docker 1.5 and earlier
            # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents
            if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) {
                return 404;
            }

            auth_basic "registry.localhost";
            auth_basic_user_file /etc/nginx/registry.htpasswd;
            add_header 'Docker-Distribution-Api-Version' 'registry/2.0' always;

            proxy_pass                          http://docker-registry:5000;
            proxy_set_header  Host              $http_host;   # required for docker client's sake
            proxy_set_header  X-Real-IP         $remote_addr; # pass on real client's IP
            proxy_set_header  X-Forwarded-For   $proxy_add_x_forwarded_for;
            proxy_set_header  X-Forwarded-Proto $scheme;
            proxy_read_timeout                  900;
        }
    }
}

Docker registry configuration:

version: 0.1
log:
  level: info
  formatter: text
  fields:
    service: registry
    environment: production
storage:
  filesystem:
    rootdirectory: /var/
  cache:
    layerinfo: redis
  maintenance:
    uploadpurging:
      enabled: true
      age: 72h
      interval: 8h
      dryrun: false
reporting:
  newrelic:
    licensekey: xxxxx 
    name: docker-registry
    verbose: false
http:
  addr: :5000
redis:
  addr: cache:6379
  db: 0
  dialtimeout: 10ms
  readtimeout: 10ms
  writetimeout: 10ms
  pool:
    maxidle: 16
    maxactive: 64
    idletimeout: 300s

docker compose is used to start it all:

cache: 
  image: redis 

nginx:
  build: ./nginx
  links: 
    - registry:docker-registry
  ports: 
    - 443:443

registry: 
  build: ./registry
  volumes: 
    - /data/docker:/var/docker
  links: 
    - cache

Docker registry host:

$ docker info
Containers: 3
Images: 73
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 79
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-58-generic
Operating System: Ubuntu 14.04.2 LTS
CPUs: 1
Total Memory: 3.676 GiB
Name: ip-172-31-24-143
ID: OTJI:CTOH:DLAP:JVAG:RFEP:4VWV:RR2U:SMJL:E5LU:PYOZ:CYMF:DRBA
WARNING: No swap limit support
ubuntu@ip-172-31-24-143:~$ docker info
Containers: 3
Images: 73
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 79
 Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-58-generic
Operating System: Ubuntu 14.04.2 LTS
CPUs: 1
Total Memory: 3.676 GiB
Name: ip-172-31-24-143
ID: OTJI:CTOH:DLAP:JVAG:RFEP:4VWV:RR2U:SMJL:E5LU:PYOZ:CYMF:DRBA
WARNING: No swap limit support

$ docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64

Bamboo CI host:

$ docker info
Containers: 0
Images: 106
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 106
 Dirperm1 Supported: false
Execution Driver: native-0.2
Kernel Version: 3.13.0-52-generic
Operating System: Ubuntu 14.04.2 LTS
CPUs: 8
Total Memory: 14.69 GiB
Name: ip-172-31-9-199
ID: ZTUG:L4YS:6JUT:KLH4:4PPE:5CGO:GBHD:4UI4:IA6F:OI3B:T5GY:7DX2
WARNING: No swap limit support

$ docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 7c8fca2
OS/Arch (server): linux/amd64
@dmp42
Copy link
Contributor

dmp42 commented Jul 30, 2015

@pliljenberg can you get nginx error / access log, and registry logs as well?
Something in the http stack is closing the connection (probably timeouting).

@peter-svensson
Copy link
Author

@dmp42 I'll see what I can dig out. Log settings is INFO I think so it might not say much. I looked at the logs and there were no errors in them, just POST returning 201 and then stops...

@peter-svensson
Copy link
Author

nginx logs for build, it starts by getting a base image and then ends on a POST with no errors:

52.17.173.239 - - [30/Jul/2015:07:59:11 +0000] "GET /v2/ HTTP/1.1" 401 194 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - - [30/Jul/2015:07:59:11 +0000] "GET /v2/ HTTP/1.1" 401 194 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - - [30/Jul/2015:07:59:11 +0000] "GET /v2/ HTTP/1.1" 401 194 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/manifests/latest HTTP/1.1" 200 41796 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:e65d85c2ca8ed902196e6cba986c52db6c133b45d017af837607101f9abf9e14 HTTP/1.1" 200 4099 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0
-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 200 32 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-5
2-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 200 32 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-5
2-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:f3259c6366f07692036f30eb2a93390ea6771bf6b5cc0b0772aa8c736db75353 HTTP/1.1" 200 255 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-
52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:72a482703d9b283527f27c7c4b999ef0255c30798ea4a6cea26cff3d628f1e0f HTTP/1.1" 200 197 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-
52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 200 32 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-5
2-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:c29de585b2252471b5e4ed4a8be32be1292ee506c28c2961e890c777a2347d64 HTTP/1.1" 200 71480 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.
0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:0b3e3644d782261c5d480f15ba927ed8ddf47831e5013dd5e34c3cf2d297e053 HTTP/1.1" 200 679 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-
52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 200 32 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-5
2-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:002d534cd906ab17aec11915d225eebf7c081ce576cbbcd7696b21538b637660 HTTP/1.1" 200 329192 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13
.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 200 32 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-5
2-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 200 32 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-5
2-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:11 +0000] "GET /v2/java8-monitoring/blobs/sha256:fcac6604cd7d3a8b2dab92e23b523703c752c6b9b6709b3c4c18cbaab4cb3456 HTTP/1.1" 200 6200913 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.1
3.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:12 +0000] "GET /v2/java8-monitoring/blobs/sha256:2ad0947e6551242186974c30b9980029c9e66f614aece2eea8b6f41b16460fb9 HTTP/1.1" 200 14398133 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.
13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:13 +0000] "GET /v2/java8-monitoring/blobs/sha256:662eb02bc4ead8792506a3b5ad080a817c8f2b8aa3e919452285ce4311f2b218 HTTP/1.1" 200 6200915 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.1
3.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:14 +0000] "GET /v2/java8-monitoring/blobs/sha256:7715175dd1493901b6960b9741fe0fccadbc0082500cb9bde744e77ae59f7a11 HTTP/1.1" 200 21288974 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.
13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:15 +0000] "GET /v2/java8-monitoring/blobs/sha256:e9c5e611068deac3cdd6ddc72a7df7329ac06dcdb8b864ca8f54cd8ddd4ab435 HTTP/1.1" 200 65785947 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.
13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:15 +0000] "GET /v2/java8-monitoring/blobs/sha256:2c150e9bb3d54a093572a27c198f27c28a5309e466db57383c0442f73af013ff HTTP/1.1" 200 25798339 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.
13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:21 +0000] "GET /v2/java8-monitoring/blobs/sha256:1407c3b1319f21131f9da23c859ac406d2ae1051190611046c1666fc86dc5376 HTTP/1.1" 200 183224245 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3
.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - - [30/Jul/2015:07:59:34 +0000] "GET /v2/ HTTP/1.1" 401 194 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - - [30/Jul/2015:07:59:34 +0000] "GET /v2/ HTTP/1.1" 401 194 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - - [30/Jul/2015:07:59:34 +0000] "GET /v2/ HTTP/1.1" 401 194 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:34 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:34 +0000] "PUT /v2/userhq/blobs/uploads/c1991907-37b3-4deb-b8a6-de757c0c1974?_state=OjkAcUu-ErSWy32DE0ZeRWGopzLhkGd_ZFZjZ2HZxpl7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiYzE5OTE5MDctMzdiMy00ZGViLWI4YTYtZG
U3NTdjMGMxOTc0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjM0Ljc4MDU3MjI5NloifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fc
a2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:34 +0000] "HEAD /v2/userhq/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 200 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic
os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:43 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/a968d591-4429-4122-8d82-678de1d2a988?_state=3TuwsI6A_8xb7Y4HIRqVmEvkli25nn6DvFyPttVHGAp7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiYTk2OGQ1OTEtNDQyOS00MTIyLThkODItNj
c4ZGUxZDJhOTg4IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQzLjIzNzgxMTEyOFoifQ%3D%3D&digest=sha256%3A78a453a4bed8fc86fb71fb186d4c548285622f29189da998694d35d8301225e8 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fc
a2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/d2a240ca-3f7f-4f9c-b6bd-8d8bfeb98f88?_state=KQQCVJpoVRTW4EdXuW7GqKLyhG2e5attVdEG8u_bYe17Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiZDJhMjQwY2EtM2Y3Zi00ZjljLWI2YmQtOGQ4YmZlYjk4Zjg4IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0Ljc5NjE4MTA4MloifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/cb23edce-2cc0-4c94-90aa-9083aea5da71?_state=j7iXS9CCkDSo1QwIWq_C2W6ksmOTxHWH3pqqsYDtVUF7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiY2IyM2VkY2UtMmNjMC00Yzk0LTkwYWEtOTA4M2FlYTVkYTcxIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0LjgyODM1NTcxMloifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/2820b39e-18f2-48a8-af11-3d0e9e061b54?_state=MPcEBuUunURmcwfepM4pA9ohSOHZQWe3_9Rd7x5hbnV7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiMjgyMGIzOWUtMThmMi00OGE4LWFmMTEtM2QwZTllMDYxYjU0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0Ljg2MjM3MjI5OFoifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/11f80e7f-759d-4086-8512-b8193f837b77?_state=grtfU2xEF8laks-E_MTslcJt-X7swlzCTd2EH7Kzn6N7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiMTFmODBlN2YtNzU5ZC00MDg2LTg1MTItYjgxOTNmODM3Yjc3IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0Ljg5NjEyMzg4OFoifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/92d0f7c2-020d-4e00-8f31-c90f9bdd4de3?_state=XnIM_k8OrV_fBfawV1NzH1JHVzevHNwh4zxt3XeP3ol7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiOTJkMGY3YzItMDIwZC00ZTAwLThmMzEtYzkwZjliZGQ0ZGUzIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0LjkzMDQzOTMxM1oifQ%3D%3D&digest=sha256%3Ae65d85c2ca8ed902196e6cba986c52db6c133b45d017af837607101f9abf9e14 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:45 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:45 +0000] "PUT /v2/userhq/blobs/uploads/ca21e04c-ef64-4a5c-a1fa-81a767ebcd10?_state=eTqIB43VDynLeIUspH-p30H8o_hdmwLMJ6tGHzufD-97Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiY2EyMWUwNGMtZWY2NC00YTVjLWExZmEtODFhNzY3ZWJjZDEwIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ1LjY0MzYzNDU5MVoifQ%3D%3D&digest=sha256%3A662eb02bc4ead8792506a3b5ad080a817c8f2b8aa3e919452285ce4311f2b218 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:49 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:49 +0000] "PUT /v2/userhq/blobs/uploads/67b3f7b4-6a46-4711-85cd-85af60eff503?_state=CMC1hH1I77SR14H3kHP5BfzL2qZWNZ3qZqe5BScxfvx7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiNjdiM2Y3YjQtNmE0Ni00NzExLTg1Y2QtODVhZjYwZWZmNTAzIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ5LjQ3NDIyODE0MloifQ%3D%3D&digest=sha256%3Afcac6604cd7d3a8b2dab92e23b523703c752c6b9b6709b3c4c18cbaab4cb3456 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:50 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:07:59:50 +0000] "PUT /v2/userhq/blobs/uploads/0f93840a-d9da-4aed-b7a5-d7ae5f1a81ad?_state=AG-EkVWqopPf8tqlt-0vMoKpVUiG6f_PO7sHYnrkUzF7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiMGY5Mzg0MGEtZDlkYS00YWVkLWI3YTUtZDdhZTVmMWE4MWFkIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjUwLjc3MjQ3Mzg0NFoifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:08:00:26 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.1" 202 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"
52.17.173.239 - ci-user [30/Jul/2015:08:00:32 +0000] "PUT /v2/userhq/blobs/uploads/e60ca766-eb26-4adf-8cdb-fe7a127e3e4c?_state=a7vvRPLZLleaqCBw4xGmaxJZ-Z0Jc0SsFUUtcrnlqft7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiZTYwY2E3NjYtZWIyNi00YWRmLThjZGItZmU3YTEyN2UzZTRjIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA4OjAwOjI2LjA0MzcwNzk2WiJ9&digest=sha256%3A1407c3b1319f21131f9da23c859ac406d2ae1051190611046c1666fc86dc5376 HTTP/1.1" 201 0 "-" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64" "-"

Corresponding registry logs, same thing here...

172.17.0.3 - - [30/Jul/2015:07:59:34 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:34 +0000] "PUT /v2/userhq/blobs/uploads/c1991907-37b3-4deb-b8a6-de757c0c1974?_state=OjkAcUu-ErSWy32DE0ZeRWGopzLhkGd_ZFZjZ2HZxpl7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiYzE5OTE5MDctMzdiMy00ZGViLWI4YTYtZGU3NTdjMGMxOTc0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjM0Ljc4MDU3MjI5NloifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:34 +0000] "HEAD /v2/userhq/blobs/sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.0" 200 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:43 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/a968d591-4429-4122-8d82-678de1d2a988?_state=3TuwsI6A_8xb7Y4HIRqVmEvkli25nn6DvFyPttVHGAp7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiYTk2OGQ1OTEtNDQyOS00MTIyLThkODItNjc4ZGUxZDJhOTg4IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQzLjIzNzgxMTEyOFoifQ%3D%3D&digest=sha256%3A78a453a4bed8fc86fb71fb186d4c548285622f29189da998694d35d8301225e8 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/d2a240ca-3f7f-4f9c-b6bd-8d8bfeb98f88?_state=KQQCVJpoVRTW4EdXuW7GqKLyhG2e5attVdEG8u_bYe17Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiZDJhMjQwY2EtM2Y3Zi00ZjljLWI2YmQtOGQ4YmZlYjk4Zjg4IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0Ljc5NjE4MTA4MloifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/cb23edce-2cc0-4c94-90aa-9083aea5da71?_state=j7iXS9CCkDSo1QwIWq_C2W6ksmOTxHWH3pqqsYDtVUF7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiY2IyM2VkY2UtMmNjMC00Yzk0LTkwYWEtOTA4M2FlYTVkYTcxIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0LjgyODM1NTcxMloifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/2820b39e-18f2-48a8-af11-3d0e9e061b54?_state=MPcEBuUunURmcwfepM4pA9ohSOHZQWe3_9Rd7x5hbnV7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiMjgyMGIzOWUtMThmMi00OGE4LWFmMTEtM2QwZTllMDYxYjU0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0Ljg2MjM3MjI5OFoifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/11f80e7f-759d-4086-8512-b8193f837b77?_state=grtfU2xEF8laks-E_MTslcJt-X7swlzCTd2EH7Kzn6N7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiMTFmODBlN2YtNzU5ZC00MDg2LTg1MTItYjgxOTNmODM3Yjc3IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0Ljg5NjEyMzg4OFoifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:44 +0000] "PUT /v2/userhq/blobs/uploads/92d0f7c2-020d-4e00-8f31-c90f9bdd4de3?_state=XnIM_k8OrV_fBfawV1NzH1JHVzevHNwh4zxt3XeP3ol7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiOTJkMGY3YzItMDIwZC00ZTAwLThmMzEtYzkwZjliZGQ0ZGUzIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ0LjkzMDQzOTMxM1oifQ%3D%3D&digest=sha256%3Ae65d85c2ca8ed902196e6cba986c52db6c133b45d017af837607101f9abf9e14 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:45 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:45 +0000] "PUT /v2/userhq/blobs/uploads/ca21e04c-ef64-4a5c-a1fa-81a767ebcd10?_state=eTqIB43VDynLeIUspH-p30H8o_hdmwLMJ6tGHzufD-97Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiY2EyMWUwNGMtZWY2NC00YTVjLWExZmEtODFhNzY3ZWJjZDEwIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ1LjY0MzYzNDU5MVoifQ%3D%3D&digest=sha256%3A662eb02bc4ead8792506a3b5ad080a817c8f2b8aa3e919452285ce4311f2b218 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:49 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:49 +0000] "PUT /v2/userhq/blobs/uploads/67b3f7b4-6a46-4711-85cd-85af60eff503?_state=CMC1hH1I77SR14H3kHP5BfzL2qZWNZ3qZqe5BScxfvx7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiNjdiM2Y3YjQtNmE0Ni00NzExLTg1Y2QtODVhZjYwZWZmNTAzIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjQ5LjQ3NDIyODE0MloifQ%3D%3D&digest=sha256%3Afcac6604cd7d3a8b2dab92e23b523703c752c6b9b6709b3c4c18cbaab4cb3456 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:50 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:07:59:50 +0000] "PUT /v2/userhq/blobs/uploads/0f93840a-d9da-4aed-b7a5-d7ae5f1a81ad?_state=AG-EkVWqopPf8tqlt-0vMoKpVUiG6f_PO7sHYnrkUzF7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiMGY5Mzg0MGEtZDlkYS00YWVkLWI3YTUtZDdhZTVmMWE4MWFkIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA3OjU5OjUwLjc3MjQ3Mzg0NFoifQ%3D%3D&digest=sha256%3Aa3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:08:00:26 +0000] "POST /v2/userhq/blobs/uploads/ HTTP/1.0" 202 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"
172.17.0.3 - - [30/Jul/2015:08:00:29 +0000] "PUT /v2/userhq/blobs/uploads/e60ca766-eb26-4adf-8cdb-fe7a127e3e4c?_state=a7vvRPLZLleaqCBw4xGmaxJZ-Z0Jc0SsFUUtcrnlqft7Ik5hbWUiOiJ1c2VyaHEiLCJVVUlEIjoiZTYwY2E3NjYtZWIyNi00YWRmLThjZGItZmU3YTEyN2UzZTRjIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDE1LTA3LTMwVDA4OjAwOjI2LjA0MzcwNzk2WiJ9&digest=sha256%3A1407c3b1319f21131f9da23c859ac406d2ae1051190611046c1666fc86dc5376 HTTP/1.0" 201 0 "" "docker/1.6.2 go/go1.4.2 git-commit/7c8fca2 kernel/3.13.0-52-generic os/linux arch/amd64"

@dmp42
Copy link
Contributor

dmp42 commented Jul 31, 2015

No error at all in your server logs rule out registry and nginx.

Do you use any sort of proxy?
If not, that points out to network issues between your bamboo host and your registry.

Any chance you can mtr there and figure if you have packet loss?

@peter-svensson
Copy link
Author

Had to open for ICMP trafic (guess that's not required for the docker client networking to work correctly?), report:

Start: Tue Aug  4 09:23:33 2015
HOST: ip-172-31-28-41             Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  2.|-- ec2-52-17-235-32.eu-west-  0.0%    10    0.4   0.4   0.4   0.4   0.0

Not sure if it is related but I upgraded the docker-client (on the CI host) to 1.7.1 this weekend and so far we haven't seen any connection reset by peer?

Instead we got a read tcp 52.17.235.32:443: i/o timeout� error today when building. Seems to be related to moby/moby#13337 and docker-archive/docker-registry#286 (comment)

Networking seems to be a bit in-stable for docker in general? Not sure if that's environment related, go related or docker related.

@dmp42
Copy link
Contributor

dmp42 commented Aug 5, 2015

These issues are likely unrelated. i/o timeout most of the time really is just an indication that you are having connectivity issues.

The MTR output doesn't look right. Any chance you can run it again?

@peter-svensson
Copy link
Author

@dmp42 I ran mtr -rw hostand got the results above...

$ ping docker-registry-host
PING docker-registry-host (52.17.235.32) 56(84) bytes of data.

64 bytes from ec2-52-17-235-32.eu-west-1.compute.amazonaws.com (52.17.235.32): icmp_seq=1 ttl=63 time=0.495 ms

Running against the raw IP gives the same result, am I doing it wrong?

mtr -r 52.17.235.32

Start: Wed Aug 5 08:57:35 2015
HOST: ip-172-31-19-9 Loss% Snt Last Avg Best Wrst StDev
1.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
2.|-- ec2-52-17-235-32.eu-west- 0.0% 10 0.5 0.6 0.5 0.8 0.0

Could be a problem with mtr on AWS EC2 instances? https://forums.aws.amazon.com/thread.jspa?messageID=606296#606296

From my local machine I get:

1.|-- 10.91.91.1                                        0.0%    10    1.8   2.8   1.8   7.9   1.7
2.|-- 83.140.161.133                                    0.0%    10    1.9   2.5   1.8   4.7   0.5
3.|-- 83.140.83.1.biz.sta.port80.se                     0.0%    10    3.8   3.7   2.4   6.4   0.9
4.|-- 83.145.21.165                                     0.0%    10    2.4   4.1   2.3  11.1   3.2
5.|-- 213.242.108.85                                    0.0%    10    6.4  12.2   6.1  64.1  18.2
6.|-- ae-1-8.bar1.dublin1.level3.net                    0.0%    10   50.9  57.9  50.7  82.4  10.5
7.|-- ae-1-8.bar1.dublin1.level3.net                    0.0%    10   51.1  63.3  50.5 111.9  24.4
8.|-- 212.73.251.102                                    0.0%    10  106.3  56.9  50.6 106.3  17.4
9.|-- 178.236.0.112                                     0.0%    10   51.7  51.9  51.5  52.7   0.0
10.|-- 178.236.0.58                                      0.0%    10   51.1  51.9  51.0  54.8   1.0
11.|-- ec2-52-17-235-32.eu-west-1.compute.amazonaws.com  0.0%    10   51.1  51.4  50.9  52.1   0.0

@jasonf20
Copy link

I seem to be having the same issue. Also on Amazon ec2 with docker 1.7.1 (I am getting the connection reset by peer message).

I just enabled s3 logs, waiting for it to take affect to see those log outputs

@jasonf20
Copy link

I can't see any s3 logs about connection reset or timeouts..

@dmp42
Copy link
Contributor

dmp42 commented Aug 13, 2015

@jasonf20 for @pliljenberg there is no logs either on the server side. This further point to network issues in between.
That kind of issue is hard to diagnose or even pinpoint - and it's unlikely Amazon support would investigate in my experience.

Running MTR and spotting packet loss is the only way to get there I think.

@ghost
Copy link

ghost commented Aug 14, 2015

I am having the same issue. I've got a registry-v2 on an ec2 instance behind nginx. I've got another instance running Jenkins building images. When I push an image I get the Error pushing to registry: Put <url> read tcp <ip>: connection reset by peer. Some layers push without a problem, but it appears that mostly the larger ones fail. When pushing from my own machine I never had the error.

@dmp42
Copy link
Contributor

dmp42 commented Aug 14, 2015

If that happens only on jenkins, then the issue is likely there... is there any proxy there? virtual machine involved? running in a container?

@jasonf20
Copy link

@dmp42 In my case I have a server running teamcity (amazon ec2 server - with no inner vm or docker) which sends directly to the docker-registry (also directly on ec2 instance). No nginx, proxy or the likes. I do have TLS enabled on the registry.

I think that even if this is a network related issue, (I'll also try to run mtr soon - but suspect no packet loss) then docker should be more resilient towards it. For example perform a couple of retries, or resend of failed data.

EDIT: Here is the MTR (which is fine as I suspected - I also let it run for longer, with no issues):

HOST: ip-182-31-25-151                                 Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- ec2-73-165-0-136.eu-west-1.compute.amazonaws.com  0.0%    10   22.1  87.0  12.7 437.6 135.9
  2.|-- ec2-52-48-24-54.eu-west-1.compute.amazonaws.com   0.0%    10    0.5   0.5   0.4   0.5   0.0

@jasonf20
Copy link

Additionally, I also ran mtr at the same time as pushing (in both directions) and had no package loss at the time of a push error ("connection reset")

@ghost
Copy link

ghost commented Aug 25, 2015

I did some more testing. I've got 2 EC2 instances. One is running a registry-v2 container, the other has an image which I am trying to push to the registry. I also have my own machine which is not in AWS, it is my laptop.

1: Push to local address from other ec2 instance

I tagged the image I am trying to push with the local ip addess and port of the registry:

docker tag someplace/someimage 172.x.x.x:5000/someimage

I added the registry as an insecure registry to the docker opts and restarted the daemon. I can push the image successfully (it was not present in the registry).

I removed all data from the registry and pushed the image again successfully (I did this 3 times to be sure it wasn't a one-off)

2: Push to external address from other ec2 instance

I tagged the image I am trying to push with the external ip addess and port of the registry:

docker tag someplace/someimage 52.x.x.x:5000/someimage

I added the registry as an insecure registry to the docker opts and restarted the daemon. When I push the image I get an Error pushing to registry: Put <url> read tcp <ip>: connection reset by peer

I removed all data from the registry and pushed the image again without success (I did this 3 times to be sure it wasn't a one-off)

Some layers are pushed successfully, but then one will fail. When I try again some more will be pushed when I am lucky. There is a layer of 200MB which I have not been able to push.

3: Push to external address from a machine outside of AWS

I tagged the image I am trying to push with the external ip addess and port of the registry:

docker tag someplace/someimage 52.x.x.x:5001/someimage

I added the registry as an insecure registry to the docker opts and restarted the daemon. I can push the image successfully (it was not present in the registry).

I removed all data from the registry and pushed the image again successfully (I did this 3 times to be sure it wasn't a one-off)

4: Push to hostname + nginx from other ec2 instance

I tagged the image I am trying to push with the hostname of the registry:

docker tag someplace/someimage registry.example.com/someimage

I added the registry as an insecure registry to the docker opts and restarted the daemon. When I push the image I get an Error pushing to registry: Put <url> read tcp <ip>: connection reset by peer

I removed all data from the registry and pushed the image again without success (I did this 3 times to be sure it wasn't a one-off)

Some layers are pushed successfully, but then one will fail. When I try again some more will be pushed when I am lucky.

5: Push to hostname + nginx from machine outside of AWS

I tagged the image I am trying to push with the hostname of the registry:

docker tag someplace/someimage registry.example.com/someimage

I added the registry as an insecure registry to the docker opts and restarted the daemon. I can push the image successfully (it was not present in the registry).

I removed all data from the registry and pushed the image again successfully (I did this 3 times to be sure it wasn't a one-off)

Final notes:

  • I am not pushing the image from within a container.
  • docker version 1.7.1 and registry 2.1.1 (although we have had this issue since docker 1.5 and registry version 1)
  • The ec2 instance are virtual machines of course (ubuntu)
  • The registry uses an S3 bucket for storage

@ghost
Copy link

ghost commented Aug 25, 2015

So it appears to be an issue with Amazon resetting connections when using external addresses between instances. And not a docker or registry or nginx issue. Is somebody able to reproduce this?

@dmp42
Copy link
Contributor

dmp42 commented Aug 25, 2015

@VogonogoV smells like ELB timeout?
If you are using ELB, I suggest you look into them settings, or even switch to TCP proxy mode.

@ghost
Copy link

ghost commented Aug 25, 2015

@dmp42 I don't use ELB. Any other suggestions? I posted it on the Amazon forums as well, maybe they know whats up.

@jasonf20
Copy link

I have the same issue exactly, but do not use elb, so I don't think it's
related
On Aug 25, 2015 5:49 PM, "VogonogoV" notifications@github.com wrote:

@dmp42 https://github.com/dmp42 I don't use ELB. Any other suggestions?
I posted it on the Amazon forums as well, maybe they know whats up.


Reply to this email directly or view it on GitHub
#785 (comment)
.

@dmp42
Copy link
Contributor

dmp42 commented Aug 25, 2015

Ok. Keep us posted if you get any infos from Amazon / forums.
tcpdumping the traffic and capturing the traffic might help figuring out "what" "where" is the connection being closed/timeouting.

@stevvooe
Copy link
Collaborator

There is a layer of 200MB which I have not been able to push.

I haven't had time to read through the full issue but I suspect that the client_body_buffer_size 100m; configuration directive may be contributing to the failures. 100MB is way too big for most connections. I'd recommend removing this directive or setting to anywhere from 1-4MB, depending on available bandwidth.

@ghost
Copy link

ghost commented Aug 27, 2015

@stevvooe Thanks for the suggestion, but nginx is not the problem. I'll summarize the issue as I am seeing it.

From To Registry address nginx Does it work?
ec2 machine ec2 hosted registry 172.x.x.x no yes
ec2 machine ec2 hosted registry 52.x.x.x no no
ec2 machine ec2 hosted registry registry.ourcompany.com yes no
my laptop ec2 hosted registry 52.x.x.x no yes
my laptop ec2 hosted registry registry.ourcompany.com yes yes

When it doesn't work I get Error pushing to registry: Put <url> read tcp <ip>: connection reset by peer. Some layers will be pushed successfully. When I retry the push, more layers will be pushed. I have not been able to push a 200MB layer from an ec2 machine. I have been able to do it from my own, and my colleagues machines.

My conclusion: it is not a docker, registry, nor nginx problem. I think it's an AWS problem.

@dmp42 I'll try tcpdumping when I have the time. I'll post updates here.

@stevvooe
Copy link
Collaborator

@VogonogoV That table makes it pretty clear that the issue has something to do with ec2. I wonder if you need to use a different dns entry for inside ec2. The issue may be that routing using the externally available 52.x.x.x IP is not optimal for host to host ec2 transfers.

@ghost
Copy link

ghost commented Aug 28, 2015

@stevvooe As a workaround I am now building images on the ec2 machine and tagging them with the local address: docker build -t 172.x.x.x:5000/some-image. When I pull the image on my machine it just uses the name you pulled it from so: docker pull registry.example.com/some-image. It works, although it is kinda freaky. Thanks for the help, nobody at the Amazon forums replies 😢

@stevvooe
Copy link
Collaborator

stevvooe commented Sep 2, 2015

@VogonogoV Did you try tweeting? Their support tends to work better with motivation. ;)

@RichardScothern @dmp42 @aaronlehmann Should we add a blurb in documentation about this when using s3?

@robertfirek
Copy link

I hit the same problem. Any progress on the AWS side? I would like to avoid the workaround from @VogonogoV

@stevvooe
Copy link
Collaborator

@robertfirek Unfortunately, this is an AWS issue and we don't really have the means to investigate. I'd recommend you open an issue with their support team.

@dmp42 Any ideas here?

@ghost
Copy link

ghost commented Sep 17, 2015

I haven't heard anything from AWS. I didn't tweet because I don't have Twitter. So anyone who wants to, feel free. Opening an issue might give some more insights.

I've been using the workaround for 3 weeks now an I haven't looked back at it again.

@robertfirek
Copy link

@stevvooe @VogonogoV Thank you for your update.

@stevvooe
Copy link
Collaborator

@VogonogoV @robertfirek I have flexed the power of the tweet: https://twitter.com/stevvooe/status/644448877978845184. We'll see if they help.

@VogonogoV Do you have a link to the forum post?

@EliasGabrielsson
Copy link

Any news on this issue?
I can reproduce it as well.

@iamjoshd
Copy link

I was having this issue and thought it might be related to timeouts based on an earlier comment. I thought this might have something to do with the block write size being too large and occasionally timing out so I changed (shortened? it's in KB, right?) it and explicitly set to the below and the problems seemed to resolve afterwards.

storage:
chunksize: 5242880

@stevvooe
Copy link
Collaborator

@13josh Users experiencing this issue are having connection resets while pushing and pulling over some VPC configuration. If you are experiencing this issue, changing the buffer size may help, for certain configurations, as it can change the connection envelope for a single given chunk request. Albeit, we am not sure that changing buffer size having an effect is indicative of this problem. In fact, if that worked, it may be a different issue.

@EliasGabrielsson @13josh I'd recommend relating your experience to https://forums.aws.amazon.com/thread.jspa?threadID=215090.

@dolphyvn
Copy link

I get this issue as well, Im not using ec2 but instead a private network. Registry version 2 behind nginx proxy.

@stevvooe
Copy link
Collaborator

@dolphyvn This issue covers "connection reset" with AWS. If you're having this while not using AWS, you're likely having another, unrelated problem.

@kepeket
Copy link

kepeket commented Feb 12, 2016

FYI, after spending a few hours on this with a sysadmin, we figured out that when you use --net host instead of --net bridge the whole problem disappear.

After a bunch of tcpdump and stuff, it seems that a RST packet are being sent by the host (and not the docker container), resulting in "connection reset by peer".

When you ps auxf on the EC2 running the registry container, you can see that the container is running a docker-proxy in front of the container. When using host network, the proxy disappears and the problem with it.

Hope it helps, I'm copying this on the AWS issue too

Bye

@ChrisRut
Copy link

Well this is unfortunate because this means you can't reliably host distribution on AWS using ECS since ECS doesn't support --net host : aws/amazon-ecs-agent#185

@stevvooe
Copy link
Collaborator

@kepeket That is an interesting data point. It might be worthwhile relating your experience on https://forums.aws.amazon.com/thread.jspa?threadID=215090.

@kepeket
Copy link

kepeket commented Feb 12, 2016

Hi

Yes i tried but the login page of Amazon was infinite looping I don't why

I'll retry a bit later

à 21:05, Stephen Day notifications@github.com a écrit :

@kepeket That is an interesting data point. It might be worthwhile relating your experience on https://forums.aws.amazon.com/thread.jspa?threadID=215090.


Reply to this email directly or view it on GitHub.

@aaronlehmann
Copy link
Contributor

I hit the issue when I did a docker push on an EC2 instance to a registry running on the same instance, using the external-facing IP address. Using the internal IP did not trigger the problem. A large upload would generally fail after about 8 seconds. It was very easy to reproduce.

I collected a tcpdump to see what was happening. At the moment the upload failed, the EC2 instance was receiving a packet that was very far out of sequence. Its sequence number and timestamp were several seconds behind the actual TCP stream. Interestingly, this did not seem to be a retransmit of a previously-sent packet. Presumably this packet is generated within AWS' infrastructure.

Normally a packet like this should be treated as a spurious retransmit and ignored, but for some reason it was causing the local host to generate a RST packet and kill the connection. Given the anecdote in #785 (comment) that running the registry container in host networking mode works around the issue, I suspected this had something to do with how Docker bridge networking works.

When operating in bridged mode, Docker creates some iptables rules to perform NAT between the exposed address/port and the container's internal address/port. I had a look at Linux's NAT implementation, which builds on top of nf_conntrack for connection tracking. nf_conntrack has a state machine that tracks connection state. If nf_conntrack believes its state is out of sync with the actual connection, it treats incoming packets as invalid. One of the checks is the tcp_window function, which rejects packets outside the TCP window. I believe this is the check that is failing.

nf_conntrack has a "be liberal" flag that accepts these packets as valid. Sure enough, after running:

echo 1 > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_be_liberal

...I haven't been able to trigger the issue anymore.

If this is indeed a successful workaround, should we consider having Docker Engine switch on that flag by default?

cc @tonyhb @dmp42 @stevvooe @mrjana

@mrjana
Copy link

mrjana commented Apr 8, 2016

@aaronlehmann Are you sure this workaround fixes the problem? Because conntrack will simply accept this packet if it's outside the window http://lxr.free-electrons.com/source/net/netfilter/nf_conntrack_proto_tcp.c#L1036. Just that it won't update ct state but since this is really an unexpected packet it makes sense not to update ct state. This doesn't seem to be the direct cause of RST packet.

@aaronlehmann
Copy link
Contributor

@mrjana: I'll do more testing tomorrow to confirm the workaround.

I'm not sure what causes the RST packet to get generated. Perhaps there's an iptables rule that's rejecting INVALID packets, or similar implicit behavior in the kernel.

FWIW, I found this post, which describes a similar problem that was resolved by switching on the "be liberal" flag: https://www.pitt-pladdy.com/blog/_20091125-185551_0000_Linux_Netfilter_and_Window_Scaling/

@aaronlehmann
Copy link
Contributor

@mrjana: I can confirm that the setting makes a difference. I set ip_conntrack_tcp_be_liberal to 1, and pushed a huge image three times. The pushes succeeded without incident. Then I set the flag back to 0, and repeated the test. Each of three attempts had a severed connection within seconds.

@mrjana
Copy link

mrjana commented Apr 8, 2016

Thanks for confirming that @aaronlehmann.

I took a look at all the places in the kernel where an RST could be generated and they are mainly generated when disconnect or close happened with unread data or if there was memory pressure in the host. So looks like RST is happening due to some indirect sequence of events after receiving the unexpected sequence number packer and I think we need to connect some missing dots there.

I will try to take a look at the packet capture that you sent me and see if I could see when exactly RST is getting generated in relation to the packet with the unexpected sequence number.

@aaronlehmann
Copy link
Contributor

@mrjana: I think I get it now. When conntrack treats a packet like this as "invalid", it doesn't associate it with the flow that its tuple corresponds to. Thus, the packet doesn't get rewritten by the NAT rule, and ends up being handled as if it was part of a connection to the host's actual IP address. The host sees that it doesn't have a matching flow, and (correctly) sends a RST packet.

I found I can also work around this by adding a rule to the INPUT chain that drops invalid packets:

iptables -I INPUT -m conntrack --ctstate INVALID -j DROP

This prevents the packet from being interpreted as destined to the pre-NAT IP address, and prevents the RST from being generated.

@mrjana
Copy link

mrjana commented Apr 8, 2016

@aaronlehmann Yes I agree with your prognosis. That is indeed what is happening here. And having to drop if ctstate is invalid is a much better fix than enable be_liberal flag. Although it probably should be inserted in DOCKER chain in the PREROUTING hook. Can you please file an issue in docker/libnetwork to get it fixed although it has very limited chance of making it into 1.11?

@stevvooe
Copy link
Collaborator

stevvooe commented Apr 8, 2016

@aaronlehmann @mrjana Bravo!

@aaronlehmann
Copy link
Contributor

Filed moby/libnetwork#1090. Will also reach out to AWS with our conclusions.

@aaronlehmann
Copy link
Contributor

I reported the findings to AWS. Some testing showed this affected instances in Ireland, but not Northern Virginia. They were able to reproduce the problem, and seem to have fixed it in the Ireland region. I'm going to close this ticket since we now know it's not a distribution-specific problem, and the AWS issue appears to be resolved.

@SamirFarhat
Copy link

I recently hit the same issue. It was caused by a problem affecting my network card. In my host (Windows Server 2016) when Hyper-V is enabled for docker, i have created an external virtual switch using the Network Interface card, and since that i hit the issue. It was resolved when i removed the Virtual Switch. Long story short, check your network interfaces (drivers, firmware...)

@ikr0m
Copy link

ikr0m commented Sep 26, 2019

My 3G internet network disconnects when I try to docker push

@dubo-dubon-duponey
Copy link

@ikr0m then it's likely an issue with your 3G provider, right?

@ikr0m
Copy link

ikr0m commented Sep 27, 2019

@dubo-dubon-duponey I'm not sure why it should be issue with provider. After executing docker push ... on terminal 3G connection disconnects. It happened twice. I was trying Getting started section of docker docs and it was simple image push to docker hub. I achieved to push finally with other workaround. I didn't dig into details of previous disconnection. That's why I found this thread to find some solution.

@dubo-dubon-duponey
Copy link

I'm not sure why it should be issue with provider. After executing docker push ... on terminal 3G connection disconnects.

It's hard to tell without more debugging information, but what you describe here looks like your 3G connection is not stable - which is why I suggested it might be an issue with your provider.

If that's the case, then it's unlikely there is anything docker can do here. "docker push" does not make you lose your uplink (3G or otherwise) by itself...

Suggestion: try to HTTP POST random content using curl, and see if it triggers the same problem with your connection.

@ShaikSaleem123
Copy link

here iam also getting same error #Connection reset by peer while pushing image to docker registry via jenkins,
in our organization they have connected with vpn and several time its fluctuating to access sites

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests