Not being able to delete a process instance

When I am trying to delete this process instance via web browser or api I am getting the following error:


In the server logs (catalina.out) this is the exception I am seeing:

Caused by: org.apache.ibatis.exceptions.PersistenceException:
Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server did not return a response. The connection has been closed.
The error may exist in org/camunda/bpm/engine/impl/mapping/entity/HistoricActivityInstance.xml
The error may involve org.camunda.bpm.engine.impl.persistence.entity.HistoricActivityInstanceEntity.selectHistoricActivityInstanceEvent-Inline
The error occurred while setting parameters
SQL: select HAI.START_TIME_ from ACT_HI_ACTINST HAI where HAI.ID_ = ?
Cause: com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server did not return a response. The connection has been closed.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.lambda$selectById$2(DbSqlSession.java:122)
at org.camunda.bpm.engine.impl.util.ExceptionUtil.doWithExceptionWrapper(ExceptionUtil.java:350)
… 107 more
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server did not return a response. The connection has been closed.
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3151)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3140)
at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:6603)
at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:7760)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:600)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:524)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7375)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3206)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:247)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:222)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(SQLServerPreparedStatement.java:505)
at jdk.internal.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:118)
at com.sun.proxy.$Proxy7.execute(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
at org.apache.ibatis.executor.BatchExecutor.doQuery(BatchExecutor.java:92)

I have checked the connection between Camunda and my sql server and everything seems to be fine. Not sure how to resolve this issue.

Hello my friend!

From the error that is occurring in Camunda, it appears that you are trying to delete an instance that has already been completed in the process.

Check by the instance id if it has not already been terminated.

As for the log presented, it doesn’t tell us much… as it could be a database connection failure, connection timeout, JDBC driver, among other problems…

:confused:

William Robert Alves