DMTF/Redfish-Mockup-Creator

Could not scan not well-formed: invalid token

wushuzh opened this issue · 7 comments

Hi,

I tried to generate a redfish server for my server, and the following is the output.

I wonder if there is something wrong with my server redfish implementation or the creator meets some unexpected scenario.

If it's possible for creator to ignore some error and try its best effort to get as much information as possible ?

Redfish Mockup Creator, Version 1.0.9
Address: https://172.29.125.80
Full Output Path: C:\Users\wushuzh\code\Redfish-Mockup-Creator\test
Description:
Starting mockup creation...
Getting /redfish...
Getting /redfish/v1/odata...
Getting /redfish/v1/$metadata...
ERROR: Could not scan '/redfish/v1/$metadata': not well-formed (invalid token): line 1, column 0
Getting /redfish/v1...
Getting /redfish/v1/Systems...
ERROR: Could not save '/redfish/v1/Systems': Expecting value: line 1 column 1 (char 0)
Getting /redfish/v1/Chassis...
ERROR: Could not save '/redfish/v1/Chassis': Expecting value: line 1 column 1 (char 0)
Getting /redfish/v1/Managers...
ERROR: Could not save '/redfish/v1/Managers': Expecting value: line 1 column 1 (char 0)
Getting /redfish/v1/SessionService...
ERROR: Could not save '/redfish/v1/SessionService': Expecting value: line 1 column 1 (char 0)
Getting /redfish/v1/AccountService...
ERROR: Could not save '/redfish/v1/AccountService': Expecting value: line 1 column 1 (char 0)
Getting /redfish/v1/EventService...
Getting /redfish/v1/UpdateService...
ERROR: Could not save '/redfish/v1/UpdateService': Expecting value: line 1 column 1 (char 0)
Getting /redfish/v1/SessionService/Sessions...
ERROR: Could not save '/redfish/v1/SessionService/Sessions': Expecting value: line 1 column 1 (char 0)
Completed mockup creation!

Here is the output folder structure.

test
├── README
└── redfish
    ├── index.json
    └── v1
        ├── AccountService
        ├── Chassis
        ├── EventService
        │   └── index.json
        ├── index.json
        ├── Managers
        ├── $metadata
        │   └── index.xml
        ├── odata
        │   └── index.json
        ├── SessionService
        │   └── Sessions
        ├── Systems
        └── UpdateService

12 directories, 6 files

Those sorts of errors happen when the GET response contains a malformed response. Can you show the responses from the failed resources using curl?

I bumped into the exact same problem against an HPE Moonshot Chassis Manager (V 2.0-b176) and here are different queries with associated responses. Curl and the redfishtool raw GET /redfish/v1/$metadata seem to have no problem while redfishtool metadata reports a 406 error.

Here is the details of the different commands and attached outputs:

curl --insecure --basic --raw --silent --user ${User}:${Password} --request GET 'https://10.3.150.168/redfish/v1/$metadata' > 1-curl-raw.txt

curl --insecure --basic --include --raw --silent --user ${User}:${Password} --request GET 'https://10.3.150.168/redfish/v1/$metadata' > 2-curl-include-raw.txt`

redfishtool -v -v -v -v -v -r 10.3.150.168 -u $User -p $Password metadata &> 3-redfishtool-5v-metadata.txt

redfishtool -r 10.3.150.168 -u $User -p $Password raw GET '/redfish/v1/$metadata' > 4-redfishtool-rawGET.txt

Let me know if you want me to perform other tests...

1-curl-raw.txt
2-curl-include-raw.txt
3-redfishtool-5v-metadata.txt
4-redfishtool-rawGET.txt

I think specifically with redfishtool, it's not going to be forgiving when it comes to the response encoding; I think redfishtool is always adding Accept-Encoding: , and leaving the value blank (which as far as I can tell usually gets interpreted as "do not encode").

Are you getting the same sort of error with the mockup creator, or is your issue specific with using redfishtool?

Humm, I just realized that the error found by wushuzh and myself 10 days ago, disappeared on my system after a FW update and re-appeared just now. Hence the outputs I posted above may not be accurate.

I suspect that my Redfish service is faulty. I'll need some time to validate this assumption as this system is in production and I cannot perform a reset right now....

After a fresh reset of the Redfish Service, I confirm that the error mentioned in this issue (invalid token during the GET of $metadata) is not present the first time I launch the Mockup Creator. However, it appears the second time !

Hence, the Redfish Service is faulty; it does not support being queried by the Mockup Creator. I'll report this to the developers as well as some other errors.

@wushuzh, I'd suggest 2 things to progress:

  1. Verify that line 161 of the Mockup Creator 1.0.9 looks like this:
    resource = redfish_obj.get( uri, headers = { "Accept-Encoding": "*" } )
  2. Perform a reset of your Redfish service just before launching the Mockup Creator

@wushuzh any progress on the requests for additional info to confirm this is a service-side issue?

I think it would be reasonable to provide this type of information in the output to help with debugging though; I can make an enhancement for that.

Closing; no updates provided to continue debugging what's going on. Please reopen if the issue persists.