OptimisticLockingFailureException Error When Connecting to SQL Server Database

39 views
Skip to first unread message

Sean McGurk

unread,
Apr 8, 2025, 6:40:31 AM4/8/25
to rundeck-discuss
Hi there,

I have created a containerised version of Rundeck that runs version  v5.10.0

This connects to an external SQL server database 

I am able to log in to the server but when I try and view my profile information, I get the following error message:

[2025-04-08T09:48:29,057] WARN  providers.GormUserDataProvider - registerLogin: for tkyle, caught OptimisticLockingFailureException: org.springframework.orm.hibernate5.HibernateOptimisticLockingFailureException: Object of class [rundeck.User] with identifier [83]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [rundeck.User#83]

When I swap this out for an in-memory database (i.e. the embedded h2 database), no such error occurs.

Has anyone experienced a similar error and if so, how did they go about resolving it?


Sean McGurk

unread,
Apr 8, 2025, 6:43:12 AM4/8/25
to rundeck-discuss
Rundeck container configuration:

  rpa01-rundeck:
    image: rundeck/ci:enh-jetty-combined-ignore-roles
    volumes:
      - RPA01:/chef-rundeck-files
      - rpa01-data:/home/rundeck/server/data
      - ./domains/RPA01/admin.aclpolicy:/home/rundeck/etc/admin.aclpolicy
      - ./domains/RPA01/realm.properties:/home/rundeck/server/config/realm.properties
      #  Mounts container logs to vm host, needs to be created before compose deploy
      - /home/buildadm/RPA01/logs:/home/rundeck/server/logs
      - ./domains/RPA01/log4j2.properties:/etc/remco/templates/log4j2.properties
    environment:
      RUNDECK_GRAILS_URL: https://prsurundeck.rpa01.com
      RUNDECK_SERVER_FORWARDED: "true"
      RUNDECK_DATABASE_DRIVER: com.microsoft.sqlserver.jdbc.SQLServerDriver
      RUNDECK_DATABASE_USERNAME: SQL-SA-OL-RUNDECK-RPA01
      RUNDECK_DATABASE_PASSWORD: ${RPA01_RUNDECK_DB_PASSWORD}
      RUNDECK_DATABASE_URL: jdbc:sqlserver://SQLServerHost;DatabaseName=RundeckDB_RPA01_DAA_10291;autoReconnect=true;useSSL=false
      RUNDECK_JAAS_LDAP_providerUrl: ldaps://ldaphost:636
      RUNDECK_JAAS_LDAP_bindPassword: asdasdasd

rac...@rundeck.com

unread,
Apr 8, 2025, 9:41:33 AM4/8/25
to rundeck-discuss

Hi

Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [rundeck.User#83]

It seems the database is modified manually or by another instance/app, can you double-check this?

The “Row was updated or deleted by another transaction” problem in the Spring Boot context is frequently caused by an inconsistency between the ID field in your request object and Hibernate’s expectations (Spring Boot and Hibernate are part of Rundeck).

I’ve tested Rundeck 5.10 against SQL Server successfully using the following basic docker-compose:

services: rundeck: image: rundeck/rundeck:5.10.0 environment: RUNDECK_GRAILS_URL: http://localhost:4440 RUNDECK_DATABASE_DRIVER: com.microsoft.sqlserver.jdbc.SQLServerDriver RUNDECK_DATABASE_USERNAME: sa RUNDECK_DATABASE_PASSWORD: ASDasd11-- RUNDECK_DATABASE_URL: jdbc:sqlserver://mssql:1433;DatabaseName=tempdb tty: true ports: - 4440:4440 mssql: image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu expose: - 1434 environment: - ACCEPT_EULA=Y - SA_PASSWORD=ASDasd11-- - MSSQL_PID=Express - MYSQL_PASSWORD=rundeck

Regards!

Reply all
Reply to author
Forward
0 new messages