Error on creating license

Description

On attempting to create a license an error was shown in the browser.

The call was (using Curl):

curl 'https://folio-testing-okapi.aws.indexdata.com/licenses/licenses' -H 'Sec-Fetch-Mode: cors' -H 'Origin: https://folio-testing.aws.indexdata.com' -H 'X-Okapi-Tenant: diku' -H 'X-Okapi-Token: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJkaWt1X2FkbWluIiwidXNlcl9pZCI6ImYxM2JiMmFkLTllMzctNTI2ZS1hZjU0LTFlZDEwOGE1M2UxMCIsImlhdCI6MTU3MTM5NjcwOSwidGVuYW50IjoiZGlrdSJ9.-Rzge-k-ieAjqgX13ifqhgeQjTb6enbxxV3fxOXjLWM' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Referer: https://folio-testing.aws.indexdata.com/licenses/create?sort=name&filters=status.Active' --data-binary '{"status":"active","type":"local","customProperties":{"authorisedUsers":"","concurrentAccess":"","walkInAccess":"","remoteAccess":"","illElectronic":"","illSecureElectronic":"","illPrint":"","reservesElectronic":"","coursePackElectronic":"","coursePackPrint":"","copyDigital":"","copyPrint":"","undefined":[{"_delete":true}],"scholarlySharing":[{"value":"permitted_(interpreted)"}]},"name":"OS Test License 1","startDate":"2019-10-01","contacts":[{"user":"e546d50a-926a-421f-8400-a041a2e9db79","role":"authorised_signatory"}],"orgs":[{"org":{"name":"Alexander Street Press","orgsUuid":"11fb627a-cdf1-11e8-a8d5-f2801f1b9fd1"},"role":"licensor"}],"docs":[{"_delete":false,"name":"Doc 1","location":"FC1"}],"supplementaryDocs":[{"_delete":false,"name":"Supplement 1","location":"FC1"}],"id":"045f6296-da43-4dfb-9841-09b6d888279a"}' --compressed

Error was:

{{
{
"total": 3,
"_embedded": {
"errors": [
{
"message": "Property customProperties is type-mismatched",
"path": "",
"_links": {
"self": {
"href": "https://folio-testing-okapi.aws.indexdata.com:8080"
}
}
},
{
"message": "Property type is type-mismatched",
"path": "",
"_links": {
"self": {
"href": "https://folio-testing-okapi.aws.indexdata.com:8080"
}
}
},
{
"message": "Property status is type-mismatched",
"path": "",
"_links": {
"self": {
"href": "https://folio-testing-okapi.aws.indexdata.com:8080"
}
}
}
]
}
}

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Tino R. December 18, 2019 at 12:18 PM

actually i was able to reproduce this error with current folio-testing (mod-licenses-2.1.0-SNAPSHOT.115)

prerequisites:

  • "customProperties" needs to be present with a picklist value

  • Multiple requests need to be made in parallel

result:

  • you will see some requests completing with 201

  • and some failing with 422:

{ "total":2, "_embedded":{ "errors":[ { "message":"Property customProperties is type-mismatched", "path":"", "_links":{ "self":{ "href":"https://folio-testing-okapi.aws.indexdata.com:8080" } } }, { "message":"Property status is type-mismatched", "path":"", "_links":{ "self":{ "href":"https://folio-testing-okapi.aws.indexdata.com:8080" } } } ] } }

you can reproduce by adapting following bash script:

#!/bin/bash PAYLOAD='{"status":"active","type":"local","customProperties":{"illElectronic":[{"value":"permitted_(explicit)"}]},"name":"Test"}' TOKEN="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJkaWt1X2FkbWluIiwidXNlcl9pZCI6IjQ2NjQ2ZDc4LWZlYWYtNWIxMC1iMmQ1LTUyZDg2Njg5ZmIwOCIsImlhdCI6MTU3NjY3MDE4NywidGVuYW50IjoiZGlrdSJ9.8vkyuPtMhh5Qv_1HAweo5bmJuI0tO9a4rixLA7ym6cI" CMD="curl --request POST \ --url https://folio-testing-okapi.aws.indexdata.com/licenses/licenses \ --header 'content-type: application/json' \ --header 'x-okapi-tenant: diku' \ --header 'x-okapi-token: $TOKEN' \ --data '$PAYLOAD' -w '\n'" for i in {1..5} do eval $CMD& done

steve.osguthorpe October 18, 2019 at 1:42 PM

Lots of "Unknown macro:" entries in the actual JSON. Looks like this happened in the UI?

Cannot Reproduce

Details

Assignee

Reporter

Priority

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created October 18, 2019 at 11:45 AM
Updated February 10, 2020 at 12:07 PM
Resolved October 30, 2019 at 2:37 PM
TestRail: Cases
TestRail: Runs