Closed maximyep closed 5 years ago
Seems that it's not able to contact whatever servers you're throwing at it, and this is what the "redfish" library is spitting out as a result. The program should be programmed to catch these errors, but are you able to contact these servers on their own?
edit: Sorry I just noticed, the schema "http://" or "https://" is required in the url. This is a requirement of the program and its use of the "redfish" library and I must've overlooked it, it should not require it, or at least not change the default behavior.
Thanks for the idea (to use https://)! The test starts to execution if the following line was used: one_time_boot_check.py https:// 192.168.XXX.XXX:443 Disabled|Once None|Pxe -u ** -p ***
Test do changes in /redfish/v1/Systems/Self from "Disabled None" to "Once Pxe" but fails with:
No system specified, defaulting to single system, ['Self']
Boot change patch success
Boot status change Disabled None
####sutUri : /redfish/v1/Systems/Self
####decoded: {'error': {'@Message.ExtendedInfo': [{'@odata.type': '#Message.v1_0_4.Message', 'Message': 'While attempting to establish a connection to /redfish/v1/Systems/Self, the service was denied access.', 'MessageArgs': ['/redfish/v1/Systems/Self'], 'MessageId': 'Security.1.0.AccessDenied', 'Resolution': 'Attempt to ensure that the URI is correct and that the service has the appropriate credentials.', 'Severity': 'Critical'}], 'code': 'Security.1.0.AccessDenied', 'message': 'While attempting to establish a connection to /redfish/v1/Systems/Self, the service was denied access.'}}
Traceback (most recent call last):
File "/home/max/redfish/Redfish-Usecase-Checkers/one_time_boot/one_time_boot_check.py", line 72, in <module>
sys.exit(main(sys.argv))
File "/home/max/redfish/Redfish-Usecase-Checkers/one_time_boot/one_time_boot_check.py", line 39, in main
args.target_systems, redfish_obj, args.override_enable, args.typeboot_target, args.delay)
File "/home/max/redfish/Redfish-Usecase-Checkers/one_time_boot/one_time_boot.py", line 57, in perform_one_time_boot
*handleBootToSystem(context, systems_url, system, override_enable, typeboot_target, delay),
File "/home/max/redfish/Redfish-Usecase-Checkers/one_time_boot/one_time_boot.py", line 121, in handleBootToSystem
newOverride, newType = decoded['Boot']['BootSourceOverrideEnabled'], decoded['Boot']['BootSourceOverrideTarget']
KeyError: 'Boot'
Closed by mistake
I'm pretty sure the error occured in the above code when the response from a GET request returned a 4XX or 5XX status and an extended error in the payload as seen in the output above:
{
'error': {
'@Message.ExtendedInfo': [
'Message': 'While attempting to establish a connection to /redfish/v1/Systems/Self, the service was denied access.'
...
]
}
}
And then the tool tried to read the BootSourceOverride properties from that payload and got the KeyError: 'Boot'
error.
The code should be hardened to only try to read the properties from the response if the response status is 200.
I looked at this again in more detail. I think the root cause is that the tool is using session authentication and then performing a reboot. After the system reboots the previous session is no longer valid. But the tool is still using that session to check the state of the 'Boot' properties after reboot.
I think the tool probably needs to be changed to remove the --auth
arg and always use basic auth for this use case.
While the tool should be hardened, isn't that a simulator problem? No reason for the Session to be invalidated on a system reboot, which is independent of Redfish and its controller.
My bad. I should have looked even more closely. Agreed that the system reboot should not cause the session to be invalidated.
But I don't think this is a profile-simulator issue. The session in the profile-simulator does not get invalidated or timeout as best as I can tell. I don't even think the profile simulator was being used when the KeyError: 'Boot'
error occurred. Note that when the issue was originally opened the host:port was 127.0.0.1:5000
(profile-simulator). But later, when the KeyError: 'Boot'
error was reported the host:port was 192.168.XXX.XXX:443
. Further, the profile-simulator (at least in its default config) doesn't emit the @Message.ExtendedInfo
seen in the Mar 29 error output.
So, what is the real cause? Perhaps the session timed out? It looks like we sleep for no longer than 30 seconds in the loop. If the session timeout is set to 30 seconds, it may be just a bit longer than 30 seconds of inactivity on the session with the current code logic.
Test execution fails with error (below).
The same error is observed for the OpenBmc QEMU:
python3 one_time_boot.py 192.168.122.52:443 Once Pxe -u root -p 0penBmc