Anankke / SSPanel-UIM

Multi-purpose proxy service management system
MIT License
9.42k stars 3.4k forks source link

[BUG]v2ray节点path下发错误&节点流量上报500错误 #1497

Closed zhyi828 closed 2 years ago

zhyi828 commented 2 years ago

请将 [ ] 替换为 [x] 。Please relpace [ ] with [x] .

Environment 环境 Your OS info, PHP/MySQL version and so on... 你的操作系统信息、PHP/MySQL 版本、以及其它所有可能相关的信息。 Ubuntu 22.04 LTS Nginx 1.21.6 PHP Version 8.1.7 MySQL 5.7.37

Commit The commit you on. 你当前的 SSPanel UIM 位于哪条 commit。 fd5ee5b171a62252c9b58426575087d78638f8a1

Bug The bug information. 请描述你遇到的 Bug。

  1. v2ray节点在地址中配置path,成功下发到节点后端,但订阅下发时path为“/”
  2. XrayR后端调用/mod_mu/users/traffic时返回500错误
  3. 查看v2ray的节点信息后报错,同https://github.com/Anankke/SSPanel-Uim/issues/1485

Reproduce Steps to reproduce the bug. 请逐步描述如何复现 Bug。

问题一:

  1. 添加v2ray节点,并在节点地址中写特定的path image
  2. 后端可以正常获取到path的下发
  3. 订阅下发时 path就变成了“/” origin_img_v2_3926db4b-2aa6-487f-a542-aa178674d88g

问题二:

  1. 后端上报流量时sspanel返回500错误,且用户使用流量没有变化,如下:
    xrayr-release-xrayr-1  | 2022/06/24 14:05:41 request https://panel.my-domain.com/mod_mu/users/traffic failed: <!DOCTYPE HTML>
    xrayr-release-xrayr-1  | <html lang="en">
    xrayr-release-xrayr-1  | <head>
    xrayr-release-xrayr-1  |     <meta charset="UTF-8">
    xrayr-release-xrayr-1  |     <title>Internal Server Error - SSPanel</title>
    xrayr-release-xrayr-1  |     <link rel="shortcut icon" href="/favicon.ico"/>
    xrayr-release-xrayr-1  |     <link rel="bookmark" href="/favicon.ico" type="image/x-icon"/>
    xrayr-release-xrayr-1  |     <link rel="stylesheet" href="/assets/css/error-pages.min.css"/>
    xrayr-release-xrayr-1  | </head>
    xrayr-release-xrayr-1  | <body>
    xrayr-release-xrayr-1  | <div class="container">
    xrayr-release-xrayr-1  |     <div class="copy-container center-xy">
    xrayr-release-xrayr-1  |         <p>
    xrayr-release-xrayr-1  |             500, Internal Server Error.
    xrayr-release-xrayr-1  |         </p>
    xrayr-release-xrayr-1  |     </div>
    xrayr-release-xrayr-1  | </div>
    xrayr-release-xrayr-1  |
    xrayr-release-xrayr-1  |
    xrayr-release-xrayr-1  | </body>
    xrayr-release-xrayr-1  | </html>
    xrayr-release-xrayr-1  | , %!s(<nil>)
  2. 打开sspanel的debug开关后,接口返回堆栈如下:
    
    RuntimeException thrown with message "A facade root has not been set."

Stacktrace:

21 RuntimeException in /www/wwwroot/panel.my-domain.com/vendor/illuminate/support/Facades/Facade.php:334

20 Illuminate\Support\Facades\Facade:__callStatic in /www/wwwroot/panel.my-domain.com/src/Controllers/Node/UserController.php:170

19 App\Controllers\Node\UserController:addTraffic in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php:41

18 call_user_func in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php:41

17 Slim\Handlers\Strategies\RequestResponse:__invoke in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/Route.php:344

16 Slim\Route:__invoke in /www/wwwroot/panel.my-domain.com/src/Middleware/NodeToken.php:63

15 App\Middleware\NodeToken:__invoke in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/DeferredCallable.php:43

14 call_user_func_array in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/DeferredCallable.php:43

13 Slim\DeferredCallable:__invoke in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/MiddlewareAwareTrait.php:67

12 call_user_func in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/MiddlewareAwareTrait.php:67

11 Slim\Route:Slim{closure} in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/MiddlewareAwareTrait.php:116

10 Slim\Route:callMiddlewareStack in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/Route.php:316

9 Slim\Route:run in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/App.php:438

8 Slim\App:__invoke in /www/wwwroot/panel.my-domain.com/vendor/zeuxisoo/slim-whoops/src/Zeuxisoo/Whoops/Provider/Slim/WhoopsMiddleware.php:70

7 Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware:__invoke in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/DeferredCallable.php:43

6 call_user_func_array in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/DeferredCallable.php:43

5 Slim\DeferredCallable:__invoke in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/MiddlewareAwareTrait.php:67

4 call_user_func in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/MiddlewareAwareTrait.php:67

3 Slim\App:Slim{closure} in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/MiddlewareAwareTrait.php:116

2 Slim\App:callMiddlewareStack in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/App.php:332

1 Slim\App:process in /www/wwwroot/panel.my-domain.com/vendor/slim/slim/Slim/App.php:293

0 Slim\App:run in /www/wwwroot/panel.my-domain.com/public/index.php:41


![image](https://user-images.githubusercontent.com/10600254/175805540-aa23f98b-578a-4e7f-bec4-74e80ab290d1.png)

#### 问题三:
同 https://github.com/Anankke/SSPanel-Uim/issues/1485

**Expected behavior**
What you expected to happen. 请描述你预期的行为。
1. 问题一:订阅下发的path与节点配置和下发到节点的配置一致
2. 问题二:流量可正常上报
3. 问题三:查看v2ray的节点信息时不报错

**Logs**
If applicable, add your PHP logs here. 如果需要,请在这里粘贴 PHP Log。
PHP log中没有发现什么有价值的信息。

**Addition**
Additional context here. 如有可能,请提供更多相关资料。
vagur1689 commented 2 years ago

@zhyi828 一样的问题,你解决了吗?

zhyi828 commented 2 years ago

@zhyi828 一样的问题,你解决了吗?

还木有 大佬们好像还没看到这个issue😂

iamsaltedfish commented 2 years ago

需要提供这些信息: 1)地址栏填写的内容 2)json编辑器中填写的内容

zhyi828 commented 2 years ago

需要提供这些信息: 1)地址栏填写的内容 2)json编辑器中填写的内容

@iamsaltedfish 以下是补充信息,辛苦大佬帮忙看看 1)地址栏(域名已脱敏),自定义了一个8080端口,443端口给trojan了,之前同样的配置用new-feat分支尝试部署的时候木有问题:example.domain.com;8080;0;ws;tls;path=/blog|server=example.domain.com|host=example.domain.com 2)json编辑器中是保持默认的:

image
AllCheeks commented 2 years ago

我也是这个问题......

ghost commented 2 years ago

For the second issue, commie a3ef2490d80409658760d4fc78fdca42a46c431b would solve this.

iamsaltedfish commented 2 years ago

修了500问题 https://github.com/Anankke/SSPanel-Uim/pull/1510/files

zhyi828 commented 2 years ago

Fixed Q1 in https://github.com/Anankke/SSPanel-Uim/pull/1521