Skip to content

Avoid annoying log #4621

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

Open
4 tasks done
megasoheilsh opened this issue Apr 14, 2025 · 42 comments
Open
4 tasks done

Avoid annoying log #4621

megasoheilsh opened this issue Apr 14, 2025 · 42 comments
Labels
enhancement New feature or request PR welcome Unplanned idea, but welcome anyone to open PR for implementation

Comments

@megasoheilsh
Copy link

megasoheilsh commented Apr 14, 2025

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I provided the complete config and logs, rather than just providing the truncated parts based on my own judgment.
  • I searched issues and did not find any similar issues.
  • The problem can be successfully reproduced in the latest Release

Description

I have been seeing disconnect connection without any reason , I have tested 10 different internets. Please follow up and find out what the problem is.

Reproduction Method

ws , xhttp

Client config


{
  "log": {
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "tag": "socks",
      "port": 10808,
      "listen": "127.0.0.1",
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls",
          "quic"
        ],
        "routeOnly": false
      },
      "settings": {
        "auth": "noauth",
        "udp": true,
        "allowTransparent": false
      }
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "protocol": "vless",
      "settings": {
        "vnext": [
          {
            "address": "ip",
            "port": 65302,
            "users": [
              {
                "id": "id",
                "email": "[email protected]",
                "security": "auto",
                "encryption": "none"
              }
            ]
          }
        ]
      },
      "streamSettings": {
        "network": "xhttp",
        "xhttpSettings": {
          "mode": "packet-up"
        }
      }
    }
  ],
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
    ]
  }
}

Server config


{
  "inbounds": [
    {
      "listen": null,
      "port": 65302,
      "protocol": "vless",
      "settings": {
        "clients": [
          {
            "email": "email",
            "flow": "",
            "id": "id"
          }
        ],
        "decryption": "none",
        "fallbacks": []
      },
      "sniffing": {
        "destOverride": [
          "http",
          "tls",
          "fakedns",
          "quic"
        ],
        "enabled": true,
        "metadataOnly": false,
        "routeOnly": false
      },
      "streamSettings": {
        "network": "xhttp",
        "security": "none",
        "xhttpSettings": {
          "headers": {},
          "host": "",
          "mode": "packet-up",
          "noSSEHeader": false,
          "path": "/",
          "scMaxBufferedPosts": 30,
          "scMaxEachPostBytes": "1000000",
          "xPaddingBytes": "100-1000"
        }
      },
      "tag": "inbound-65302"
    }
  ],
  "log": {
    "access": "none",
    "dnsLog": false,
    "error": "",
    "loglevel": "warning",
    "maskAddress": ""
  },
  "observatory": null,
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "UseIP",
        "noises": [],
        "redirect": ""
      },
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "policy": {
    "levels": {
      "0": {
        "statsUserDownlink": true,
        "statsUserUplink": true
      }
    },
    "system": {
      "statsInboundDownlink": true,
      "statsInboundUplink": true
    }
  },
  "reverse": null,
  "routing": {
    "domainStrategy": "AsIs",
    "rules": [
      {
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "type": "field"
      },
      {
        "ip": [
          "geoip:private"
        ],
        "outboundTag": "blocked",
        "type": "field"
      },
      {
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ],
        "type": "field"
      }
    ]
  },
  "stats": {},
  "transport": null
}

Client log


[Info] [2350440183] app/proxyman/inbound: connection ends > proxy/socks: connection ends > proxy/socks: failed to transport all TCP response > io: read/write on closed pipe

[Info] [3428991414] app/proxyman/outbound: app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: connection ends > proxy/vless/outbound: failed to transfer response payload > stream error: stream ID 1; INTERNAL_ERROR; received from peer

[Info] [2564370954] transport/internet/udp: failed to handle UDP input > io: read/write on closed pipe

[Info] [3795979941] app/proxyman/outbound: app/proxyman/outbound: failed to process outbound traffic > proxy/vless/outbound: connection ends > proxy/vless/outbound: failed to transfer response payload > proxy/vless/encoding: failed to read packet length > stream error: stream ID 3; INTERNAL_ERROR; received from peer

[Info] [4051956816] app/proxyman/inbound: connection ends > proxy/socks: connection ends > proxy/socks: failed to transport all TCP response > io: read/write on closed pipe

Server log


@Fangliding Fangliding added the not following template Will be closed in one day label Apr 14, 2025
@Fangliding
Copy link
Member

无效反馈

@Fangliding Fangliding closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2025
@megasoheilsh
Copy link
Author

megasoheilsh commented Apr 14, 2025

Invalid feedback

What do you need? I have sent the config and logs, you don't need my template either, you just need to check your xray client logs in debug

@Fangliding
Copy link
Member

因为这并不是未按预期行为工作的BUG,你的问题里只有一句连不上,然后就没了。这个协议还是有人用的,如果设计真的有问题早炸锅了,我本次测试也没看到问题。对于这种含糊不清的描述除非有更多报告不然没啥精力单独给你解决

@megasoheilsh
Copy link
Author

megasoheilsh commented Apr 14, 2025

Because this is not a bug that does not work as expected. Your question only says that it cannot connect, and that's it. This protocol is still used by some people. If there is a problem with the design, it would have exploded long ago. I didn't see any problem in this test. For this kind of vague description, unless there are more reports, I don't have the energy to solve it for you separately.

Unfortunately, many users who are using it do not see this problem, apparently they have vision eye problems, apart from xhttp, this problem is also observed in websocket, what do you need now? Log? config ?

@Fangliding
Copy link
Member

ws也有问题纯粹是你们网络的问题了 与核心无关

@megasoheilsh
Copy link
Author

ws也有问题纯粹是你们网络的问题了 与核心无关

My network has no problems. I checked 10 internet companies.

@megasoheilsh
Copy link
Author

megasoheilsh commented Apr 14, 2025

ws也有问题纯粹是你们网络的问题了 与核心无关
xhttp
https://youtu.be/sfw-SMiby5g

@megasoheilsh
Copy link
Author

websocket
https://youtu.be/LBa7ChjrFac

@megasoheilsh
Copy link
Author

megasoheilsh commented Apr 14, 2025

I tested much older versions, they also have disconnectivity problems. I tested up to 1.8.15, the problem is very serious, please follow up @RPRX

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

Not Xray-core's bug

@megasoheilsh
Copy link
Author

megasoheilsh commented Apr 15, 2025

Not Xray-core's bug

I run the xray client on a Hetzner, Oracle, and Alibaba server. After a few kilobytes, I see a disconnect error. The errors point to this and say that the connection was closed and could not send the rest to the server. Then it requested TCP again to open it. its normal?

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

如果是代码 bug 会有 大量报告,否则就只是你的配置或其它与 core 无关的 problem,而 issue 区只用来处理 bug

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

这是一个非常简单的逻辑问题,WS 和 XHTTP 这两个协议有很多人用,他们都没问题,那么就不应当怀疑是 core 的 bug

@megasoheilsh
Copy link
Author

If it is a code bug, there will be a lot of reports . Otherwise, it is just your configuration or other problems not related to the core. The issue area is only used to deal with bugs.

If you search the logs in the issue, you'll see that many people have had problems,

@megasoheilsh
Copy link
Author

Web socket and xhttp are two transmissions that I tested, maybe other transmissions have problems too.

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

公网环境,连接意外断连然后在日志中有所体现很正常,非 bug,且你的问题是 影响到了正常使用,而不是日志出现什么

@megasoheilsh
Copy link
Author

Monitor your connection logs for a few minutes and you will see that the logs are overflowing. I have tested with other people's configurations, different servers, and different people, and they all receive these logs.

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

公网环境,连接意外断连然后在日志中有所体现很正常,非 bug

@megasoheilsh
Copy link
Author

Why should I receive a definitive log on a personal server after using a few kilobytes of Telegram or opening a Google site?

@megasoheilsh
Copy link
Author

I know, dear R. Even though the disconnection log is coming up, I don't have any connection problems right now and I don't see any real disconnection, but I thought I'd let you know anyway.

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

Xray-core 的日志这方面我还没整理,可能存在正常断连但日志报错的情况,我也看到过很多

未影响到正常使用,可以先忽略

@megasoheilsh
Copy link
Author

There is also a problem with ws. It is purely a problem with your network and has nothing to do with the core.
xhttp
https://youtu.be/sfw-SMiby5g

If you see these videos, I will delete them.

@megasoheilsh
Copy link
Author

I haven't sorted out the Xray-core logs yet. There may be a situation where the connection is normal but the log reports an error.I've seen a lot

It does not affect normal use and can be ignored.

Thank you for paying attention to everything.

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

举个例子,ray 默认五分钟无活动超时,可能就是粗暴的 close,然后因为层层解耦,有些协议还以为是非预期断开,就报错了

但是这都五分钟无活动了,肯定没有影响到你的正常使用

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

所以就 I don't have any connection problems right now and I don't see any real disconnection

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

而要正确传递“超时断开”这一信息的话,是一个相对复杂的系统性改造,但目前有时间的话我会写更重要的代码,所以暂时顾不上

@RPRX RPRX changed the title Unstable connection Avoid annoying log Apr 15, 2025
@RPRX RPRX removed the not following template Will be closed in one day label Apr 15, 2025
@RPRX RPRX added enhancement New feature or request PR welcome Unplanned idea, but welcome anyone to open PR for implementation labels Apr 15, 2025
@megasoheilsh
Copy link
Author

megasoheilsh commented Apr 15, 2025

What made me follow up was that Instagram, due to its low number of simultaneous connections, randomly experiences outages in the middle of videos between 30 min ~ 2 hours, and it takes about 30 to 40 seconds to resume playing the videos. After seeing the logs, I came to the conclusion that when these logs appear. By the way, I also have keep alive in all my configurations but not helped

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

改了标题,作为提醒,reopen

@RPRX RPRX reopened this Apr 15, 2025
@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

不过说实话挺复杂的,比如对端 Xray 也有超时机制,在本地看来就像是“意外断开”,或许无活跃三分钟以上的“意外断开”就不应报错

@megasoheilsh
Copy link
Author

By removing unnecessary logs, we will have a better understanding of the outage.

@RPRX
Copy link
Member

RPRX commented Apr 15, 2025

What made me follow up was that Instagram, due to its low number of simultaneous connections, randomly experiences outages in the middle of videos between 30 min ~ 2 hours, and it takes about 30 to 40 seconds to resume playing the videos.

这与 annoying log 这一问题无关,极有可能是你的本地网络问题,运营商就是会掐断长连接,不然网络资源都被旧连接占满了

@megasoheilsh
Copy link
Author

What made me follow up was that Instagram, due to its low number of simultaneous connections, randomly experiences outages in the middle of videos between 30 min ~ 2 hours, and it takes about 30 to 40 seconds to resume playing the videos.

这与 annoying log 这一问题无关,极有可能是你的本地网络问题,运营商就是会掐断长连接,不然网络资源都被旧连接占满了

My connection is 5G, but I also saw this problem with videos getting stuck on Instagram as an xray client on a Hetzner Windows server. I don't think the Hetzner network would have any problems with such a powerful network with a 10~15 gigabit internet port that my server has.

@Fangliding
Copy link
Member

这都哪跟哪啊。。。。

@megasoheilsh
Copy link
Author

这都哪跟哪啊。。。。

What, when, where?

@megasoheilsh
Copy link
Author

Why should close pipe and udp/tcp close pipe errors be seen in the xray client and server in the hetzner datacenter?

@cvpas
Copy link

cvpas commented Apr 15, 2025

和这个是不是差不多?
#4615

@megasoheilsh
Copy link
Author

megasoheilsh commented Apr 15, 2025

Is it similar to this? #4615

maybe

@megasoheilsh
Copy link
Author

android

Image
Image
Image

@xqzr
Copy link
Contributor

xqzr commented Apr 16, 2025

failed to read packet length > stream error: stream ID 3; INTERNAL_ERROR; received from peer

我在使用时,没遇过这个错误所以,我认为它不应该出现😋

@ddatsh
Copy link
Contributor

ddatsh commented Apr 23, 2025

stream error:stream id XXX 这个我本地还是偶尔会出来的
我在WIN上自己不想看到的一些LOG,本地魔改在几个地方加了一些过滤 类似

if goerrors.Is(err, io.EOF) || goerrors.Is(err, io.ErrClosedPipe) || goerrors.Is(err, context.Canceled) {
			return nil
		} else {
			innerErr := goerrors.Unwrap(err)
			if innerErr != nil {
				if goerrors.Is(innerErr, windows.WSAECONNRESET) || goerrors.Is(innerErr, windows.WSAECONNABORTED) {
					return nil
				}
			}
		}

@RPRX
Copy link
Member

RPRX commented Apr 23, 2025

@ddatsh 可以 PR 一下看看

@harvey-git
Copy link

安卓

Image Image Image

你这几个图上问题也曾经非常困扰我,我最终解决了这个问题,解决方式是套了 cloudflare 的cdn。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR welcome Unplanned idea, but welcome anyone to open PR for implementation
Projects
None yet
Development

No branches or pull requests

7 participants