Camunda 7.6.0 failed on database created by 7.5.0

First of all, thanks a lot for the great workflow engine and the upgrade.

I am using the Camunda 7.5.0 with MySQL and it works great. Today the 7.6.0 has been released and I can’t wait to try. When I finished the upgrade and tested, the below error occurred when I tried to start a process.

Class
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
Message
Unknown column ‘STATE_’ in ‘field list’

The same code works well with 7.5.0 and we like to keep the current Camunda database. Is there any upgrade steps I just missed?

Any help would be appreciated.

Hi @GhostFox,

I advice you to read through the update guide before migrating to 7.6.0. There you can also find how to update your database so it works with camunda 7.6.0 as well.

Hope that helps :slight_smile:

Best,
Johannes

Hi @GhostFox,

Could you please attach the whole stacktrace and describe the steps you did during the upgrade to 7.6.0.

Cheers,
Christian

Thanks for all of your responses.

I am using the Camunda grails plugin and just changed the version in the BuildConfig.groovy file, grails upgraded all the jar files for me.

Looks like I have the database patch missed. I followed the url and just found the database script ended with ‘engine_7.4_patch_7.4.5_to_7.4.6.sql’. There’s no one I can use on 7.5 to 7.6.

A small part of the whole stacktrace goes below.

2016-11-30 18:34:14,705 [http-bio-8080-exec-5] ERROR engine.context - ENGINE-16004 Exception while closing command context: ENGINE-03004 Exception while executing Database Operation ‘INSERT HistoricProcessInstanceEventEntity[617]’ with message ’

Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘STATE_’ in ‘field list’

The error may involve org.camunda.bpm.engine.impl.persistence.entity.HistoricProcessInstanceEntity.insertHistoricProcessInstanceEvent-Inline

The error occurred while setting parameters

SQL: insert into ACT_HI_PROCINST ( ID_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_KEY_, PROC_DEF_ID_, START_TIME_, END_TIME_, DURATION_, START_USER_ID_, START_ACT_ID_, END_ACT_ID_, SUPER_PROCESS_INSTANCE_ID_, SUPER_CASE_INSTANCE_ID_, CASE_INST_ID_, DELETE_REASON_, TENANT_ID_, STATE_ ) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘STATE_’ in ‘field list’’. Flush summary:

[
INSERT HistoricVariableInstanceEntity[618]
INSERT HistoricVariableInstanceEntity[619]
INSERT HistoricVariableInstanceEntity[620]
INSERT HistoricTaskInstanceEventEntity[624]
INSERT HistoricProcessInstanceEventEntity[617]
INSERT HistoricActivityInstanceEventEntity[StartEvent_Prosecute_Label:621]
INSERT HistoricActivityInstanceEventEntity[Task_OnlineAccept:622]
INSERT HistoricActivityInstanceEventEntity[UserTask_InfoInput:623]
INSERT ExecutionEntity[617]
INSERT TaskEntity[624]
INSERT VariableInstanceEntity[618]
INSERT VariableInstanceEntity[619]
INSERT VariableInstanceEntity[620]
]

Hi,

Please download the full distribution of Camunda BPM from here. Any server will do. Then unarchive the file and look for the sql folder. You should find a file with following pattern $DATABASENAME_engine_7.5_to_7.6.sql in it. Execute the script using your favorite database tool to upgrade from 7.5 to 7.6 schema. Be sure to make a backup before etc.
The file can also be found on GitHub.
Because Camunda isn’t automatically upgrading your database, you have to do it manually.

Cheers,
Christian

Hi Christian,
Thanks for the tip. I just found mysql_engine_7.5_to_7.6.sql script under camunda-bpm-tomcat-7.6.0.zip\sql\upgrade.

When I ran this script on my local for testing, my local My SQL version is 5.7.16.0, the error occurred:

SQL Error [1060] [42S21]: Duplicate column name ‘DEC_REQ_KEY_’

SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE ACT_RE_DECISION_DEF
ADD DEC_REQ_ID_ varchar(64);

ALTER TABLE ACT_’ at line 11
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE ACT_RE_DECISION_DEF
ADD DEC_REQ_ID_ varchar(64);

ALTER TABLE ACT_’ at line 11

Any advice?

Latest Update:

  1. I ran the SQL Script with DBeaver 3.8.0, errors occurred, just like the detail in my last reply.
  2. I tried the sql statement one by one with DBeaver 3.8.0, no errors.
  3. I ran the SQL Script with MySQL Workbench 6.3.8, no errors at all.

Current progress: After running the sql upgrade script, everything works great.

BTW, there is another code update, new property called executionEntity introduced in the runtimeService.startProcessInstanceByKey() result. That’s the one I found.

Thanks all for your time and replies.

Interesting, we are also using DBeaver and haven’t been hit by this issue.
You shouldn’t use the property executionEntity as it doesn’t belong to the public API of Camunda.
Always use the returned interface methods of the results.

Cheers,
Christian

The RuntimeService.startProcessInstanceByKey method returns an instance of ProcessInstance. It contains four methods:

  1. getProcessDefinitionId
  2. getBusinessKey
  3. getCaseInstanceId
  4. isSuspended

Which would be the suggested way to get the process instance / execution id instead? Thanks.

The ProcessInstance interface extends the Execution interface by itself so it also has the methods getProcessInstanceId and the getId (which is the specific execution id).

Cheers

Update for the DBeaver:
Only Execute Script (ALT+X) works without errors. The others don’t. I am not sure why.

Hi

I am getting a similar error.I have been using 7.4.0 and I have’nt changed any thing with respect to camunda.
Can anyone help me out here,as I think this issue is not something which is related to camunda version upgrade.

Error:- Exception: org.camunda.bpm.engine.ProcessEngineException
org.camunda.bpm.engine.ProcessEngineException: ENGINE-03004 Exception while executing Database Operation ‘INSERT HistoricVariableInstanceEntity[78877]’ with message ’

Error updating database. Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column ‘NAME_’ at row 1

The error may involve org.camunda.bpm.engine.impl.persistence.entity.HistoricVariableInstanceEntity.insertHistoricVariableInstance-Inline

The error occurred while setting parameters

SQL: insert into ACT_HI_VARINST ( ID_, PROC_DEF_KEY_, PROC_DEF_ID_, PROC_INST_ID_, EXECUTION_ID_, ACT_INST_ID_, CASE_DEF_KEY_, CASE_DEF_ID_, CASE_INST_ID_, CASE_EXECUTION_ID_, TASK_ID_, NAME_, REV_, VAR_TYPE_, BYTEARRAY_ID_, DOUBLE_, LONG_, TEXT_, TEXT2_ ) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column ‘NAME_’ at row 1’. Flush summary:

[
INSERT HistoricVariableInstanceEntity[78802]

This points to the engine trying to persist a variable into the history, which name exceeds the field length of the NAME_ column. By default this is 255 chars.
Are you using a long variable name in your process?

Even I thought the same but, I am no where using a variable whose name length crosses 255 chars.Actually there was no such issue when I ran it some time back and I am 100 % sure that I havent changed anything for the next run.
If the variable ‘NAME_’ length can be the issue,where can I check this internally as I have cross checked all my variable names am using ? any pointers on this ?