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

Can not update an entity instance after specification change #128

Open
Gorynych opened this issue May 3, 2019 · 0 comments
Open

Can not update an entity instance after specification change #128

Gorynych opened this issue May 3, 2019 · 0 comments

Comments

@Gorynych
Copy link

Gorynych commented May 3, 2019

Steps to reproduce:

  • Create a specification for entity:

key: PRODUCT-ORDERING
name: { en: "Product ordering" }
isApp: true
isAbstract: false
dataSpec: |
{
"type": "object",
"title": "Data",
"properties": {
"client": {
"title": "Client",
"type": "string"
}
}
}

  • Validate & apply
  • Go to the Applications -> Product ordering menu, and create a new Product ordering entity instance
  • Then go back to specifications, and update the specification like this:

key: PRODUCT-ORDERING
name: { en: "Product ordering" }
isApp: true
isAbstract: false
dataSpec: |
{
"type": "object",
"title": "Product ordering information",
"properties": {
"client": {
"title": "Client",
"type": "object",
"properties": {
"firstName": {
"title": "First Name",
"type": "string"
},
"lastName": {
"title": "Last Name",
"type": "string"
}
}
}
}
}

  • Go to the Applications -> Product ordering menu, and try to edit existing entity with some value in at least one of fields

Current behavior:
Internal server error message.

Logs:

xm2local_entity-app.1.ti8yb0m5rja9@linuxkit-025000000001 | 17:49:26.504 [XNIO-2 task-24] ERROR org.hibernate.internal.ExceptionMapperStandardImpl - HHH000346: Error during managed flush [failed to parse [data.client]]
xm2local_entity-app.1.ti8yb0m5rja9@linuxkit-025000000001 | 2019-05-03 17:49:26,514 ERROR [XNIO-2 task-24] [45NHgcP4:xm:XM] ServiceLoggingAspect: srv:stop: XmEntityServiceImpl:save, error: org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:545) ... com.icthh.xm.commons.logging.aop.ServiceLoggingAspect.logBeforeService(ServiceLoggingAspect.java:68)... -> javax.persistence.RollbackException: Error while committing the transaction org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:77) ... com.icthh.xm.commons.logging.aop.ServiceLoggingAspect.logBeforeService(ServiceLoggingAspect.java:68)... -> MapperParsingException[failed to parse [data.client]]; nested: IllegalStateException[Can't get text on a START_OBJECT at 1:194]; org.elasticsearch.index.mapper.FieldMapper.parse(FieldMapper.java:298) -> java.lang.IllegalStateException: Can't get text on a START_OBJECT at 1:194 org.elasticsearch.common.xcontent.json.JsonXContentParser.text(JsonXContentParser.java:88), time = 211 ms

Expected behavior:
To be discussed, but not 500.

Either

  • specification should not be changed,
  • or migration should be provided,
  • or operator should confirm a data loss.
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

1 participant