python-redfish-library icon indicating copy to clipboard operation
python-redfish-library copied to clipboard

So trying to use the example and I keep getting time outs.

Open tdwitham opened this issue 4 years ago • 46 comments

So I get a timeout response - can go to the browser and it all works fine, any hints?

`import sys import redfish

login_host = "https://10.250.2.2" login_account = "root" login_password = "tester"

sys.stdout.write("Before OBJ host=%s account=%s password=%s\n" % (login_host, login_account, login_password)) REDFISH_OBJ = redfish.redfish_client(base_url=login_host, username=login_account, password=login_password,
timeout=5, max_retry=3, default_prefix='/redfish/v1/Systems') sys.stdout.write("After OBJ\n")

REDFISH_OBJ.login(auth="session")

response = REDFISH_OBJ.get("/redfish/v1/Systems", None)

sys.stdout.write("%s\n" % response)

REDFISH_OBJ.logout() `

tdwitham avatar Aug 10 '21 21:08 tdwitham

Is there an exception shown from the sample that could be shared? I would like to see where exactly the timeouts are coming from.

Can you also try changing "session" to "basic" in the login method? Browsers would use Basic Auth instead of Redfish Sessions, so that would give us a bit of consistency between the two for testing.

Some other things you can try with curl that might help; can you share the responses for these?

  • curl -k -u root:tester -D - "https://https://10.250.2.2/redfish/v1/"
  • curl -k -u root:tester -D - "https://https://10.250.2.2/redfish/v1/Systems"
  • curl -k -u root:tester -D - "https://https://10.250.2.2/redfish/v1/SessionService"
  • curl -k -u root:tester -D - "https://https://10.250.2.2/redfish/v1/SessionService/Sessions"

mraineri avatar Aug 11 '21 12:08 mraineri

Ahh, it is becoming clearer now. The proxy is working for the browser (Use system proxy settings) but not functioning for this access.

Wookie

@.*** Source]$ curl -k -u root:tester -D - "https:// https://10.250.2.2/redfish/v1/" HTTP/1.1 503 Service Unavailable Server: squid/4.12 Mime-Version: 1.0 Date: Wed, 11 Aug 2021 14:39:11 GMT Content-Type: text/html;charset=utf-8 Content-Length: 255 X-iboss-Error: ERR_DNS_FAIL 0

curl: (56) Received HTTP code 503 from proxy after CONNECT

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Wed, Aug 11, 2021 at 5:59 AM Mike Raineri @.***> wrote:

Is there an exception shown from the sample that could be shared? I would like to see where exactly the timeouts are coming from.

Can you also try changing "session" to "basic" in the login method? Browsers would use Basic Auth instead of Redfish Sessions, so that would give us a bit of consistency between the two for testing.

Some other things you can try with curl that might help; can you share the responses for these?

  • curl -k -u root:tester -D - "https://https://10.250.2.2/redfish/v1/"
  • curl -k -u root:tester -D - "https:// https://10.250.2.2/redfish/v1/Systems"
  • curl -k -u root:tester -D - "https:// https://10.250.2.2/redfish/v1/SessionService"
  • curl -k -u root:tester -D - "https:// https://10.250.2.2/redfish/v1/SessionService/Sessions"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-896805249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRNG46NSQYNGZRO6PR3T4JX3DANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 11 '21 14:08 tdwitham

Are your proxy settings configured via the following environment variables like this, or is there something else your browser is using?

export HTTP_PROXY="http://192.168.1.10:8888"
export HTTPS_PROXY="http://192.168.1.10:8888"

mraineri avatar Aug 11 '21 14:08 mraineri

Yes, in .bashrc, /etc/profile and /etc/profile. Looking to see if there is anything strange.

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Wed, Aug 11, 2021 at 7:56 AM Mike Raineri @.***> wrote:

Are your proxy settings configured via the following environment variables like this, or is there something else your browser is using?

export HTTP_PROXY="http://192.168.1.10:8888" export HTTPS_PROXY="http://192.168.1.10:8888"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-896898153, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRJ4XJ32T3WJSJDCOE3T4KFQHANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 11 '21 15:08 tdwitham

Okay I disabled the proxy for the 10.250.0.0/16 network and got to a connection.

And it seems like I need an SSL certificate for each and every one of the servers? Is this correct?

Wookie

curl -k -u root:tester -D - "https://10.250.2.2/redfish/v1/Systems" HTTP/1.1 401 Unauthorized WWW-Authenticate: Basic realm="Redfish" Content-Type: application/json X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000; includeSubdomains; preload X-UA-Compatible: IE=11 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Cache-Control: no-store, no-cache Pragma: no-cache Content-Security-Policy: default-src 'none'; script-src 'self'; style-src 'self'; frame-src 'self'; font-src 'self'; connect-src 'self'; img-src 'self' Content-Length: 792 Date: Wed, 11 Aug 2021 20:22:29 GMT

{"error":{"code":"Base.1.5.0.GeneralError","message":"A general error has occurred. See ExtendedInfo for more @.@.":"#Message.v1_0_7.Message","MessageId":"Base.1.5.0.NoValidSession","Message":"There is no valid session established with the implementation.","Severity":"Critical","Resolution":"Establish a session before attempting any @.***":"#Message.v1_0_7.Message","MessageId":"Base.1.5.0.ResourceAtUriUnauthorized","Message":"While accessing the resource at /redfish/v1/Systems, the service received an authorization error failed.","MessageArgs":["/redfish/v1/Systems","failed"],"Severity":"Critical","Resolution":"Ensure that the appropriate access is provided for the service in order for it to access the URI."}]}}

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Wed, Aug 11, 2021 at 8:08 AM Timothy Witham @.***> wrote:

Yes, in .bashrc, /etc/profile and /etc/profile. Looking to see if there is anything strange.

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Wed, Aug 11, 2021 at 7:56 AM Mike Raineri @.***> wrote:

Are your proxy settings configured via the following environment variables like this, or is there something else your browser is using?

export HTTP_PROXY="http://192.168.1.10:8888" export HTTPS_PROXY="http://192.168.1.10:8888"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-896898153, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRJ4XJ32T3WJSJDCOE3T4KFQHANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 11 '21 20:08 tdwitham

No, installing a certificate isn't needed for the interface to work (but it is encouraged since most services come with a self-signed certificate by default).

At least from the messages in your latest response, that would indicate to me the credentials "root" and "tester" are not valid. Were those same credentials working in the browser when you tried accessing Redfish resources via that path?

mraineri avatar Aug 12 '21 12:08 mraineri

Yes, that along with fixing some DPCP issues resolved the problem.

Thanks, but is there an example that actually parses the json? I've been looking and haven't found it.

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Thu, Aug 12, 2021 at 5:36 AM Mike Raineri @.***> wrote:

No, installing a certificate isn't needed for the interface to work (but it is encouraged since most services come with a self-signed certificate by default).

At least from the messages in your latest response, that would indicate to me the credentials "root" and "tester" are not valid. Were those same credentials working in the browser when you tried accessing Redfish resources via that path?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-897603532, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRJJTW4ISPDNGS4I753T4O56FANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 13 '21 17:08 tdwitham

The library itself doesn't contain that level of logic; it stops at producing a Python dictionary from the the JSON response, and leaves it up to the caller to extract the dictionary values that are relevant to their usage.

We do have a separate set of scripts that consumes this library and does more of the higher order types of operations (like collecting and displaying log data), and could be used as a sample for how to walk a Redfish service to find the data of interest. That project can be found here: https://github.com/DMTF/Redfish-Tacklebox

mraineri avatar Aug 13 '21 17:08 mraineri

Okay so I'm trying to use rf_system_inventory.py and I keep getting an error.

python3 ft_system_inventory.py --user test --password tester --rhost 10.250.2.2

And I get the following error message.

Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 885, in _rest_request self._conn.request(method.upper(), reqpath, body=body, AttributeError: 'NoneType' object has no attribute 'request'

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

Traceback (most recent call last): File "rf_sys_inventory.py", line 32, in redfish_obj = redfish.redfish_client( base_url = args.rhost, username = args.user, password = args.password ) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 1161, in redfish_client max_retry=max_retry) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 1074, in init max_retry=max_retry) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 452, in init self.get_root_object() File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 636, in get_root_object raise excp File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 634, in get_root_object resp = self.get('%s%s' % (self.__url.path, self.default_prefix)) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 669, in get headers=headers) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 1111, in _rest_request skip_redirect=skip_redirect) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 967, in _rest_request raise RetriesExhaustedError() from cause_exception redfish.rest.v1.RetriesExhaustedError

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Fri, Aug 13, 2021 at 10:57 AM Mike Raineri @.***> wrote:

The library itself doesn't contain that level of logic; it stops at producing a Python dictionary from the the JSON response, and leaves it up to the caller to extract the dictionary values that are relevant to their usage.

We do have a separate set of scripts that consumes this library and does more of the higher order types of operations (like collecting and displaying log data), and could be used as a sample for how to walk a Redfish service to find the data of interest. That project can be found here: https://github.com/DMTF/Redfish-Tacklebox

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-898628103, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRMX2ZHSZXPL72IYJCTT4VMKLANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 16 '21 17:08 tdwitham

You need to specify the scheme with the address; instead of --rhost 10.250.2.2 it should be --rhost http://10.250.2.2

Probably worth adding some validation in the library to make the exception more clear to the user, since it's ultimately the library that consumes the value passed in the rhost argument.

mraineri avatar Aug 16 '21 17:08 mraineri

Ahh, okay then - but now:

python3 rf_sys_inventory.py --user test --password tester --rhost https://10.250.2.2 returning true (re) returning true (re) Traceback (most recent call last): File "rf_sys_inventory.py", line 37, in inventory = redfish_utilities.get_system_inventory( redfish_obj ) File "/usr/local/lib/python3.6/site-packages/redfish_utilities/inventory.py", line 60, in get_system_inventory catalog_systems( context, chassis.dict["Links"], "ComputerSystems", chassis_instance ) File "/usr/local/lib/python3.6/site-packages/redfish_utilities/inventory.py", line 118, in catalog_systems catalog_storage( context, system_res.dict, "Storage", inventory ) File "/usr/local/lib/python3.6/site-packages/redfish_utilities/inventory.py", line 157, in catalog_storage catalog_array( context, member_res.dict, "Drives", inventory["Drives"] ) File "/usr/local/lib/python3.6/site-packages/redfish_utilities/inventory.py", line 79, in catalog_array catalog_resource( member_res.dict, inventory ) File "/usr/local/lib/python3.6/site-packages/redfish_utilities/inventory.py", line 175, in catalog_resource if item["Uri"] == @."]: KeyError: @.' Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Mon, Aug 16, 2021 at 10:16 AM Mike Raineri @.***> wrote:

You need to specify the schema with the address; instead of --rhost 10.250.2.2 it should be --rhost http://10.250.2.2

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-899677965, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARROY6IIBEFKCXQ3NZSLT5FBWLANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 16 '21 17:08 tdwitham

It's hard to tell without the payload in question, but it appears the service is not rendering the mandatory @odata.id property in one or more of its Drive resources. If this is the case, we might need to consider adding some workaround flags to bypass services that are not implementing mandatory properties to Tacklebox.

mraineri avatar Aug 16 '21 17:08 mraineri

It could be that there was an error in getting the resource in question (and error payloads do not have @odata.id properties). This might be a good time for me to revisit this tool and improve the error handling.

mraineri avatar Aug 16 '21 17:08 mraineri

Is there someway I can dump the payload out for you? And I will track down John L. and see what he has to say.

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Mon, Aug 16, 2021 at 10:43 AM Mike Raineri @.***> wrote:

It's hard to tell without the payload in question, but it appears the service is not rendering the mandatory @odata.id property in one or more of its Drive resources. If this is the case, we might need to consider adding some workaround flags to bypass services that are not implementing mandatory properties to Tacklebox.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-899695910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRM2U4UJRMNFPQHK2XLT5FE3LANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 16 '21 17:08 tdwitham

You should be able to get it from a browser and paste it here. From the trace, it's following the links through Systems, Storage, and Drives.

Depending on the number of storage subsystems, it might get difficult to track down the exact culprit. I would start with trying to find the first drive reported in the first storage subsystem.

  • Go to /redfish/v1/Systems
  • Go to the first system instance in the Members array
  • Go to the Storage collection found in the first system (look for the "Storage" property)
  • Go to the first storage instance in the Members array
  • Go to the first drive listed in the "Drives" property

I'm hoping the payload found at that last step will tell us what's going on, but if it's not clear, I can make a debug branch in Tacklebox for tracing what's going on.

mraineri avatar Aug 16 '21 18:08 mraineri

Well actually it was the last drive.

For https://10.250.2.2/redfish/v1/Systems/............/Storage/1/ https://10.250.2.2/redfish/v1/Systems/............/Storage/1/

@odata.context "/redfish/v1/$metadata#Storage.Storage" @odata.id "/redfish/v1/Systems/............/Storage/1" @odata.type "#Storage.v1_7_0.Storage" Id "1" Name "Local Storage Controller" Drives 0 @odata.id "/redfish/v1/Systems/............/Storage/1/Drives/0" 1 @odata.id "/redfish/v1/Systems/............/Storage/1/Drives/1" 2 @odata.id "/redfish/v1/Systems/............/Storage/1/Drives/2" Links Enclosures 0 @odata.id "/redfish/v1/Chassis/RackMount" @odata.etag "f289c576d773b62853a878a14f823232"

For https://10.250.2.2/redfish/v1/Systems/............/Storage/1/Drives/2 https://10.250.2.2/redfish/v1/Systems/............/Storage/1/Drives/2

error code "Base.1.5.0.GeneralError" message "A general error has occurred. See ExtendedInfo for more information." @Message.ExtendedInfo 0 @odata.type "#Message.v1_0_7.Message" MessageId "Base.1.5.0.ResourceMissingAtURI" Message "The resource at the URI /redfish/v1/Systems/............/Storage/1/Drives/2 was not found." MessageArgs 0 "/redfish/v1/Systems/............/Storage/1/Drives/2" Severity "Critical" Resolution "Place a valid resource at the URI or correct the URI and resubmit the request."

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Mon, Aug 16, 2021 at 11:03 AM Mike Raineri @.***> wrote:

You should be able to get it from a browser and paste it here. From the trace, it's following the links through Systems, Storage, and Drives.

Depending on the number of storage subsystems, it might get difficult to track down the exact culprit. I would start with trying to find the first drive reported in the first storage subsystem.

  • Go to /redfish/v1/Systems
  • Go to the first system instance in the Members array
  • Go to the Storage collection found in the first system (look for the "Storage" property)
  • Go to the first storage instance in the Members array
  • Go to the first drive listed in the "Drives" property

I'm hoping the payload found at that last step will tell us what's going on, but if it's not clear, I can make a debug branch in Tacklebox for tracing what's going on.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-899708975, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRIKMB3CB3T772XN5H3T5FHHPANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 16 '21 18:08 tdwitham

So, it is the latter case; the Storage resource is presenting links to Drives that result in a 404. I can certainly add better error handling to not crash in these cases, but it would be good to understand why the service you're working with isn't accepting the Drive URIs its presenting. It could be a case where the drive itself is absent, but we have modeling guidance in Redfish to render the resource with the "State" property inside of "Status" as "Absent" rather than returning a 404.

mraineri avatar Aug 16 '21 18:08 mraineri

What do you get when you issue a GET /redfish/v1/Systems/............/Storage/1/Drives/0 via Postman? Anything you do via the library, you can debug by walking the resource tree manually.

jcleung5549 avatar Aug 16 '21 19:08 jcleung5549

About what I expect.

@odata.context "/redfish/v1/$metadata#Drive.Drive" @odata.id "/redfish/v1/Systems/............/Storage/1/Drives/0" @odata.type "#Drive.v1_6_0.Drive" Id "0" Name "PCIe S0 B3 D0 F0" Protocol "PCIe" MediaType "SSD" CapacityBytes 499122176 RotationSpeedRPM 0 Model "INTEL SSDPEKKA512G7 " SerialNumber "BTPY719309J6512F " Revision "PSF119D" Oem Storage @odata.type "#OEMExtensions.Storage" PciClass 1 VendorId "0x8086" DeviceId "0xF1A5" SubVendorId "0x8086" SubDeviceId "0x390A" @odata.etag "b2c6540abecd52b008dca4bd69335e36"

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Mon, Aug 16, 2021 at 12:01 PM John Leung @.***> wrote:

What do you get when you issue a GET /redfish/v1/Systems/............/Storage/1/Drives/0 via Postman? Anything you do via the library, you can debug by walking the resource tree manually.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-899746067, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRP5MWDICYNUUTKHARDT5FOBXANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

tdwitham avatar Aug 16 '21 19:08 tdwitham

@tdwitham I just released some changes that might help; rf_sys_inventory has a "workaround" flag added to bypass that issue you hit.

mraineri avatar Aug 30 '21 14:08 mraineri

Thanks, I'll check it out.

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Mon, Aug 30, 2021 at 7:36 AM Mike Raineri @.***> wrote:

@tdwitham https://github.com/tdwitham I just released some changes that might help; rf_sys_inventory has a "workaround" flag added to bypass that issue you hit.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-908397193, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRMQYTVBHRVUOJNKONLT7OJPVANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tdwitham avatar Aug 30 '21 15:08 tdwitham

Hmmm, different error - 400

@.*** scripts]$ rf_sys_inventory.py --user test --password tester --rhost http:/10.250.2.2 Traceback (most recent call last): File "/usr/local/bin/rf_sys_inventory.py", line 32, in redfish_obj = redfish.redfish_client( base_url = args.rhost, username = args.user, password = args.password ) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 1161, in redfish_client max_retry=max_retry) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 1074, in init max_retry=max_retry) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 452, in init self.get_root_object() File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 640, in get_root_object "return code: %d" % resp.status) redfish.rest.v1.ServerDownOrUnreachableError: Server not reachable, return code: 400

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Mon, Aug 30, 2021 at 8:05 AM Timothy Witham @.***> wrote:

Thanks, I'll check it out.

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Mon, Aug 30, 2021 at 7:36 AM Mike Raineri @.***> wrote:

@tdwitham https://github.com/tdwitham I just released some changes that might help; rf_sys_inventory has a "workaround" flag added to bypass that issue you hit.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-908397193, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRMQYTVBHRVUOJNKONLT7OJPVANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tdwitham avatar Sep 01 '21 19:09 tdwitham

In this case it looks like you can't even log into the system; it's trying to access /redfish/v1/ but getting a 400. Can you access the resource in the browser?

mraineri avatar Sep 01 '21 20:09 mraineri

Yes, yes I can. Let me look into it.

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Wed, Sep 1, 2021 at 1:05 PM Mike Raineri @.***> wrote:

In this case it looks like you can't even log into the system; it's trying to access /redfish/v1/ but getting a 400. Can you access the resource in the browser?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-910681711, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARROMBJT4VZPN2CZ2NMDT72BQXANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tdwitham avatar Sep 01 '21 20:09 tdwitham

And yes it works with the user/password I'm giving it. :-(

Wookie Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Wed, Sep 1, 2021 at 1:10 PM Timothy Witham @.***> wrote:

Yes, yes I can. Let me look into it.

Wookie

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Wed, Sep 1, 2021 at 1:05 PM Mike Raineri @.***> wrote:

In this case it looks like you can't even log into the system; it's trying to access /redfish/v1/ but getting a 400. Can you access the resource in the browser?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-910681711, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARROMBJT4VZPN2CZ2NMDT72BQXANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tdwitham avatar Sep 01 '21 20:09 tdwitham

I just noticed the URI given is not correct. You're missing a / in the rhost argument: http:/10.250.2.2.

mraineri avatar Sep 02 '21 12:09 mraineri

Okay, so now a 404 error. But I found it with the browser. @.*** scripts]$ rf_sys_inventory.py --user test --password tester --rhost http://10.250.2.2/v1/Systems returning true (re) returning true (re) Traceback (most recent call last): File "/usr/local/bin/rf_sys_inventory.py", line 32, in redfish_obj = redfish.redfish_client( base_url = args.rhost, username = args.user, password = args.password ) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 1161, in redfish_client max_retry=max_retry) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 1074, in init max_retry=max_retry) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 452, in init self.get_root_object() File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 640, in get_root_object "return code: %d" % resp.status) redfish.rest.v1.ServerDownOrUnreachableError: Server not reachable, return code: 404

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Thu, Sep 2, 2021 at 5:21 AM Mike Raineri @.***> wrote:

I just noticed the URI given is not correct. You're missing a / in the rhost argument: http:/10.250.2.2.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-911615457, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRN6UPOOBMD7R7BOZDLT75T4JANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tdwitham avatar Sep 02 '21 18:09 tdwitham

For --rhost, you would leave off the resource URI (it's just the scheme + IP address). So, it should be --rhost https://10.250.2.2.

mraineri avatar Sep 02 '21 19:09 mraineri

@.*** scripts]$ rf_sys_inventory.py --user test --password tester --rhost http://10.250.2.2 returning true (re) returning true (re) returning true (re) Traceback (most recent call last): File "/usr/local/bin/rf_sys_inventory.py", line 33, in redfish_obj.login( auth = "session" ) File "/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py", line 1017, in login raise InvalidCredentialsError(delay) redfish.rest.v1.InvalidCredentialsError: 0

Timothy D. Witham - 1815 SW Pheasant Dr - Aloha, OR 97003 - Cell (503)-702-2871 - Office 503-207-6556 x101 - Fax (503) 928-6447 www.forestmoondevelopment.com -

On Thu, Sep 2, 2021 at 12:21 PM Mike Raineri @.***> wrote:

For --rhost, you would leave off the resource URI (it's just the schema + IP address). So, it should be --rhost https://10.250.2.2.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DMTF/python-redfish-library/issues/113#issuecomment-911985898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIARRMQW5OGADRLATCZ3ADT77FEVANCNFSM5B43WGLA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tdwitham avatar Sep 02 '21 19:09 tdwitham

Would it be possible to try https instead of http? Services tend to reject Redfish Session Login when using http since it's not a secure communication channel.

rf_sys_inventory.py --user test --password tester --rhost https://10.250.2.2

mraineri avatar Sep 03 '21 17:09 mraineri