zycn0910 / Sign-ZXJY

职校家园(实习备案)打卡-2024.9.1可用
GNU General Public License v3.0
47 stars 24 forks source link

【已解决】连接不上主机 #30

Open azmm1314 opened 12 months ago

azmm1314 commented 12 months ago

系统平台:win11

问题详细描述:不知道啥意思

终端报错输出: Traceback (most recent call last): File "E:\新建文件夹 (2)\lib\site-packages\urllib3\connection.py", line 203, in _new_conn sock = connection.create_connection( File "E:\新建文件夹 (2)\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection raise err File "E:\新建文件夹 (2)\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "E:\新建文件夹 (2)\lib\site-packages\urllib3\connectionpool.py", line 791, in urlopen response = self._make_request( File "E:\新建文件夹 (2)\lib\site-packages\urllib3\connectionpool.py", line 497, in _make_request conn.request( File "E:\新建文件夹 (2)\lib\site-packages\urllib3\connection.py", line 395, in request self.endheaders() File "E:\新建文件夹 (2)\lib\http\client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "E:\新建文件夹 (2)\lib\http\client.py", line 1010, in _send_output self.send(msg) File "E:\新建文件夹 (2)\lib\http\client.py", line 950, in send self.connect() File "E:\新建文件夹 (2)\lib\site-packages\urllib3\connection.py", line 243, in connect self.sock = self._new_conn() File "E:\新建文件夹 (2)\lib\site-packages\urllib3\connection.py", line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000021C2FF50040>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "E:\新建文件夹 (2)\lib\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( File "E:\新建文件夹 (2)\lib\site-packages\urllib3\connectionpool.py", line 845, in urlopen retries = retries.increment( File "E:\新建文件夹 (2)\lib\site-packages\urllib3\util\retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='sxbaapp.zcj.jyt.henan.gov.cn', port=80): Max retries exceeded with url: /api/getApitoken.ashx (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000021C2FF50040>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应 ,连接尝试失败。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "Main.py", line 53, in main(process.load_users_from_json("all-users.json")) File "Main.py", line 28, in main info = process.login_and_sign_in(user=user, endday=TDOA.days) File "D:\edg浏览器\Sign-ZXJY-master\process.py", line 304, in login_and_sign_in login_data = get_user_uid(user['deviceId'], user['phone'], user['password']) File "D:\edg浏览器\Sign-ZXJY-master\process.py", line 264, in get_user_uid login_token = get_Apitoken() File "D:\edg浏览器\Sign-ZXJY-master\process.py", line 97, in get_Apitoken response = requests.post(url, headers=headers) File "E:\新建文件夹 (2)\lib\site-packages\requests\api.py", line 115, in post return request("post", url, data=data, json=json, kwargs) File "E:\新建文件夹 (2)\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, kwargs) File "E:\新建文件夹 (2)\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "E:\新建文件夹 (2)\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, kwargs) File "E:\新建文件夹 (2)\lib\site-packages\requests\adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='sxbaapp.zcj.jyt.henan.gov.cn', port=80): Max retries exceeded with url: /api/getApitoken.ashx (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000021C2FF50040>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。')) 日志(config.py文件log_report改为True):

zycn0910 commented 12 months ago

关掉你的梯子…

azmm1314 commented 11 months ago

不对呀 今天刚开机 我还没打开过梯子 也是跟昨天一样

zycn0910 commented 11 months ago

把config.py里面log_report改为true,然后运行一次,看生成的log文件夹下的log文件

azmm1314 commented 11 months ago

Traceback (most recent call last): File "D:\python\Lib\site-packages\urllib3\connection.py", line 203, in _new_conn sock = connection.create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\urllib3\util\connection.py", line 85, in create_connection raise err File "D:\python\Lib\site-packages\urllib3\util\connection.py", line 73, in create_connection sock.connect(sa) TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\python\Lib\site-packages\urllib3\connectionpool.py", line 790, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\urllib3\connectionpool.py", line 496, in _make_request conn.request( File "D:\python\Lib\site-packages\urllib3\connection.py", line 395, in request self.endheaders() File "D:\python\Lib\http\client.py", line 1314, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "D:\python\Lib\http\client.py", line 1074, in _send_output self.send(msg) File "D:\python\Lib\http\client.py", line 1018, in send self.connect() File "D:\python\Lib\site-packages\urllib3\connection.py", line 243, in connect self.sock = self._new_conn() ^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\urllib3\connection.py", line 212, in _new_conn raise ConnectTimeoutError( urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x000002669ED00F20>, 'Connection to sxbaapp.zcj.jyt.henan.gov.cn timed out. (connect timeout=None)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\python\Lib\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\urllib3\connectionpool.py", line 844, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\urllib3\util\retry.py", line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='sxbaapp.zcj.jyt.henan.gov.cn', port=80): Max retries exceeded with url: /api/getApitoken.ashx (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x000002669ED00F20>, 'Connection to sxbaapp.zcj.jyt.henan.gov.cn timed out. (connect timeout=None)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\llq\2\main.py", line 51, in main(process.load_users_from_json("all-users.json")) File "D:\llq\2\main.py", line 26, in main info = process.login_and_sign_in(user=user, endday=TDOA.days) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\llq\2\process.py", line 309, in login_and_sign_in login_data = get_user_uid(user['deviceId'], user['phone'], user['password']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\llq\2\process.py", line 269, in get_user_uid login_token = get_Apitoken() ^^^^^^^^^^^^^^ File "D:\llq\2\process.py", line 102, in get_Apitoken response = requests.post(url, headers=headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\requests\api.py", line 115, in post return request("post", url, data=data, json=json, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\requests\adapters.py", line 507, in send raise ConnectTimeout(e, request=request) requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='sxbaapp.zcj.jyt.henan.gov.cn', port=80): Max retries exceeded with url: /api/getApitoken.ashx (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x000002669ED00F20>, 'Connection to sxbaapp.zcj.jyt.henan.gov.cn timed out. (connect timeout=None)'))

azmm1314 commented 11 months ago

log文件内容是这个2023-12-11 20:24:19 - root - INFO - 检测到用户数据文件,已加载! - process.py - load_users_from_json - 119 2023-12-11 20:24:19 - root - INFO - 2 - process.py - random_Time - 93 2023-12-11 20:24:21 - root - INFO - 小江 随机 2 s - main.py - main - 22 2023-12-11 20:24:21 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): sxbaapp.zcj.jyt.henan.gov.cn:80 - connectionpool.py - _new_conn - 244

azmm1314 commented 11 months ago

还是不行

zycn0910 commented 11 months ago

你早上7点-10点,下午5-7点运行,现在git最新版运行试试

azmm1314 commented 11 months ago

我试一下谢谢啦> 你早上7点-10点,下午5-7点运行,现在git最新版运行试试

zycn0910 commented 11 months ago

哥们,你最好在6-19点之间运行脚本

azmm1314 commented 11 months ago

好的 谢谢啦确实是这样