Asterisk4Magisk / Xray4Magisk

Xray core with service scripts for Android
378 stars 44 forks source link

xray not loading because of proxy.json configuration #104

Closed schmidt9 closed 3 weeks ago

schmidt9 commented 3 weeks ago

When trying to start xray using xrayhelper service start I get errors in console

2024-10-09 15:35:23 DEBUG : {CoreType:xray CorePath:/data/adb/xray/bin/xray CoreConfig:/data/adb/xray/confs/ DataDir:/data/adb/xray/data/ RunDir:/data/adb/xray/run/ CPULimit:100 MemLimit:-1 ProxyTag:proxy AllowInsecure:false SubList:[https://example.com/v2rayNg clash+https://example.com/mihomo] UserAgent:ClashMeta}
2024-10-09 15:35:23 DEBUG : {DNSPort:65533 Template:/data/adb/xray/mihomoconfs/template.yaml}
2024-10-09 15:35:23 DEBUG : {Enable:false Address:127.0.0.1:65530 WorkDir:/data/adb/xray/adghomeconfs/ DNSPort:65531}
2024-10-09 15:35:23 DEBUG : {Method:tproxy TproxyPort:65535 SocksPort:65534 TunDevice:xtun EnableIPv6:false AutoDNSStrategy:true Mode:blacklist PkgList:[com.tencent.* com.baidu.* com.netease.* com.taobao.* com.bilibili.* cn.* *china*] ApList:[wlan+ rndis+] IgnoreList:[] IntraList:[]}
2024-10-09 15:35:23 INFO : service: current core type is xray
2024-10-09 15:35:23 INFO : service: starting core
2024-10-09 15:35:23 DEBUG : stat /data/adb/xray/run/core.pid: no such file or directory
2024-10-09 15:35:23 DEBUG : [service] cannot find dns object from provided conf
2024-10-09 15:35:23 DEBUG : [service] cannot find dns object from provided conf
2024-10-09 15:35:23 DEBUG : [service] cannot find dns object from provided conf
2024-10-09 15:35:23 DEBUG : [service] cannot find dns object from provided conf
2024-10-09 15:35:24 DEBUG : ignore signal child exited since core starting
2024-10-09 15:35:38 DEBUG : stat /data/adb/xray/run/core.pid: no such file or directory
2024-10-09 15:35:38 DEBUG : stat /data/adb/xray/run/adghome.pid: no such file or directory
2024-10-09 15:35:38 ERROR : [service] core service not listen, please check error.log
/data/adb/xray # cat run/error.log 
Xray 24.9.30 (Xray, Penetrates Everything.) Custom (go1.23.2 android/arm)
A unified platform for anti-censorship.
2024/10/09 12:35:23 Using confdir from arg: /data/adb/xray/confs/
2024/10/09 12:35:23 [Info] infra/conf/serial: Reading config: &{Name:/data/adb/xray/confs/base.json Format:json}
2024/10/09 12:35:23 [Info] infra/conf/serial: Reading config: &{Name:/data/adb/xray/confs/dns.json Format:json}
2024/10/09 12:35:23 [Info] infra/conf/serial: Reading config: &{Name:/data/adb/xray/confs/policy.json Format:json}
2024/10/09 12:35:23 [Info] infra/conf/serial: Reading config: &{Name:/data/adb/xray/confs/proxy.json Format:json}
2024/10/09 12:35:23 [Info] infra/conf: [/data/adb/xray/confs/proxy.json] prepend outbound with tag: dns-out
2024/10/09 12:35:23 [Info] infra/conf: [/data/adb/xray/confs/proxy.json] prepend outbound with tag: direct
2024/10/09 12:35:23 [Info] infra/conf: [/data/adb/xray/confs/proxy.json] prepend outbound with tag: block
2024/10/09 12:35:23 [Info] infra/conf: [/data/adb/xray/confs/proxy.json] prepend outbound with tag: proxy
2024/10/09 12:35:23 [Info] infra/conf/serial: Reading config: &{Name:/data/adb/xray/confs/routing.json Format:json}
Failed to start: main: failed to load config files: [/data/adb/xray/confs/base.json /data/adb/xray/confs/dns.json /data/adb/xray/confs/policy.json /data/adb/xray/confs/proxy.json /data/adb/xray/confs/routing.json] > infra/conf: failed to parse to outbound detour config. > infra/conf: unknown config id:

This error seems to be caused by this lines in proxy.json because of missing "protocol" key (as I suppose):

        {
            "tag": "proxy"
        }

If I delete this lines and according references to "proxy" in other configs, xray is able to start successfully

schmidt9 commented 3 weeks ago

Sorry what do you mean under "not planned"? What exactly is not planned here?

whalechoi commented 3 weeks ago

default config in module just configuare inbound and some route, you need at least replace this proxy outbound with your proxy server to use it normally

schmidt9 commented 3 weeks ago

Well as I suppose at least this default config should be valid (xray should be able to start using it), but it cannot start because this config seems to be malformed (because of "unknown config id"/required protocol key not found)

whalechoi commented 3 weeks ago

put your proxy server share url in data/custom.txt(export from v2rayNg) then use command xrayhelper switch custom, you can replace this outbound correctly with default xrayhelper config

schmidt9 commented 3 weeks ago

ok thank you for assistance!