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

Xray 24.12.28版本配置balancers后,启动异常 #4222

Closed
4 tasks done
sakullla opened this issue Dec 29, 2024 · 9 comments
Closed
4 tasks done

Xray 24.12.28版本配置balancers后,启动异常 #4222

sakullla opened this issue Dec 29, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@sakullla
Copy link

完整性要求

  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我提供了完整的配置文件和日志,而不是出于自己的判断只给出截取的部分。
  • 我搜索了 issues, 没有发现已提出的类似问题。
  • 问题在 Release 最新的版本上可以成功复现

描述

route配置中配置balancers后,启动异常报错“Failed to start: main: failed to create server > core: not all dependencies are resolved.”。
移除掉balancers后正常启动

重现方式

按照配置文件在服务器端启动

客户端配置

跟客户端无关,服务器端启动异常

服务端配置


{
    "log": {
        "loglevel": "warning"
    },
    "routing": {
        "domainStrategy": "IPIfNonMatch",
        "balancers": [
            {
                "tag": "ai-balancer",
                "selector": [
                    "ai"
                ],
                "fallbackTag": "direct",
                "strategy": {
                    "type": "roundRobin",
                    "settings": {}
                }
            }
        ]
    },
    "inbounds": [
        {
            "listen": "0.0.0.0",
            "port": 22222,
            "protocol": "shadowsocks",
            "settings": {
                "password": "11111",
                "method": "aes-128-gcm",
                "network": "tcp,udp",
                "clients": [
                    {
                        "password": "11111",
                        "method": "aes-128-gcm"
                    }
                ]
            },
            "streamSettings": {
                "sockopt": {
                    "tcpFastOpen": true,
                    "tcpMptcp": true,
                    "tcpNoDelay": true
                }
            },
            "sniffing": {
                "enabled": true,
                "destOverride": [
                    "http",
                    "tls",
                    "quic"
                ]
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "streamSettings": {
                "sockopt": {
                    "tcpFastOpen": true
                }
            },
            "tag": "direct"
        },
        {
            "protocol": "blackhole",
            "tag": "block"
        }
    ]
}

客户端日志

服务端日志


Dec 29 17:37:14 miku-hk systemd[1]: Started xray.service - Xray Service.
Dec 29 17:37:14 miku-hk xray[771]: Xray 24.12.28 (Xray, Penetrates Everything.) 93f72db (go1.23.4 linux/amd64)
Dec 29 17:37:14 miku-hk xray[771]: A unified platform for anti-censorship.
Dec 29 17:37:14 miku-hk xray[771]: 2024/12/29 17:37:14 [Info] infra/conf/serial: Reading config: &{Name:/usr/local/etc/xray/config.json Format:json}
Dec 29 17:37:14 miku-hk xray[771]: Failed to start: main: failed to create server > core: not all dependencies are resolved.
Dec 29 17:37:14 miku-hk systemd[1]: xray.service: Main process exited, code=exited, status=23/n/a
Dec 29 17:37:14 miku-hk systemd[1]: xray.service: Failed with result 'exit-code'.
@RPRX
Copy link
Member

RPRX commented Dec 29, 2024

#4206 (comment)

话说同样配置 v24.12.18 也会报错吗

@sakullla
Copy link
Author

话说同样配置 v24.12.18 也会报错吗

Xray 24.12.18 (Xray, Penetrates Everything.) cab2fde (go1.23.4 linux/amd64) 这个版本启动没问题

@RPRX
Copy link
Member

RPRX commented Dec 29, 2024

#4206 (comment)

你试试把我说那两处 RequireFeatures 都改成 OptionalFeatures

@RPRX
Copy link
Member

RPRX commented Dec 29, 2024

#4206 (comment)

貌似是文档未记载的预期行为,你不用 API 增减出站的话要么一定走要么一定不会走 fallbackTag,所以它被用来赋予新的意义了

@sakullla
Copy link
Author

#4206 (comment)

貌似是文档未记载的预期行为,你不用 API 增减出站的话要么一定走要么一定不会走 fallbackTag,所以它被用来赋予新的意义了

配置observatory后启动正常

@RPRX
Copy link
Member

RPRX commented Dec 29, 2024

其实我是想把这两处改成 OptionalFeatures,和原来的行为一致,看 @yuhan6665 怎么想,正好我还有些想改的明天可以发个版

@Fangliding Fangliding added the bug Something isn't working label Dec 29, 2024
@yuhan6665
Copy link
Member

是的这是 feature 不是 bug
84eeb56 已经明确说了如果你想要 fallback 功能 也就是说在探测过可用的节点里面 random 或者 roundrobin 那么你必须定义一个 observatory

@yuhan6665
Copy link
Member

之前不报错是因为 injection 会漏掉 resolution 所以 fallback 实际上没起作用也不报错

@RPRX RPRX closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2024
@yuhan6665
Copy link
Member

XTLS/Xray-docs-next#627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants