redfish driver doesn't like trailing / on address

Bug #2070791 reported by Julia Kreger
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
High
Afonne-CID

Bug Description

Running 2023.1, it looks like if you have a trailing slash on your redfish_address variable, ironic will accept it, but sushy will error attempting to instantiate the client:

2024-06-26 18:31:02.127 1 ERROR ironic.drivers.modules.redfish.utils [None req-51569520-56a1-41cf-8b51-8d1e17e5d867 a360f74fe8174488a70b7f4d0ce2b8fa 0eff9354e2f7455e96ed8e6e40991841 - - default default] The Redfish System "/redfish/v1/Systems/0f0a619d-df70-4a0a-b201-1b20493ee1d9" was not found for node 5977f1a2-4eb5-4808-91e3-3a451251694b. Error Resource http://192.168.32.9:8000/ not found: sushy.exceptions.ResourceNotFoundError: Resource http://192.168.32.9:8000/ not found
2024-06-26 18:31:02.128 1 ERROR ironic.conductor.verify [None req-51569520-56a1-41cf-8b51-8d1e17e5d867 a360f74fe8174488a70b7f4d0ce2b8fa 0eff9354e2f7455e96ed8e6e40991841 - - default default] Failed to get power state for node 5977f1a2-4eb5-4808-91e3-3a451251694b. Error: Redfish exception occurred. Error: Resource http://192.168.32.9:8000/ not found: ironic.common.exception.RedfishError: Redfish exception occurred. Error: Resource http://192.168.32.9:8000/ not found

But when we remove the trailing /, i.e. run something like the next line, it just worked:

openstack baremetal node set --driver-info redfish_address=http://192.168.32.9:8000 ironic0

Afonne-CID (cidelight)
Changed in ironic:
assignee: nobody → Afonne-CID (cidelight)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/ironic/+/949597

Changed in ironic:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.opendev.org/c/openstack/ironic/+/949597
Committed: https://opendev.org/openstack/ironic/commit/5f7c7dcd041e95a7f1283ab12e9d708844fd0974
Submitter: "Zuul (22348)"
Branch: master

commit 5f7c7dcd041e95a7f1283ab12e9d708844fd0974
Author: Afonne-CID <email address hidden>
Date: Tue May 13 12:08:29 2025 +0100

    Fix redfish driver URL parsing

    When ``redfish_address`` contains trailing slashes, the Redfish driver
    would preserve them in the ``root_prefix``, causing sushy to error
    attempting to instantiate the client using a potentially malformed URL
    which results in a "Resource not found" error.

    This may or not be a breaking change since we are now stripping trailing
    slash(es) from custom paths, as well as explicitly setting a default
    ``root_prefix`` value if path is/becomes empty (inline comment suggested
    that was the case but it was never implemented).

    E.g: /test/redfish/v0/ -> /test/redfish/v0
         / -> /redfish/v1/
         /// -> /redfish/v1/

    Closes-Bug: #2070791
    Change-Id: I03f794350c6c0efd68131e6ede80c8a698983228

Changed in ironic:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ironic 30.0.0

This issue was fixed in the openstack/ironic 30.0.0 Flamingo release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.