Closed github9817 closed 3 years ago
How large is the payload you are trying to send?
32M.
Is there an upper limit on the file size?
That's right on the upper limit to upload in a single go. The example currently doesn't split the files if it's greater than max file size. Here is how we split the files in the iLOrest tool. The same method should work for the library example.
Even I tried to upload the small file below, I got the same response from server:
Online Flash Component for Linux - HPE Integrated Lights-Out 5 Chinese Simplified Language Pack
https://support.hpe.com/hpsc/swd/public/detail?swItemId=MTX_891ea855763744c698b6301071
File name: ilo5-lpk-zh-ri11-2.10-1.1.x86_64.compsig (2.1 KB)
File name: ilo5-lpk-zh-ri11-2.10-1.1.x86_64.rpm (664 KB)
==================================== An http response of '303' was returned. 303 Content-Type text/plain Connection close Date Thu, 06 Feb 2020 15:45:04 GMT Content-Length 0
b''
I will discuss this with iLO dev and see if we can figure out what would cause this error. I have never encountered this.
303 is a redirect. Can you check the HTTP location header for the redirect target? Are you using http or https?
The following are the debug information from the log file. It is http for uploadFile
EBUG:redfish.rest.connections:HTTP REQUEST: POST PATH: /cgi-bin/uploadFile BODY: binary body DEBUG:urllib3.connectionpool:Resetting dropped connection: 3.28.93.232 DEBUG:urllib3.connectionpool:http://3.28.93.232:80 "POST /cgi-bin/uploadFile HTTP/1.1" 303 0 INFO:redfish.rest.connections:Response Time to /cgi-bin/uploadFile: 0.05200028419494629 seconds. DEBUG:redfish.rest.connections:HTTP RESPONSE: Code:303 Content-Type text/plain Connection close Date Wed, 12 Feb 2020 16:18:36 GMT Content-Length 0
b'' DEBUG:redfish.rest.connections:HTTP REQUEST: DELETE PATH: https:///redfish/v1/SessionService/Sessions/root000000005e44255bd16872af/ HEADERS: {'X-Auth-Token': '6d14dbb67602dbea9863e50ac0afee7a', 'OData-Version': '4.0'} BODY: None DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 3.28.93.232https:80 DEBUG:urllib3.util.retry:Incremented Retry for (url='//redfish/v1/SessionService/Sessions/root000000005e44255bd16872af/'): Retry(total=2, connect=None, read=None, redirect=None, status=None) WARNING:urllib3.connectionpool:Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x03943CA0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': //redfish/v1/SessionService/Sessions/root000000005e44255bd16872af/ DEBUG:urllib3.connectionpool:Starting new HTTP connection (2): 3.28.93.232https:80 DEBUG:urllib3.util.retry:Incremented Retry for (url='//redfish/v1/SessionService/Sessions/root000000005e44255bd16872af/'): Retry(total=1, connect=None, read=None, redirect=None, status=None) WARNING:urllib3.connectionpool:Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x03DC6088>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': //redfish/v1/SessionService/Sessions/root000000005e44255bd16872af/ DEBUG:urllib3.connectionpool:Starting new HTTP connection (3): 3.28.93.232https:80 DEBUG:urllib3.util.retry:Incremented Retry for (url='//redfish/v1/SessionService/Sessions/root000000005e44255bd16872af/'): Retry(total=0, connect=None, read=None, redirect=None, status=None) WARNING:urllib3.connectionpool:Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x03DC6130>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': //redfish/v1/SessionService/Sessions/root000000005e44255bd16872af/ DEBUG:urllib3.connectionpool:Starting new HTTP connection (4): 3.28.93.232https:80
iLO requires https, try that instead of http.
Scripts to upload components to iLO Repository: https://github.com/HewlettPackard/python-ilorest-library/blob/master/examples/Redfish/upload_firmware_ilo_repository.py https://github.com/HewlettPackard/python-ilorest-library/blob/master/examples/Redfish/upload_firmware_ilo_repository_with_compsig.py Please confirm if they are working for you, so that we can close this case.
Yergidy - thanks for suggestion back in 2020, I had started with sample code for upload, what Rajeevkallur suggested, but had it called from other code, in the other code I had instantiated the redfish object with just a IP address of an ilo (testing in my lab), I also had experienced the 303, I changed it to the "https://{ip}" when I initiated the redfish class, and that resolved my issue.
I cannot upload a firmware update file to iLO repository by the Python example upload_firmware_ilo_repository.py:
The following is the print out from the code:
An http response of '303' was returned. Upload incomplete: 303 Content-Type text/plain Connection close Date Wed, 05 Feb 2020 21:28:50 GMT Content-Length 0
b