Skip to content

[Bug]python agent 一直处于暂停状态, 请求接口超时:  #122

@freedom-wy

Description

@freedom-wy

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.
  • I am not looking for support or already pursued the available support channels without success.

Version

最新版本

Installation Type

Official Docker Compose

Service Name

DongTai-OpenAPI, DongTai-agent-python

Describe the details of the bug and the steps to reproduce it

安装好agent后启动flask项目,python agent一直处于暂停状态,log显示请求接口超时

`

[2022-09-19 10:32:16,679] INFO [base_middleware] python agent init, version: 1.4.0
[2022-09-19 10:32:16,694] INFO [system_info] psutil import success
[2022-09-19 10:32:16,694] INFO [system_info] get network success
[2022-09-19 10:32:36,722] ERROR [openapi] report failed: HTTPConnectionPool(host='172.20.148.212', port=8002): Max retries exceeded with url: /openapi/api/v1/agent/register (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f4cfa817f28>, 'Connection to 172.20.148.212 timed out. (connect timeout=20)'))
Traceback (most recent call last):
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/connection.py", line 175, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 710, in urlopen
    chunked=chunked,
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 398, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/connection.py", line 239, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/lib64/python3.6/http/client.py", line 1254, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1300, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1249, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.6/http/client.py", line 1036, in _send_output
    self.send(msg)
  File "/usr/lib64/python3.6/http/client.py", line 974, in send
    self.connect()
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/connection.py", line 205, in connect
    conn = self._new_conn()
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/connection.py", line 182, in _new_conn
    % (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7f4cfa817f28>, 'Connection to 172.20.148.212 timed out. (connect timeout=20)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/testproject/venv/lib/python3.6/site-packages/requests/adapters.py", line 450, in send
    timeout=timeout
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 788, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/root/testproject/venv/lib/python3.6/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='172.20.148.212', port=8002): Max retries exceeded with url: /openapi/api/v1/agent/register (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f4cfa817f28>, 'Connection to 172.20.148.212 timed out. (connect timeout=20)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/testproject/venv/lib64/python3.6/site-packages/dongtai_agent_python/api/openapi.py", line 83, in report
    res = requests.post(api_url, data=body_data, timeout=20, headers=self.headers)
  File "/root/testproject/venv/lib/python3.6/site-packages/requests/api.py", line 117, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/root/testproject/venv/lib/python3.6/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/root/testproject/venv/lib/python3.6/site-packages/requests/sessions.py", line 529, in request
    resp = self.send(prep, **send_kwargs)
  File "/root/testproject/venv/lib/python3.6/site-packages/requests/sessions.py", line 645, in send
    r = adapter.send(request, **kwargs)
  File "/root/testproject/venv/lib/python3.6/site-packages/requests/adapters.py", line 507, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='172.20.148.212', port=8002): Max retries exceeded with url: /openapi/api/v1/agent/register (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f4cfa817f28>, 'Connection to 172.20.148.212 timed out. (connect timeout=20)'))

[2022-09-19 10:32:36,722] ERROR [base_middleware] python agent register error
[2022-09-19 10:32:37,595] INFO [openapi] startup time: 20876.171827316284ms report failed
[2022-09-19 10:32:37,596] INFO [base_middleware] python agent hook open

`

Additional Information

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions