Error Attempting to Apply Attribute Converter

On a live server we have recently received many errors of: 

2022-03-24 18:14:26.008 +0000 SEVERE: org.restlet.Component.BonitaRestletApplication Exception or error caught in server resource
org.bonitasoft.engine.exception.BonitaRuntimeException: USERNAME= | org.bonitasoft.engine.commons.exceptions.SRetryableException: javax.persistence.PersistenceException: Error attempting to apply AttributeConverter

...

Caused by: java.lang.RuntimeException: Database date & time format must be ISO-8601 compliant ( yyyy-mm-ddThh:mm:ss )
        at org.bonitasoft.engine.business.data.generator.DateAndTimeConverter.convertToEntityAttribute(DateAndTimeConverter.java:46)
        at org.bonitasoft.engine.business.data.generator.DateAndTimeConverter.convertToEntityAttribute(DateAndTimeConverter.java:27)
        at org.hibernate.type.descriptor.converter.AttributeConverterSqlTypeDescriptorAdapter$2.doConversion(AttributeConverterSqlTypeDescriptorAdapter.java:142)
        ... 150 more
Caused by: java.time.format.DateTimeParseException: Text '2022-01-17' could not be parsed at index 10
        at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046)
        at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1948)
        at java.base/java.time.LocalDateTime.parse(LocalDateTime.java:492)
        at org.bonitasoft.engine.business.data.generator.DateAndTimeConverter.convertToEntityAttribute(DateAndTimeConverter.java:44)

However, the processes worked previously without any issues, so I don't believe it to be a BDM/form/contract issue. 

Tasks have also been getting completed and then 'reset' to an earlier task. I am worried about the communication between DB and server. 

I restarted the server already but it has not resolved the issue. 

Any help on this is greatly appreciated. 

1 Like

Hi,

The type used to store the date must have been changed from LocalDate to LocalDateTime at some point. It needs a database migration in order to have a proper LocalDateTime format in database (yyyy-mm-ddThh:mm:ss).

HTH
Romain

But in the BDM it is stored as Date Only, same for Contract/Form. And in the DB it's only been stored this way too?
How would a database migration solve this issue? 

Thanks

If the LocalDateTime converter is triggered, it is because the attribute in the BDM has a DATE-TIME type (at least the deployed version). If you are the administrator of the production, you may retrieve the deployed BDM to double-check.

You can find the generated BDR jar file here:

server/temp/bonita_engine_151728@r<HOSTNAME>/platform/classloaders/local/TENANT/1/engine-classloader<TIMESTAMP>/BDR<TIMESTAMP>.jar

The bom.xml is at the root of the jar file.

Also, it could help to identify what action triggers that exception in your workflow.

This is such useful info, thank you!!!!