Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the Validator and it shows some error message #234

Closed
ViktorYao opened this issue May 23, 2018 · 7 comments
Closed

Run the Validator and it shows some error message #234

ViktorYao opened this issue May 23, 2018 · 7 comments
Assignees

Comments

@ViktorYao
Copy link

ViktorYao commented May 23, 2018

Hello guys,
I just setup the Redfish server by Redfish-Profile-Simulator.
I check it via web page and curl command, and it can work normally.
But when I use the Redfish-Service-Validator to check it, it will show some error message like below:

--------------------------------------------------Error message--------------------------------------------------
Setting up service...
Constructing metadata...
This URI did NOT return XML or Json, this is not a Redfish resource (is this redirected?): /redfish/v1/$metadata
If $metadata cannot be found, Annotations may be unverifiable
Metadata: getSchemaDetails() did not return success
ConfigURI: 172.XX.XX.XXX:XXXX
System Info: Test Config, place your own description of target system here
authtype: Basic, cachefilepath: ./cache, cachemode: Off, certificatebundle: None, certificatecheck: False, configuri: http://172.XX.XX.XXX:XXXX,
httpproxy: None, httpsproxy: None, linklimit: {'LogEntry': 20}, localonlymode: True, logpath: ./logs, metadatafilepath: ./SchemaFiles/metadata,
payloadmode: Default, sample: 0, schema_pack: None, schemasuffix: _v1.xml, servicemode: False, timeout: 30,
token: None, username: root, usessl: False,
Start time: 05/23/18 - 13:51:53

*** /redfish/v1
This URI did NOT return XML or Json, this is not a Redfish resource (is this redirected?): /redfish/v1
/redfish/v1: URI could not be acquired: 200
Elapsed time: 0:00:00
1
1 problemResource errors in /redfish/v1
Counter({'problemResource': 1, 'missingRedfishAlias': 1})
Validation has failed: 1 problems found
--------------------------------------------------Error message--------------------------------------------------
Except the error message,
I want to ask some questions,

  1. Are schema files necessary? If yes, is download from this URL ? (https://redfish.dmtf.org/redfish/schema_index)
  2. Is $metadata necessary? If yes, where should I find it? From Simulator side or ...?
  3. Where should I put them? is under the route about ".../myproject/Redfish-Service-Validator-1.1.0/SchemaFiles/metadata/"?

By the way, the version I used is here!
Redfish-Profile-Simulator = 0.9.2
Redfish-Service-Validator = 1.1.0

Thanks for the help.

@tomasg2012
Copy link
Contributor

I seems that the Profile Simulator is not providing a proper header or the returned item is HTML. You may choose to use the Redfish-Mockup-Server instead, but will still check the Profile Simulator.

@billdodd
Copy link
Contributor

First, some answers to your questions:

  1. Are schema files necessary? If yes, is download from this URL ?

Your $metadata should reference the needed schemas and the validator will follow the URI specified to retrieve them. So, yes, the schema files are necessary. But in the normal case the validator will retrieve them automatically as needed.

  1. Is $metadata necessary? If yes, where should I find it? From Simulator side or ...?

Yes, it is necessary. It should be provided on the Simulator side. For example, with the default mockup provided in the Simulator, it is found here: MockupData/SimpleOcpServerV1/redfish/v1/$metadata/index.xml

  1. Where should I put them?

See answers to 1 and 2 above.

Now, to the errors your are seeing:

This URI did NOT return XML or Json, this is not a Redfish resource (is this redirected?): /redfish/v1/$metadata

*** /redfish/v1
This URI did NOT return XML or Json, this is not a Redfish resource (is this redirected?): /redfish/v1

For both of the above errors, I think this is because the Simulator is not returning the proper Content-Type header for JSON or XML (it is always returning text/html).

So these are an issue with the Profile-Simulator rather than the Service-Validator. In the meantime, you may want to try using the Redfish-Mockup-Server instead of the Profile-Simulator.

@billdodd
Copy link
Contributor

UPDATE: I take back what I said about the Content-Type header returned from the Simulator. I had an old Simulator version on my system. And it looks like you also may have an old version of the Simulator (0.9.2 vs. 0.9.49).

@mraineri
Copy link
Contributor

mraineri commented Aug 9, 2018

Would like to double check the validator that it doesn't depend on the Content-Type header; yes they ultimately need to be correct from the service, but the tool should be able to continue with validation for the payloads.

@billdodd billdodd self-assigned this Sep 20, 2018
@billdodd
Copy link
Contributor

From looking at the code, it should be doing the right thing (if Content-Type is missing or incorrect, issue error but continue with validation). I will test it to be sure and report back.

@billdodd
Copy link
Contributor

Verified the expected behavior. We can close this issue now.

@mraineri
Copy link
Contributor

9/20: Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants