|
Post by naimsiddiqui on Apr 29, 2024 5:36:49 GMT
Hello Everyone,
I am trying to update the administrator password through redfish PATCH method. Below is the command I am using to update the password from "oldPassword12" to "newPassword24"
./redfishtest -H https://X.X.X.X -u Administrator -p oldPassword12 -M PATCH /v1/AccountService/Accounts[0]/Password newPassword24 -vvvv
I am getting error code 417 in http response
asyncHeaderCallback: Adding Content-Type => text/html to (nil)
asyncHeaderCallback: Adding Content-Length => 363 to 0x7f1e08020d10
asyncHeaderCallback: Adding Connection => close to 0x7f1e08020d10
asyncHeaderCallback: Adding Date => Mon, 29 Apr 2024 09 to 0x7f1e08020d10
asyncHeaderCallback: Adding Server => lighttpd to 0x7f1e08020d10
rawAsyncWorkThread: Got response for url https://X.X.X.X/redfish/v1/AccountService/Accounts/1 with code 417
PATCH to /v1/AccountService/Accounts[0]: Failed! (417)
with some debug logs, get the below logs
DebugLog: header name= [Content-Type], value = [text/html]
DebugLog: body = [<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>417 - Expectation Failed</title>
</head>
<body>
<h1>417 - Expectation Failed</h1>
</body>
</html>
]
Is the above command to change the password correct or anything I missed?
Any help or guidance would be appreciated.
Thanks in Advance...
|
|
|
Post by mraineri on Apr 29, 2024 13:01:37 GMT
Does the debug log contain the HTTP request headers and request body?
What's the output of the following curl command?
curl -k -u Administrator:oldPassword12 -X PATCH https://X.X.X.X/v1/AccountService/Accounts/1 -H "Content-Type: application/json" -d "{ \"Password\": \"newPassword24\" }"
|
|
|
Post by naimsiddiqui on Apr 29, 2024 14:57:32 GMT
Thanks for the Response mraineri.
Below is the body and request header from the request. url [https://X.X.X.X/redfish/v1/AccountService/Accounts/1], method[6],bodySize[25],body[{"Password": "newPassword24"}]
addRequestHeader: Adding Accept => application/json to (nil) addRequestHeader: Adding OData-Version => 4.0 to 0x7f4fb0027630 addRequestHeader: Adding User-Agent => libredfish to 0x7f4fb0027630 addRequestHeader: Adding Authorization => Basic QWRtaW5pc3RyYXRvcjpzdXBlcnVzZXI4 to 0x7f4fb0027630 addRequestHeader: Adding Content-Type => application/json to 0x7f4fb0027630
curl -k -u Administrator:oldPassword12 -X PATCH https://X.X.X.X/v1/AccountService/Accounts/1 -H "Content-Type: application/json" -d "{ \"Password\": \"newPassword24\" }"
Curl command is success and password has been updated..
> PATCH /redfish/v1/AccountService/Accounts/1 HTTP/1.1 > Host: X.X.X.X > Authorization: Basic QWRtaW5pc3RyYXRvcjpzdXBlcnVzZXI4 > User-Agent: curl/7.76.1 > Accept: */* > If-Match: "1714416381" > Content-Type: application/json > Content-Length: 26 > * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): * old SSL session ID is stale, removing * Mark bundle as not supporting multiuse < HTTP/1.1 204 No Content < Server: AMI MegaRAC Redfish Service < Allow: GET, PATCH, DELETE < Date: Mon, 29 Apr 2024 18:47:33 GMT < * Connection #0 to host 169.254.0.17 left intact
|
|
|
Post by mraineri on May 1, 2024 12:42:57 GMT
Are you able to supply an If-Match header with redfishtest? I see in the curl output "If-Match" was added; I'm actually not sure how the curl command automatically added If-Match (I've always needed to manually include it). I'm wondering if your service is requiring the ETag to be sent in the If-Match header for the request.
|
|