vvbbnn00 / WARP-Clash-API

该项目可以让你通过订阅的方式使用Cloudflare WARP+,自动获取流量。This project enables you to use Cloudflare WARP+ through subscription, automatically acquiring traffic.
GNU General Public License v3.0
8.45k stars 1.16k forks source link

Internal Server Error! #73

Closed shylock-wu closed 7 months ago

shylock-wu commented 7 months ago

问题:本地docker-compose运行的时候打开链接报错

描述:这个页面是正常的

image

这个链接打开就500

image

vvbbnn00 commented 7 months ago

提供一下日志

shylock-wu commented 7 months ago

@vvbbnn00 app_background.log

vvbbnn00 commented 7 months ago

@vvbbnn00

app_background.log

这个是定时任务的日志 需要web的

shylock-wu commented 7 months ago

web log是空的什么都没有

vvbbnn00 commented 7 months ago

web log是空的什么都没有

看看控制台输出的日志

shylock-wu commented 7 months ago
2024-02-27 13:39:43 /usr/local/lib/python3.11/site-packages/tzlocal/unix.py:193: UserWarning: Can not find any timezone configuration, defaulting to UTC.
2024-02-27 13:39:43   warnings.warn("Can not find any timezone configuration, defaulting to UTC.")
2024-02-27 13:39:43 2024-02-27 05:39:43,497 - INFO - Start scheduler.
2024-02-27 13:39:43 2024-02-27 05:39:43,498 - INFO - DO_GET_WARP_DATA is True, will fetch WARP data per 18 seconds.
2024-02-27 13:39:43 2024-02-27 05:39:43,499 - INFO - Start save account job, will update account info per 120 seconds.
2024-02-27 13:39:43 [2024-02-27 05:39:43 +0000] [8] [INFO] Starting gunicorn 21.2.0
2024-02-27 13:39:43 [2024-02-27 05:39:43 +0000] [8] [INFO] Listening at: http://0.0.0.0:3000 (8)
2024-02-27 13:39:43 [2024-02-27 05:39:43 +0000] [8] [INFO] Using worker: sync
2024-02-27 13:39:43 [2024-02-27 05:39:43 +0000] [10] [INFO] Booting worker with pid: 10
2024-02-27 13:39:43 [2024-02-27 05:39:43 +0000] [11] [INFO] Booting worker with pid: 11
2024-02-27 13:39:43 [2024-02-27 05:39:43 +0000] [12] [INFO] Booting worker with pid: 12
2024-02-27 13:39:43 [2024-02-27 05:39:43 +0000] [13] [INFO] Booting worker with pid: 13
2024-02-27 13:39:57 2024-02-27 05:39:57,598 - INFO - Get current account
2024-02-27 13:39:57 2024-02-27 05:39:57,601 - INFO - Reload entrypoints from ./config/result.csv
2024-02-27 13:39:57 2024-02-27 05:39:57,604 - ERROR - Exception on /api/wireguard [GET]
2024-02-27 13:39:57 Traceback (most recent call last):
2024-02-27 13:39:57   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1463, in wsgi_app
2024-02-27 13:39:57     response = self.full_dispatch_request()
2024-02-27 13:39:57                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:39:57   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 872, in full_dispatch_request
2024-02-27 13:39:57     rv = self.handle_user_exception(e)
2024-02-27 13:39:57          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:39:57   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 870, in full_dispatch_request
2024-02-27 13:39:57     rv = self.dispatch_request()
2024-02-27 13:39:57          ^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:39:57   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 855, in dispatch_request
2024-02-27 13:39:57     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
2024-02-27 13:39:57            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:39:57   File "/app/services/web_service.py", line 72, in decoratedFunction
2024-02-27 13:39:57     return f(*args, **kwargs)
2024-02-27 13:39:57            ^^^^^^^^^^^^^^^^^^
2024-02-27 13:39:57   File "/app/services/web_service.py", line 32, in decoratedFunction
2024-02-27 13:39:57     return f(*args, **kwargs)
2024-02-27 13:39:57            ^^^^^^^^^^^^^^^^^^
2024-02-27 13:39:57   File "/app/services/web_service.py", line 182, in httpSubscription
2024-02-27 13:39:57     fileData = generateWireguardSubFile(account, logger, best=best)
2024-02-27 13:39:57                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:39:57   File "/app/services/subscription.py", line 103, in generateWireguardSubFile
2024-02-27 13:39:57     random_point = random.choice(entrypoints) if not best else getBestEntrypoints(1)[0]
2024-02-27 13:39:57                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:39:57   File "/usr/local/lib/python3.11/random.py", line 373, in choice
2024-02-27 13:39:57     raise IndexError('Cannot choose from an empty sequence')
2024-02-27 13:39:57 IndexError: Cannot choose from an empty sequence
2024-02-27 13:40:01 2024-02-27 05:40:01,503 - INFO - Get current account
2024-02-27 13:40:01 2024-02-27 05:40:01,513 - INFO - WORK ON ID: ef8b7ba2-70fb-4fa1-9b08-f7b72aa1c3ff
2024-02-27 13:40:02 2024-02-27 05:40:02,092 - INFO - Get current account
2024-02-27 13:40:02 2024-02-27 05:40:02,093 - INFO - Reload entrypoints from ./config/result.csv
2024-02-27 13:40:02 2024-02-27 05:40:02,095 - ERROR - Exception on /api/shadowrocket [GET]
2024-02-27 13:40:02 Traceback (most recent call last):
2024-02-27 13:40:02   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1463, in wsgi_app
2024-02-27 13:40:02     response = self.full_dispatch_request()
2024-02-27 13:40:02                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:40:02   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 872, in full_dispatch_request
2024-02-27 13:40:02     rv = self.handle_user_exception(e)
2024-02-27 13:40:02          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:40:02   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 870, in full_dispatch_request
2024-02-27 13:40:02     rv = self.dispatch_request()
2024-02-27 13:40:02          ^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:40:02   File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 855, in dispatch_request
2024-02-27 13:40:02     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
2024-02-27 13:40:02            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:40:02   File "/app/services/web_service.py", line 72, in decoratedFunction
2024-02-27 13:40:02     return f(*args, **kwargs)
2024-02-27 13:40:02            ^^^^^^^^^^^^^^^^^^
2024-02-27 13:40:02   File "/app/services/web_service.py", line 32, in decoratedFunction
2024-02-27 13:40:02     return f(*args, **kwargs)
2024-02-27 13:40:02            ^^^^^^^^^^^^^^^^^^
2024-02-27 13:40:02   File "/app/services/web_service.py", line 200, in httpSubscription
2024-02-27 13:40:02     fileData = generateShadowRocketSubFile(account, logger, best=best, random_name=random_name)
2024-02-27 13:40:02                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:40:02   File "/app/services/subscription.py", line 217, in generateShadowRocketSubFile
2024-02-27 13:40:02     random_points = random.sample(entrypoints, RANDOM_COUNT) if not best else getBestEntrypoints(RANDOM_COUNT)
2024-02-27 13:40:02                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-27 13:40:02   File "/usr/local/lib/python3.11/random.py", line 456, in sample
2024-02-27 13:40:02     raise ValueError("Sample larger than population or is negative")
2024-02-27 13:40:02 ValueError: Sample larger than population or is negative
shylock-wu commented 7 months ago

忘了说 在此之前 我运行过一句命令 docker-compose exec warp-clash python3 app.py optimize 我不知道这是否有影响。从而导致后面我重启docker-compose也不管用,一直是500

vvbbnn00 commented 7 months ago

忘了说 在此之前 我运行过一句命令 docker-compose exec warp-clash python3 app.py optimize 我不知道这是否有影响。从而导致后面我重启docker-compose也不管用,一直是500

大概是ip优选后没有可用的节点导致的问题 可以检查一下/config/result.csv中 是不是所有节点的loss都100或者延迟超时了

修复方法可以是再优选一下ip 或者将项目里面的result.csv 还原成远程仓库的