DMTF / Redfish-Tacklebox

Python based utilities for performing common management operations with Redfish
Other
51 stars 25 forks source link

rf_sensor_list.py is failing with different errors #165

Open gumpana opened 3 months ago

gumpana commented 3 months ago

└─# rf_sensor_list.py --user --password --rhost https:// Traceback (most recent call last): File "/usr/local/bin/rf_sensor_list.py", line 17, in import redfish ImportError: No module named redfish

$ rf_sensor_list.py --user --password --rhost https:// 'Id' Traceback (most recent call last): File "/usr/local/bin/rf_sensor_list.py", line 51, in redfish_obj.logout() File "/usr/local/lib/python3.10/dist-packages/redfish/rest/v1.py", line 993, in logout raise BadRequestError("Invalid session resource: %s, "\ redfish.rest.v1.BadRequestError: Invalid session resource: /redfish/v1/SessionService/Sessions/Administratordbb81fa8e614428e8f125b8ecc247b2b, return code: 401 gumpana@silver:~/git/ftf/utils$

mraineri commented 3 months ago

└─# rf_sensor_list.py --user --password --rhost https:// Traceback (most recent call last): File "/usr/local/bin/rf_sensor_list.py", line 17, in import redfish ImportError: No module named redfish

For the first error, it looks like you don't have the required redfish module installed. Can you run the following and provide the output?

which rf_sensor_list.py
pip3 show redfish redfish_utilities
pip show redfish redfish_utilities

$ rf_sensor_list.py --user --password --rhost https:// 'Id' Traceback (most recent call last): File "/usr/local/bin/rf_sensor_list.py", line 51, in redfish_obj.logout() File "/usr/local/lib/python3.10/dist-packages/redfish/rest/v1.py", line 993, in logout raise BadRequestError("Invalid session resource: %s, " redfish.rest.v1.BadRequestError: Invalid session resource: /redfish/v1/SessionService/Sessions/Administratordbb81fa8e614428e8f125b8ecc247b2b, return code: 401 gumpana@silver:~/git/ftf/utils$

It looks like the service you're using is not implemented properly and is missing mandatory properties. Can you add --debug to the command and send the log file produced? That'll show the HTTP traces for where it's hitting an issue.

gumpana commented 2 months ago

└─# rf_sensor_list.py --user --password --rhost https:// Traceback (most recent call last): File "/usr/local/bin/rf_sensor_list.py", line 17, in import redfish ImportError: No module named redfish

For the first error, it looks like you don't have the required redfish module installed. Can you run the following and provide the output?

which rf_sensor_list.py
pip3 show redfish redfish_utilities
pip show redfish redfish_utilities

which rf_sensor_list.py

/usr/local/bin/rf_sensor_list.py

pip3 show redfish redfish_utilities

Name: redfish Version: 3.0.2 Summary: Redfish Python Library Home-page: https://github.com/DMTF/python-redfish-library Author: DMTF, https://www.dmtf.org/standards/feedback Author-email: None License: BSD 3-clause "New" or "Revised License" Location: /usr/local/lib/python3.9/dist-packages Requires: jsonpatch, jsonpath-rw, jsonpointer Required-by: redfish-utilities

Name: redfish-utilities Version: 1.1.6 Summary: Redfish Utilities Home-page: https://github.com/DMTF/Redfish-Tacklebox Author: DMTF, https://www.dmtf.org/standards/feedback Author-email: None License: BSD 3-clause "New" or "Revised License" Location: /usr/local/lib/python3.9/dist-packages Requires: XlsxWriter, redfish Required-by:

pip show redfish redfish_utilities

Name: redfish Version: 3.0.2 Summary: Redfish Python Library Home-page: https://github.com/DMTF/python-redfish-library Author: DMTF, https://www.dmtf.org/standards/feedback Author-email: None License: BSD 3-clause "New" or "Revised License" Location: /usr/local/lib/python3.9/dist-packages Requires: jsonpath-rw, jsonpointer, jsonpatch Required-by: redfish-utilities

Name: redfish-utilities Version: 1.1.6 Summary: Redfish Utilities Home-page: https://github.com/DMTF/Redfish-Tacklebox Author: DMTF, https://www.dmtf.org/standards/feedback Author-email: None License: BSD 3-clause "New" or "Revised License" Location: /usr/local/lib/python3.9/dist-packages Requires: redfish, XlsxWriter Required-by:

gumpana commented 2 months ago

PLease note that I am not able to reproduce second issue now. Not sure if any configuraton got updated on that setup

mraineri commented 2 months ago

For your first issue, do you have other versions of Python installed? It looks like everything is installed under Python3.9, but if it runs from a different Python instance, that might be where you're seeing a conflict.