TyrantLucifer / ssr-command-client

:airplane:The commend client of ssr based Python3
Apache License 2.0
975 stars 239 forks source link

设置开机启动后 sudo systemctl start ssr 报错 #11

Closed Fire-Knight closed 4 years ago

Fire-Knight commented 4 years ago

开机后只有使用 python3 main.py -S再执行 python3 main.py -s才能连接代理 image

gyup commented 4 years ago

运行python main.py -l 报错: (ssr) gyup@gyup-XPS-8930:~/ssr-commend-client$ python main.py -l Being parsed the ssr url: https://raw.githubusercontent.com/satrom/V2SSR/master/SSR/Day.txt It will take a moment,Please be patient~~ Traceback (most recent call last): File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/connection.py", line 160, in _new_conn (self._dns_host, self.port), self.timeout, **extra_kw File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/util/connection.py", line 84, in create_connection raise err File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/util/connection.py", line 74, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen chunked=chunked, File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 381, in _make_request self._validate_conn(conn) File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn conn.connect() File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/connection.py", line 309, in connect conn = self._new_conn() File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/connection.py", line 172, in _new_conn self, "Failed to establish a new connection: %s" % e urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f6d01cdb048>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/connectionpool.py", line 727, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/urllib3/util/retry.py", line 439, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /satrom/V2SSR/master/SSR/Day.txt (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f6d01cdb048>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 80, in main() File "main.py", line 36, in main show_ssr_list() File "/home/gyup/ssr-commend-client/funtions.py", line 83, in show_ssr_list ssr_info_dict_list = update_ssr_list_info() File "/home/gyup/ssr-commend-client/funtions.py", line 69, in update_ssr_list_info ssr_url_list += get_ssr_list(url) File "/home/gyup/ssr-commend-client/utils.py", line 81, in get_ssr_list result = requests.get(url, headers = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3742.400 QQBrowser/10.5.3864.400'}) File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/requests/api.py", line 76, in get return request('get', url, params=params, kwargs) File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, send_kwargs) File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, kwargs) File "/home/gyup/anaconda3/envs/ssr/lib/python3.6/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /satrom/V2SSR/master/SSR/Day.txt (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f6d01cdb048>: Failed to establish a new connection: [Errno 111] Connection refused',))

gyup commented 4 years ago

希望能得到答复,谢谢~

TyrantLucifer commented 4 years ago

出现这个报错是因为你没有修改默认的订阅链接,请使用Python main.py --setting url 重置订阅链接。

TyrantLucifer commented 4 years ago

设置开机启动会默认按照你当前用户的python环境启动,然而你的python第三方包装在了虚拟环境中,所以启动服务报错。 @William-WZL