【问题标题】:Docker push Falling with "Failed to read stream: Unexpected EOF read on the socket' status '400'Docker push Falling with "Failed to read stream: Unexpected EOF read on the socket' status '400'
【发布时间】:2017-10-16 08:34:45
【问题描述】:

我们在 AWS 上有一个人工测试设置,其中涉及 AWS ELB 和一个充当人工服务器的 EC2 实例。我们的设置是基于 docker 的 JFROG 工件。

在推送特定映像(“平台映像”)时,我们面临“在套接字上读取意外 EOF”错误,但我们能够将相同的映像推送到我们拥有的生产环境。这两个环境之间的区别在于我们在测试环境中使用的是 AWS ELB 和子域类型的 docker 注册表。在我们当前的产品中,我们没有 ELB,并且 docker 注册表属于端口绑定类型。

2017-10-16 06:48:37,967 [http-nio-8081-exec-9] [ERROR] (o.a.a.c.r.ArtifactoryService:282) - 无法读取流:在套接字上读取意外的 EOF org.jfrog.storage.binstore.common.ClientInputStreamException:读取流失败:在套接字上读取意外的 EOF 在 org.jfrog.storage.binstore.common.ClientStream.read(ClientStream.java:36) ~[binary-store-core-1.0.2.jar:na] 在 org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792) ~[commons-io-2.4.jar:2.4] 在 org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769) ~[commons-io-2.4.jar:2.4] 在 org.apache.commons.io.IOUtils.copy(IOUtils.java:1744) ~[commons-io-2.4.jar:2.4]

2017-10-16 06:48:37,968 [http-nio-8081-exec-9] [WARN] (o.j.r.d.v.r.h.DockerV2LocalRepoHandler:170) - 上传 blob 'platform-image/_uploads/e205ae95-2e43-48c2- 时出错942e-a5aea659575c' 得到状态 '400' 和消息:'读取流失败:在套接字上读取意外的 EOF'

请检查并告诉我们这里可能存在什么问题。对于所有图像,我们都没有面临这个问题。但是,同样的图像有问题,我们可以推送到 prod 实例。

注意:相同的图像最初可以使用一次,但是当我们在几天后尝试时它无法正常工作。

所以我们怀疑这可能与我们的配置有关。如果您需要我们提供更多详细信息,请告诉我们。

图像名称:平台图像 大小:15.2 GB。

我们的集群详情: AWS 经典 ELB:1 Ec2-instance (i3.2xlarge): 1

Nginx 配置:

## server configuration
server {
    listen 443 ssl;
    listen 80 ;
    server_name ~(?<repo>.+)\.domain.com domain.com;

    if ($http_x_forwarded_proto = '') {
        set $http_x_forwarded_proto  $scheme;
    }
    ## Application specific logs
    access_log /var/log/nginx/docker-access.log;
    error_log /var/log/nginx/docker-error.log;
    rewrite ^/$ /artifactory/webapp/ redirect;
    rewrite ^/artifactory/?(/webapp)?$ /artifactory/webapp/ redirect;
    rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/$repo/$1/$2;
    chunked_transfer_encoding on;
    client_max_body_size 0;
    location /artifactory/ {
    proxy_read_timeout  3200;
    proxy_pass_header   Server;
    proxy_cookie_path   ~*^/.* /;
    proxy_pass          http://localhost:8081/artifactory/;
    proxy_set_header    X-Artifactory-Override-Base-Url $http_x_forwarded_proto://$host:$server_port/artifactory;
    proxy_set_header    X-Forwarded-Port  $server_port;
    proxy_set_header    X-Forwarded-Proto $http_x_forwarded_proto;
    proxy_set_header    Host              $http_host;
    proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
    }
}

【问题讨论】:

    标签: artifactory


    【解决方案1】:

    经过调查,我们发现问题是由 ELB 配置引起的。 ELB 空闲超时值默认设置为 60 秒,并且工件无法在此时间内发回响应,因此 ELB 关闭了连接。增加空闲超时值解决了该问题。

    Artifactory 日志错误并不清楚超时,它更通用,让我们多方思考。

    谢谢。

    【讨论】:

      猜你喜欢
      • 2023-02-11
      • 1970-01-01
      • 2022-12-05
      • 1970-01-01
      • 2022-12-02
      • 1970-01-01
      • 2022-12-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多