aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

Creating a schema with incorrect version format gives cryptic error

Open TimoGlastra opened this issue 4 years ago • 0 comments

When creating a schema with the following body:

{
  "attributes": [
    "version_error"
  ],
  "schema_name": "version_error",
  "schema_version": "1"
}

You get the following error:

400: Ledger rejected transaction request: client request invalid: InvalidClientRequest('Vv7QMiUXbDpih8UScbGU2t', 1624871155011887378, 'validation error [GetSchemaField]: invalid number of parts 1, should contain 2 or 3 (version=1)').

This means you cannot just have a single digit as the schema version, but it must have at least one . in it, and optionally, two. (so either 1.0 or 1.0.0). I'm happy I found the following medium article: https://noha-abuaesh.medium.com/reason-client-request-invalid-invalidclientrequest-errors-when-writing-to-a-hyperledger-ee4ac680a409 because I was a bit lost at what it means.

~~Apparently this also triggered a shutdown of the agent:~~

animo-faber-acapy_1  | 2021-06-21 11:50:24,772 aries_cloudagent.core.conductor ERROR Shutdown on ledger error Ledger rejected transaction request: client request invalid: InvalidClientRequest('Vv7QMiUXbDpih8UScbGU2t', 1624276224665242884, 'validation error [GetSchemaField]: invalid number of parts 1, should contain 2 or 3 (version=1)')

~~I thought maybe we could add a simple regex or something to ACA-Py preventing the ledger rejection and shutdown~~

Update: the shutdown was caused by aries-toolbox: https://github.com/hyperledger/aries-acapy-plugin-toolbox/issues/73

TimoGlastra avatar Jun 28 '21 09:06 TimoGlastra