Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redfish credentials should be prompted from user #47

Open
dashmage opened this issue Aug 1, 2023 · 0 comments
Open

Redfish credentials should be prompted from user #47

dashmage opened this issue Aug 1, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dashmage
Copy link
Contributor

dashmage commented Aug 1, 2023

By default, redfish credentials are configured as empty strings. In this case, if redfish compatible hardware is detected, we should prompt the user to enter the credentials instead of it failing silently with logs only in journalctl and no logs in juju debug-log. The charm unit still stays in active status and the systemd hardware-exporter service is also active even though there's this redfish authorization error.

journalctl -u hardware-exporter.service -n 100 -f

Aug 01 09:35:58 kongfu python3[832352]: 2023-08-01 09:35:58 INFO Started promethesus hardware exporter at 0.0.0.0:10000.
(...)
Aug 01 09:36:30 kongfu python3[832352]: 2023-08-01 09:36:30 INFO Attempt 1 of /redfish/v1/
Aug 01 09:36:30 kongfu python3[832352]: 2023-08-01 09:36:30 INFO Response Time for GET to /redfish/v1/: 0.37731877801707014 seconds.
Aug 01 09:36:30 kongfu python3[832352]: 2023-08-01 09:36:30 INFO Attempt 1 of /redfish/v1/SessionService/Sessions/
Aug 01 09:36:30 kongfu python3[832352]: 2023-08-01 09:36:30 INFO Response Time for POST to /redfish/v1/SessionService/Sessions/: 0.04424629302229732 seconds.
Aug 01 09:36:30 kongfu python3[832352]: 2023-08-01 09:36:30 INFO Login returned code 400: {
"error":{"code":"iLO.0.10.ExtendedInfo","message":"See @Message.ExtendedInfo for more information.","@Message.ExtendedInfo":[{"MessageId":"iLO.2.14.UnauthorizedLoginAttempt"}]}}
Aug 01 09:36:30 kongfu python3[832352]: 2023-08-01 09:36:30 ERROR HTTP 400: Failed to created the session
Aug 01 09:36:30 kongfu python3[832352]: See @Message.ExtendedInfo for more information.
Aug 01 09:36:30 kongfu python3[832352]: Traceback (most recent call last):
Aug 01 09:36:30 kongfu python3[832352]:   File "/var/lib/juju/agents/unit-hardware-observer-30/charm/venv/prometheus_hardware_exporter/collectors/redfish.py", line 49, in _get_sensor_data
Aug 01 09:36:30 kongfu python3[832352]:     redfish_obj.login(auth="session")
Aug 01 09:36:30 kongfu python3[832352]:   File "/var/lib/juju/agents/unit-hardware-observer-30/charm/venv/redfish/rest/v1.py", line 978, in login
Aug 01 09:36:30 kongfu python3[832352]:     raise SessionCreationError('HTTP {}: Failed to created the session\n{}'.format(resp.status, error_str))
Aug 01 09:36:30 kongfu python3[832352]: redfish.rest.v1.SessionCreationError: HTTP 400: Failed to created the session
Aug 01 09:36:30 kongfu python3[832352]: See @Message.ExtendedInfo for more information.
Aug 01 09:36:30 kongfu python3[832352]: 2023-08-01 09:36:30 ERROR Failed to get sensor data via redfish.

Related point: If the wrong credentials are provided, it should also be mentioned in the debug logs.

@Pjack Pjack added enhancement New feature or request good first issue Good for newcomers labels Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants