Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Internal Server Error! #73

Closed
shylock-wu opened this issue Feb 27, 2024 · 8 comments
Closed

Internal Server Error! #73

shylock-wu opened this issue Feb 27, 2024 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@shylock-wu
Copy link

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

描述:这个页面是正常的

image

这个链接打开就500

image

@vvbbnn00
Copy link
Owner

提供一下日志

@shylock-wu
Copy link
Author

@vvbbnn00
Copy link
Owner

@vvbbnn00

app_background.log

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

@shylock-wu
Copy link
Author

web log是空的什么都没有

@vvbbnn00
Copy link
Owner

vvbbnn00 commented Feb 27, 2024

web log是空的什么都没有

看看控制台输出的日志

@shylock-wu
Copy link
Author

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
Copy link
Author

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

@vvbbnn00
Copy link
Owner

vvbbnn00 commented Feb 27, 2024

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

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

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

@vvbbnn00 vvbbnn00 added the help wanted Extra attention is needed label Feb 27, 2024
Repository owner locked and limited conversation to collaborators Mar 1, 2024
@vvbbnn00 vvbbnn00 converted this issue into discussion #121 Mar 1, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants