DMTF/python-redfish-library

redfish.rest.v1.RetriesExhaustedError

yongyuandeconan opened this issue · 2 comments

When I try to run one_time_boot.py which locates DMTF/Redfish-Usecase-Checkers the following errors occour.
sudo /usr/local/python3.5/bin/python3.5 one_time_boot.py 10.104.195.19 Once Pxe -u XXX -p XXX
[sudo] password for zhangjn:
Traceback (most recent call last):
File "one_time_boot.py", line 225, in
sys.exit(main(sys.argv))
File "one_time_boot.py", line 197, in main
base_url=args.rhost, username=args.user, password=args.password, default_prefix="/redfish/v1")
File "/usr/local/python3.5/lib/python3.5/site-packages/redfish/rest/v1.py", line 1058, in redfish_client
max_retry=max_retry)
File "/usr/local/python3.5/lib/python3.5/site-packages/redfish/rest/v1.py", line 983, in init
max_retry=max_retry)
File "/usr/local/python3.5/lib/python3.5/site-packages/redfish/rest/v1.py", line 453, in init
self.get_root_object()
File "/usr/local/python3.5/lib/python3.5/site-packages/redfish/rest/v1.py", line 584, in get_root_object
raise excp
File "/usr/local/python3.5/lib/python3.5/site-packages/redfish/rest/v1.py", line 582, in get_root_object
resp = self.get('%s%s' % (self.__url.path, self.default_prefix))
File "/usr/local/python3.5/lib/python3.5/site-packages/redfish/rest/v1.py", line 616, in get
headers=headers)
File "/usr/local/python3.5/lib/python3.5/site-packages/redfish/rest/v1.py", line 1010, in _rest_request
args=args, body=body, headers=headers)
File "/usr/local/python3.5/lib/python3.5/site-packages/redfish/rest/v1.py", line 875, in _rest_request
raise RetriesExhaustedError()
redfish.rest.v1.RetriesExhaustedError

And I try to send redfish api with curl. It returns OK.

curl -v --insecure https://10.104.197.130/redfish/v1/

  • About to connect() to 10.104.197.130 port 443 (#0)
  • Trying 10.104.197.130...
  • Connected to 10.104.197.130 (10.104.197.130) port 443 (#0)
  • Initializing NSS with certpath: sql:/etc/pki/nssdb
  • skipping SSL peer certificate verification
  • SSL connection using TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  • Server certificate:
  • subject: CN=XCC-7Y51-1234567890,O=Lenovo,L=RTP,ST=NC,C=US
  • start date: Jun 03 11:14:28 2019 GMT
  • expire date: May 31 11:14:28 2029 GMT
  • common name: XCC-7Y51-1234567890
  • issuer: CN=XCC-7Y51-1234567890,O=Lenovo,L=RTP,ST=NC,C=US

GET /redfish/v1/ HTTP/1.1
User-Agent: curl/7.29.0
Host: 10.104.197.130
Accept: /

< HTTP/1.1 200 OK
< Date: Fri, 28 Jun 2019 18:06:54 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Link: </redfish/v1/schemas/ServiceRoot.v1_5_1.json>; rel="describedby"; type="application/json"
< ETag: "1fb8c1bd650f93f0f985392d6afa835e"
< Allow: HEAD
< Allow: GET
< OData-Version: 4.0
< Content-Language: en
< Cache-Control: no-store
< Server: XCC Web Server
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Content-Security-Policy: default-src 'self'; connect-src *; script-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; child-src 'self'; object-src 'none'
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< Cache-Control: no-cache, no-store, must-revalidate, private
< X-Frame-Options: DENY
<
{"Chassis":{"@odata.id":"/redfish/v1/Chassis"},"Id":"RootService","Links":{"Sessions":{"@odata.id":"/redfish/v1/SessionService/Sessions"}},"Managers":{"@odata.id":"/redfish/v1/Managers"},"@odata.context":"/redfish/v1/$metadata#ServiceRoot.ServiceRoot","Systems":{"@odata.id":"/redfish/v1/Systems"},"TelemetryService":{"@odata.id":"/redfish/v1/TelemetryService"},"UpdateService":{"@odata.id":"/redfish/v1/UpdateService"},"UUID":"AB48330E-0DCF-41D4-A0FA-1DA5E25DABA9","Vendor":"Lenovo","Name":"Root Service","@odata.type":"#ServiceRoot.v1_5_1.ServiceRoot","SessionService":{"@odata.id":"/redfish/v1/SessionService"},"Description":"This resource is used to represent a service root for a Redfish implementation.","@odata.etag":""1fb8c1bd650f93f0f985392d6afa835e"","AccountService":{"@odata.id":"/redfish/v1/AccountService"},"@odata.id":"/redfish/v1/"}

  • Connection #0 to host 10.104.197.130 left intact

The command line arguments don't look correct. You need to provide -r https://10.104.197.130 and not simply the IP. The way it's being used in your example is it will connect to "None".

Some of the others may also be wrong; please use -h for full details on the parameters for the tool.

Thank you very much. I tried just as you point and it worked.