Skip to content

robot not generate log.html and report.html when exception raised by python lib #5278

@allenyllee

Description

@allenyllee

During running test case, when test case failed with exception error raising by the python lib, the robot seems terminated by itself.

Here is the partial error message shown in console log:

[ ERROR ] Initializing library 'Redfish' with arguments [ https://10.1.50.248:443 | root | 0penBmc ] failed: RetriesExhaustedError
Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/util/connection.py", line 95, in create_connection
    raise err
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection
    sock.connect(sa)
OSError: [Errno 113] No route to host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
                       ^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/connection.py", line 363, in connect
    self.sock = conn = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x708e8914be10>: Failed to establish a new connection: [Errno 113] No route to host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.11/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='10.1.50.248', port=443): Max retries exceeded with url: /redfish/v1/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x708e8914be10>: Failed to establish a new connection: [Errno 113] No route to host'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.11/site-packages/redfish/rest/v1.py", line 915, in _rest_request
    resp = self._session.request(method.upper(), "{}{}".format(self.__base_url, reqpath), data=body,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='10.1.50.248', port=443): Max retries exceeded with url: /redfish/v1/ (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x708e8914be10>: Failed to establish a new connection: [Errno 113] No route to host'))

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

Traceback (most recent call last):
  File "/workspace/lib/bmc_redfish.py", line 50, in __init__
    super(bmc_redfish, self).__init__(*args, **kwargs)
  File "/home/vscode/.local/lib/python3.11/site-packages/redfish/rest/v1.py", line 1080, in __init__
    super(HttpClient, self).__init__(base_url, username=username,
  File "/home/vscode/.local/lib/python3.11/site-packages/redfish/rest/v1.py", line 505, in __init__
    self.get_root_object()
  File "/home/vscode/.local/lib/python3.11/site-packages/redfish/rest/v1.py", line 597, in get_root_object
    raise excp
  File "/home/vscode/.local/lib/python3.11/site-packages/redfish/rest/v1.py", line 595, in get_root_object
    resp = self.get(self.default_prefix)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/lib/redfish_plus.py", line 133, in get
    return self.rest_request(super(redfish_plus, self).get, *args,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspace/lib/redfish_plus.py", line 123, in rest_request
    response = func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/redfish/rest/v1.py", line 633, in get
    return self._rest_request(path, method='GET', args=args,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/redfish/rest/v1.py", line 1118, in _rest_request
    return super(HttpClient, self)._rest_request(path=path, method=method,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vscode/.local/lib/python3.11/site-packages/redfish/rest/v1.py", line 959, in _rest_request
    raise RetriesExhaustedError() from cause_exception
redfish.rest.v1.RetriesExhaustedError

Try --help for usage information.

This error indicate that the redfish python lib encounter some network issue, it retries many times and raise exception.

I also try to regenerate report.html by execute rebot output.xml, but it says:

[ ERROR ] Reading XML source 'output.xml' failed: Incompatible child element 'errors' for 'suite'.

Try --help for usage information.

Here is the output.xml:
output (複製).zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions