Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-377

Init ran model validation is failing, error details are not provided

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Istanbul Release
    • Honolulu Release, Istanbul Release
    • CPS-Core
    • None

      Step to reproduce:

      • Run following REST request to retrieve RAN model:
      http://<host>:<port>/cps/api/v1/dataspaces/NFP-Operational/schema-sets/cps-ran-schema-model
      

      Expected result:

      • RAN model is provided
      • If ever the model is not valid, the detail about the validation error is provided in the response.

      Actual result:

      • The RAN model is not provided, retrieval is failing, the model is not valid.
      • The detail of the validation error is not provided in the response. It is in the logs.

      Actual response:

      {    
        "status": "400 BAD_REQUEST",    
        "message": "Yang resource is invalid.",    
        "details": "Yang syntax validation failed for resource cps-ran-schema-model2021-01-28.yang."
      }
      

      Actual logs:

      org.onap.cps.spi.exceptions.ModelValidationException: Yang resource is invalid.
      	at org.onap.cps.yang.YangTextSchemaSourceSetBuilder.generateSchemaContext(YangTextSchemaSourceSetBuilder.java:129)
      	at org.onap.cps.yang.YangTextSchemaSourceSetBuilder.build(YangTextSchemaSourceSetBuilder.java:64)
      	at org.onap.cps.yang.YangTextSchemaSourceSetBuilder.of(YangTextSchemaSourceSetBuilder.java:69)
      	at org.onap.cps.api.impl.YangTextSchemaSourceSetCache.get(YangTextSchemaSourceSetCache.java:54)
      
      Caused by: org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException: extraneous input ',' expecting {SEP, DQUOT_STRING, SQUOT_STRING, DQUOT_END, SQUOT_END} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 492 character 41
      extraneous input '(Comma)' expecting {SEP, DQUOT_STRING, SQUOT_STRING, DQUOT_END, SQUOT_END} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 492 character 43
      extraneous input 'and' expecting {SEP, DQUOT_STRING, SQUOT_STRING, DQUOT_END, SQUOT_END} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 492 character 51
      extraneous input 'space' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 492 character 61
      extraneous input 'Attribute' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 493 character 11
      extraneous input 'can' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 493 character 27
      extraneous input 'the' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 493 character 39
      extraneous input 'characters' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 493 character 53
      extraneous input 'they' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 493 character 67
      extraneous input 'excaped' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 494 character 11
      extraneous input '>' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 494 character 22
      extraneous input '<' expecting {';', '{', SEP} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 494 character 24
      extraneous input ' + , (Comma) and White space\n       The Attribute value can contain control characters if its an escaped\n       double digit hex number.\n       Examples could be\n       UID=nobody@example.com,DC=example,DC=com\n       CN=John Smith,OU=Sales,O=ACME Limited,L=Moab,ST=Utah,C=US' expecting {'}', SEP, IDENTIFIER} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 494 character 29
      extraneous input '<EOF>' expecting {'}', SEP, IDENTIFIER} in source RevisionSourceIdentifier [name=cps-ran-schema-model2021-01-28.yang] on line 1298 character 4
      	at org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangErrorListener.validate(YangErrorListener.java:62)
      	at org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.parseYangSource(YangStatementStreamSource.java:171)
      	at org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.parseYangSource(YangStatementStreamSource.java:154)
      	at org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.create(YangStatementStreamSource.java:73)
      	at org.onap.cps.yang.YangTextSchemaSourceSetBuilder.generateSchemaContext(YangTextSchemaSourceSetBuilder.java:123)
      	... 124 common frames omitted
      
      

      Note:
      This is 2 issues for this bug, they could be split in 2 different bugs if needed.

            brusak brusak
            brusak brusak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: