Breina / idrac_power_monitor

HomeAssistant integration to monitor the power of a server through its iDrac's Redfish API
17 stars 17 forks source link

Error Occur when adding the data #3

Closed Kathou99 closed 1 year ago

Kathou99 commented 1 year ago

Hi thank for this amazing script, but I have an issue when I try to add my servers.

The redfish on Idract is turned on

I am able to add the device but the script failed to get the data.

Thank :)

Logs

2023-06-05 15:15:05.298 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PowerEdge R530 for idrac_power
File "/config/custom_components/idrac_power_monitor/__init__.py", line 18, in async_setup_entry
2023-06-05 15:15:05.303 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing idrac_power/diagnostics.py
ModuleNotFoundError: No module named 'custom_components.idrac_power_monitor.diagnostics'
2023-06-05 15:15:05.305 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing idrac_power/recorder.py
ModuleNotFoundError: No module named 'custom_components.idrac_power_monitor.recorder'
2023-06-05 15:15:05.306 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing idrac_power/logbook.py
ModuleNotFoundError: No module named 'custom_components.idrac_power_monitor.logbook'
2023-06-05 15:15:05.307 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing idrac_power/media_source.py
ModuleNotFoundError: No module named 'custom_components.idrac_power_monitor.media_source'
2023-06-05 15:15:05.308 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing idrac_power/system_health.py
ModuleNotFoundError: No module named 'custom_components.idrac_power_monitor.system_health'
2023-06-05 15:15:05.309 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing idrac_power/significant_change.py
ModuleNotFoundError: No module named 'custom_components.idrac_power_monitor.significant_change'
2023-06-05 15:25:49.089 ERROR (MainThread) [custom_components.idrac_power_monitor.config_flow] Unexpected exception
File "/config/custom_components/idrac_power_monitor/config_flow.py", line 48, in async_step_user
File "/config/custom_components/idrac_power_monitor/config_flow.py", line 73, in validate_input
File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 42, in get_device_info
File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 61, in get_path
2023-06-05 15:26:08.574 ERROR (MainThread) [custom_components.idrac_power_monitor.config_flow] Unexpected exception
File "/config/custom_components/idrac_power_monitor/config_flow.py", line 48, in async_step_user
File "/config/custom_components/idrac_power_monitor/config_flow.py", line 73, in validate_input
File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 42, in get_device_info
File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 61, in get_path
2023-06-05 15:26:18.599 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PowerEdge R530 for idrac_power
File "/config/custom_components/idrac_power_monitor/__init__.py", line 18, in async_setup_entry
2023-06-05 15:26:29.703 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PowerEdge R530 for idrac_power
File "/config/custom_components/idrac_power_monitor/__init__.py", line 18, in async_setup_entry
2023-06-05 15:31:49.074 ERROR (MainThread) [custom_components.idrac_power_monitor.config_flow] Unexpected exception
File "/config/custom_components/idrac_power_monitor/config_flow.py", line 48, in async_step_user
File "/config/custom_components/idrac_power_monitor/config_flow.py", line 73, in validate_input
File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 42, in get_device_info
File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 61, in get_path
2023-06-05 15:32:14.074 ERROR (MainThread) [custom_components.idrac_power_monitor.config_flow] Unexpected exception
File "/config/custom_components/idrac_power_monitor/config_flow.py", line 48, in async_step_user
File "/config/custom_components/idrac_power_monitor/config_flow.py", line 73, in validate_input
File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 42, in get_device_info
File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 61, in get_path
2023-06-05 15:32:50.230 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PowerEdge R740xd for idrac_power
File "/config/custom_components/idrac_power_monitor/__init__.py", line 18, in async_setup_entry

Other logs

Logger: custom_components.idrac_power_monitor.config_flow
Source: custom_components/idrac_power_monitor/idrac_rest.py:61
Integration: idrac_power_monitor
First occurred: 15:25:49 (4 occurrences)
Last logged: 15:32:14

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect
    self.sock = conn = self._new_conn()
  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fb169faf2e0>: Failed to establish a new connection: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='http', port=443): Max retries exceeded with url: //192.168.1.51/redfish/v1/Chassis/System.Embedded.1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fb169faf2e0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/idrac_power_monitor/config_flow.py", line 48, in async_step_user
    info = await self.validate_input(user_input)
  File "/config/custom_components/idrac_power_monitor/config_flow.py", line 73, in validate_input
    device_info = await hass.async_add_executor_job(self.hass, target=rest_client.get_device_info)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 42, in get_device_info
    result = self.get_path(drac_chassis_path)
  File "/config/custom_components/idrac_power_monitor/idrac_rest.py", line 61, in get_path
    return requests.get(protocol + self.host + path, auth=self.auth, verify=False)
  File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 565, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='http', port=443): Max retries exceeded with url: //192.168.1.51/redfish/v1/Chassis/System.Embedded.1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fb169faf2e0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))
Breina commented 1 year ago

Sorry for the errors being rough. This was my first integration when learning python alongside it.

Please just use the domain without protocol (e.g. no https://).

As such: 192.168.1.20 or myhomelab.breina.be.

Kathou99 commented 1 year ago

No problem you will learn from this, yes it was enter with only the ip no protocol but I see in the error, the sccript try to connect to http with the port=443 so that is may be my issue

Kathou99 commented 1 year ago

I have reinstall and now I am able to make it and I have start to push the pluging further like getting the fan RPM/Network info and to have an option with redfish with supermicro server.

Breina commented 1 year ago

Yeah, there's indeed much data to be gathered. Might add some in the future.On 6 Jun 2023 21:16, "KathouQC(GirlsPowers)" @.***> wrote: Closed #3 as completed.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>