AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 406804
Accepted
Gonfi den Tschal
Gonfi den Tschal
Asked: 2017-11-25 05:05:50 +0800 CST2017-11-25 05:05:50 +0800 CST 2017-11-25 05:05:50 +0800 CST

SCP突然中止:管道损坏,消息验证码不正确

  • 772

相关话题

我的问题与SSH 损坏的管道类似但不完全相同,消息身份验证代码不正确,没有答案。

任务

将大文件从一个 Linux 复制到另一个。两者都位于同一个 ISP 位置。

设置

源和目标都是:Ubuntu 16.04.3 LTS

SSH 版本:OpenSSH_7.2p2 Ubuntu-4ubuntu2.2,OpenSSL 1.0.2g 2016 年 3 月 1 日

源机用了一年了,没问题。目标机器是新设置的专用服务器(1 天)。

scp 命令:

scp -P [customport] /some/large/file user@targetmachine:/target/folder/

该文件大小约为 20 GB。

问题描述

它通常在大约 3-4% 后中止。全速约为 112MB/s。当我使用例如 scp -l 16384 进行节流时,它以大约 2MB/s 的速度运行,在很晚的时间内中止,但百分比相似。

中止总是以完全相同的方式进行。客户得到:

Write failed: Broken pipe 
lost connection

虽然服务器在 /var/log/auth.log 中有这个

Nov 24 13:04:54 Ubuntu-1604-xenial-64-minimal-no-hwe sshd[1900]: Corrupted MAC on input.
Nov 24 13:04:54 Ubuntu-1604-xenial-64-minimal-no-hwe sshd[1900]: fatal: ssh_dispatch_run_fatal: Connection from [client-ip] port 54050: message authentication code incorrect

调查

我已经尝试过启用和禁用 iptables,没有变化。

在大约 10 次尝试中,有 1 次成功到最后,然后下一个文件再次中止。

似乎重新启动目标机器后,可以向其写入更多字节。

SSH 没问题。我可以将空闲的 ssh 连接保持打开数小时,或者在top命令正在运行且不会中断的情况下保持打开状态。

问题

这是一个拦截器。首先,复制一个 200gb 的文件似乎是不可能的。其次,我不希望生产中的机器出现网络问题。

我能做些什么来进一步调查这个?

我在其他地方读到这可能是网卡/硬件问题,我如何向我的提供商证明这一点以获得更换?

更新 1

10 分钟的结果mtr看起来不错:

└─(~)─(49 files, 12Gb)─> mtr -r -c 600 -rw [targetserver]
Start: Fri Nov 24 18:36:21 2017
HOST: Ubuntu-1404-trusty-64-minimal             Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- static.XX.XX.XX.XX.clients.your-server.de  0.0%   600    0.5   0.3   0.2  24.5   1.3
  2.|-- core24.fsn1.hetzner.com                    0.0%   600    0.3   0.3   0.2   6.8   0.4
  3.|-- core22.fsn1.hetzner.com                    0.0%   600    0.4   0.4   0.3   9.7   0.8
  4.|-- ex9k2.dc1.fsn1.hetzner.com                 0.0%   600    0.4   0.5   0.3   6.8   0.8
  5.|-- my.target.hostname                         0.0%   600    0.4   0.3   0.3   0.4   0.0
┌(myuser@Ubuntu-1404-trusty-64-minimal)─(✓)─(06:46 PM Fri Nov 24)

之后我尝试了另一个 scp,它在 7.5GB 后以 44% 失败,速率为 111MB/秒。失败又来了,在此之前没有停滞。

关于可能的重复:我总是得到“损坏的管道”,而不是“套接字的协议错误类型”。不使用 Mac,两个 Linux(以上版本)。不使用 rsync。据我了解,那里的答案是用户将另一张网卡放入服务器,而没有弄清楚实际原因是什么。我没有这个选项(远程主机中心的专用服务器)。

这是关于网卡的 lshw 的输出:

myuser@Ubuntu-1604-xenial-64-minimal-no-hwe /home/myuser # lshw -class network
  *-network:0 DISABLED
       description: Ethernet interface
       product: NetXtreme II BCM57810 10 Gigabit Ethernet
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:61:00.0
       logical name: eth0
       version: 10
       serial: e0:d5:5e:1e:73:18
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msix pciexpress bus_master cap_list rom ethernet physical fibre 1000bt-fd
       configuration: autonegotiation=off broadcast=yes driver=bnx2x driverversion=1.712.30-0 firmware=bc 7.14.2 latency=0 link=no multicast=yes port=fibre
       resources: iomemory:14c0-14bf iomemory:14c0-14bf iomemory:14c0-14bf irq:81 memory:14c0b000000-14c0b7fffff memory:14c0a800000-14c0affffff memory:14c0b810000-14c0b81ffff memory:e5f80000-e5ffffff memory:14c0ba20000-14c0bc1ffff memory:14c0bca0000-14c0bd1ffff
  *-network:1 DISABLED
       description: Ethernet interface
       product: NetXtreme II BCM57810 10 Gigabit Ethernet
       vendor: Broadcom Corporation
       physical id: 0.1
       bus info: pci@0000:61:00.1
       logical name: eth1
       version: 10
       serial: e0:d5:5e:1e:73:1a
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msix pciexpress bus_master cap_list rom ethernet physical fibre 1000bt-fd
       configuration: autonegotiation=off broadcast=yes driver=bnx2x driverversion=1.712.30-0 firmware=bc 7.14.2 latency=0 link=no multicast=yes port=fibre
       resources: iomemory:14c0-14bf iomemory:14c0-14bf iomemory:14c0-14bf irq:102 memory:14c0a000000-14c0a7fffff memory:14c09800000-14c09ffffff memory:14c0b800000-14c0b80ffff memory:e5f00000-e5f7ffff memory:14c0b820000-14c0ba1ffff memory:14c0bc20000-14c0bc9ffff
  *-network:0
       description: Ethernet interface
       product: I350 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:62:00.0
       logical name: eth2
       version: 01
       serial: 6c:b3:11:23:32:18
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.3.0-k duplex=full firmware=1.63, 0x80000cbb ip=94.130.51.145 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:71 memory:e5900000-e59fffff memory:e5a84000-e5a87fff memory:e5a00000-e5a7ffff memory:14c0bf60000-14c0bf7ffff memory:14c0bf40000-14c0bf5ffff
  *-network:1 DISABLED
       description: Ethernet interface
       product: I350 Gigabit Network Connection
       vendor: Intel Corporation
       physical id: 0.1
       bus info: pci@0000:62:00.1
       logical name: eth3
       version: 01
       serial: 6c:b3:11:23:32:19
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi msix pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.3.0-k firmware=1.63, 0x80000cbb latency=0 link=no multicast=yes port=twisted pair
       resources: irq:82 memory:e5800000-e58fffff memory:e5a80000-e5a83fff memory:14c0bf20000-14c0bf3ffff memory:14c0bf00000-14c0bf1ffff
  *-network DISABLED
       description: Ethernet interface
       physical id: 1
       logical name: virbr0-nic
       serial: 52:54:00:80:b4:28
       size: 10Mbit/s
       capabilities: ethernet physical
       configuration: autonegotiation=off broadcast=yes driver=tun driverversion=1.6 duplex=full link=no multicast=yes port=twisted pair speed=10Mbit/s

这提醒了我,我确实安装了 KVM

apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

但是还没有VM。

ssh scp
  • 2 2 个回答
  • 9783 Views

2 个回答

  • Voted
  1. davidovitch
    2019-06-11T00:59:35+08:002019-06-11T00:59:35+08:00

    scp使用或rsync+ samba/时我遇到了类似的问题cifs。

    通过在客户端上安装服务器时绕过写入缓存,问题在rsync+ samba/端得到了解决(另请参见rsync 不断断开连接:损坏的管道)。在Make Linux write to network filesystem with local disk reads中给出了有关此问题根本原因的深入解释。cifs--cache=none

    您可以考虑scp限制传输速率以避免在磁盘能够赶上之前填充页面缓存,例如参见https://stackoverflow.com/questions/30020519/broken-pipe-error-on-scp。

    • 1
  2. Best Answer
    Gonfi den Tschal
    2017-12-01T23:36:24+08:002017-12-01T23:36:24+08:00

    这是一个“最小的-no-hwe”安装。Ubuntu 的“最小”版本很可能从一开始就可以工作。

    这些命令用于将 hwe 安装到这个有故障的 no-hwe 版本中(因此无需完全重新安装):

    apt-get install --install-recommends linux-generic-hwe-16.04
    shutdown -r now
    

    在此之后,所有 scp 副本都可以工作,不会中止。

    附带说明,终端中的问候语仍然显示

    "myuser@Ubuntu-1604-xenial-64-minimal-no-hwe"
    

    即使 hwe 现在正在运行。

    我再次澄清此修复之前的行为:从不同位置到这台机器的所有大型 scp 都已中止,而从这台机器到不同位置的所有 scp 成功。

    这是服务器规范https://www.hetzner.de/epyc-server虽然主机没有指定主板/网络的模型。

    • 0

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    JSON数组使用jq来bash变量

    • 4 个回答
  • Marko Smith

    日期可以为 GMT 时区格式化当前时间吗?[复制]

    • 2 个回答
  • Marko Smith

    bash + 通过 bash 脚本从文件中读取变量和值

    • 4 个回答
  • Marko Smith

    如何复制目录并在同一命令中重命名它?

    • 4 个回答
  • Marko Smith

    ssh 连接。X11 连接因身份验证错误而被拒绝

    • 3 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Marko Smith

    systemctl 命令在 RHEL 6 中不起作用

    • 3 个回答
  • Marko Smith

    rsync 端口 22 和 873 使用

    • 2 个回答
  • Marko Smith

    以 100% 的利用率捕捉 /dev/loop -- 没有可用空间

    • 1 个回答
  • Marko Smith

    jq 打印子对象中所有的键和值

    • 2 个回答
  • Martin Hope
    EHerman JSON数组使用jq来bash变量 2017-12-31 14:50:58 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Drux 日期可以为 GMT 时区格式化当前时间吗?[复制] 2017-12-26 11:35:07 +0800 CST
  • Martin Hope
    AllisonC 如何复制目录并在同一命令中重命名它? 2017-12-22 05:28:06 +0800 CST
  • Martin Hope
    Steve “root”用户的文件权限如何工作? 2017-12-22 02:46:01 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST
  • Martin Hope
    Cbhihe 将默认编辑器更改为 vim for _ sudo systemctl edit [unit-file] _ 2017-12-03 10:11:38 +0800 CST
  • Martin Hope
    showkey 如何下载软件包而不是使用 apt-get 命令安装它? 2017-12-03 02:15:02 +0800 CST
  • Martin Hope
    youxiao 为什么目录 /home、/usr、/var 等都具有相同的 inode 编号 (2)? 2017-12-02 05:33:41 +0800 CST
  • Martin Hope
    user223600 gpg —list-keys 命令在将私钥导入全新安装后输出 uid [未知] 2017-11-26 18:26:02 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve