Tomcat error: org.springframework.dao.DuplicateKeyException

Dear All,

I am getting following error in the logs of the Tomcat 8. Any clues as to what may be causing the issue in Aggregte Server?

Caused by: org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT INTO odk_prod._security_revisions ( _URI, _CREATOR_URI_USER, _CREATION_DATE, _LAST_UPDATE_URI_USER, _LAST_UPDATE_DATE, LAST_REVISION ) VALUES ( ?, ?, ?, ?, ?, ? ) ]; Duplicate entry 'rid:registered_users' for key '_URI'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'rid:registered_users' for key '_URI'
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:649)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:870)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:931)
at org.opendatakit.common.persistence.engine.mysql.DatastoreImpl.putEntity(DatastoreImpl.java:1029)

At the moment, all submissions are unable to complete and giving 500 error on the android.

Thanks!

Ayub

1 Like

I'd love to help, but your post does not contain enough information for me to answer your question. So, with that in mind, can you answer these questions?

  1. What version of Aggregate are you using?
  2. What steps can we take to reproduce the problem?
  3. What you have you tried to fix the problem?
  4. Anything else we should know or have? If you have a test form or screenshots or logs, please attach.

Hello Yaw,

I don't really understand how it occurred, everything was going just fine a day earlier.

Aggregate version is v1.4.15 Production.

I have to remove multiple entries of "rid:registered_users" in the _URI column of the _security_revisions table (until there was just one for the admin). Once done, it was all good and back to normal.

Thanks !

1 Like