DMTF / Redfishtool

A Python34 program that implements a command line tool for accessing the Redfish API.
Other
224 stars 68 forks source link

"redfishtool: getCollection: Error getting service root, aborting" #111

Closed Bhavadhara closed 8 months ago

Bhavadhara commented 9 months ago
          Hi, I'm facing the same issue when trying to verify server BMC through redfishtool.  "redfishtool: getCollection: Error getting service root, aborting" This is the one-line error message I'm getting. Even I verified the urllib3 is 1.24.3 and I'm not facing any issues with redfish API and postman. I need help with redfishtool on Raspbian OS.

Originally posted by @Bhavadhara in https://github.com/DMTF/Redfishtool/issues/65#issuecomment-1845074755

jautor commented 9 months ago

Can you try any of the tools in the Redfish Tackle box to help diagnose this as either a tool issue or an issue with the implementation? https://github.com/DMTF/Redfish-Tacklebox/

jautor commented 9 months ago

If you're able to retrieve the ServiceRoot (/redfish/v1) via POSTMAN, can you show that full payload here, too?

Bhavadhara commented 9 months ago
Redfish

Hi,

I have given the username and password under basic auth in authorization and provided the Remote server IP "https://###########/redfish/v1/" under GET request and retrieved the output.

If you're able to retrieve the ServiceRoot (/redfish/v1) via POSTMAN, can you show that full payload here, too?

mraineri commented 9 months ago

Can you provide your exact redfishtool request with all arguments as well as the entire output from redfishtool? Based on what you're specifying, I can follow-up with curl or other types of tool operations to help diagnose this further.

Bhavadhara commented 9 months ago

Hi,

With this command "curl -k -u username:password https://190.190.0.0/redfish/v1", I can retrieve BMC through Redfish API. For Redfishtool(version:1.1.8), I have copy pasted the command and the response I received below

rpi@raspberrypi:~/Redfishtool $ redfishtool -r 190.190.0.0 -u username -p password Systems redfishtool: getCollection: Error getting service root, aborting rpi@raspberrypi:~/Redfishtool $ redfishtool -r 190.190.0.0 -u username -p password AccountService redfishtool: get AccountService: Error getting service root, aborting rpi@raspberrypi:~/Redfishtool $

jautor commented 9 months ago

can you post the JSON payload you received from that successful curl command?

Bhavadhara commented 9 months ago

{ "@odata.id": "/redfish/v1", "@odata.type": "#ServiceRoot.v1_5_0.ServiceRoot", "AccountService": { "@odata.id": "/redfish/v1/AccountService" }, "CertificateService": { "@odata.id": "/redfish/v1/CertificateService" }, "Chassis": { "@odata.id": "/redfish/v1/Chassis" }, "EventService": { "@odata.id": "/redfish/v1/EventService" }, "Id": "RootService", "JsonSchemas": { "@odata.id": "/redfish/v1/JsonSchemas" }, "Links": { "Sessions": { "@odata.id": "/redfish/v1/SessionService/Sessions" } }, "Managers": { "@odata.id": "/redfish/v1/Managers" }, "Name": "Root Service", "RedfishVersion": "1.9.0", "Registries": { "@odata.id": "/redfish/v1/Registries" }, "SessionService": { "@odata.id": "/redfish/v1/SessionService" }, "Systems": { "@odata.id": "/redfish/v1/Systems" }, "Tasks": { "@odata.id": "/redfish/v1/TaskService" }, "TelemetryService": { "@odata.id": "/redfish/v1/TelemetryService" }, "UUID": "316e32c6-612d-5b3a-9381-e1cab0ac8e33", "UpdateService": { "@odata.id": "/redfish/v1/UpdateService" } }

Bhavadhara commented 9 months ago

Hi,

Is there any way to resolve this error message? Any inputs regarding this could really help for planning our next steps.

Regards, Bhavadharani S

mraineri commented 9 months ago

Can you do try this?

"curl -k https://190.190.0.0/redfish/v1"

/redfish/v1/ is an unauthenticated resource per the spec, so redfishtool will not send credentials when doing initial discovery. I'm wondering if the service you're using is trying to enforce credentials when accessing /redfish/v1/.

Bhavadhara commented 9 months ago

Hi,

I've tried this command without credentials, and it worked. For redfishtool what we need to do to access /redfish/v1/.

mraineri commented 9 months ago

Can you try the following? If you do not add "-S Always", redfishtool start with HTTP when accessing the service root as an unauthenticated resource. Please also add "-v" and provide the output if it still is failing so we can see the debug output to look at this further.

redfishtool -r 190.190.0.0 -u username -p password -S Always -v AccountService

curl http://190.190.0.0/redfish/v1/

Bhavadhara commented 9 months ago

Hi,

The redfishtool command actually worked for me. Thanks much!!

Could you help me with retrieving more info like BMC, BIOS and use POST for UpdateService. I'm finding it difficult while trying to navigate "redfishtool -r -u -p -S Always -v Systems/systemID/####/####"

Any documentation or link for using redfishtool with "Always -v" would really help.

Thanks in advance!

jautor commented 8 months ago

@Bhavadhara I'll suggest again that you also take a look at the tools in the Redfish Tacklebox repo: https://github.com/dmtf/redfish-tacklebox as those are under active development, while redfishtool is not.

There is more support there for items such as the UpdateService...

Bhavadhara commented 8 months ago

Hi,

Thanks @mraineri, @jautor, @EdwardBetts, @pjaroszynski for all the valuable inputs. Closing the issue with gratitude.

Regards, Bhavadharani S