Turn off History in Camunda

Hi,
I’m trying to turn off history inside the standalone.xml by changing the <history-level>full</history-level> to <history-level>none</history-level>. But i keep getting this error.

ERROR [org.camunda.bpm.engine.context] (ServerService Thread Pool -- 62) ENGINE-16004 Exception while closing command context: historyLevel mismatch: configuration says HistoryLevelNone(name=none, id=0) and database says HistoryLevelFull(name=full, id=3): org.camunda.bpm.engine.ProcessEngineException: historyLevel mismatch: configuration says HistoryLevelNone(name=none, id=0) and database says HistoryLevelFull(name=full, id=3)
at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.checkHistoryLevel(SchemaOperationsProcessEngineBuild.java:109)
at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:62)
at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:35)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.camunda.bpm.engine.impl.ProcessEngineImpl.executeSchemaOperations(ProcessEngineImpl.java:126)
at org.camunda.bpm.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:98)

Can someone point me to the right direction for turning off the history in camunda.

FYI- i’m currently using camunda-bpm-ee-wildfly10-7.6.0-ee.

Hi,

From the docs on history…

Note that when using the default history backend, the history level is stored in the database and cannot be changed later.

What has hapened is on startup when the DB schema was created, the history level in the DB was set to the configured value. To change this you need to update the value stored in the DB.

From memory, there is a table ACT_GE_PROPERTY. This is a table of name value pairs. Query the table and there should be an entry for history level. You need to change the value to the history level you desire.

NOTE: I have done this in test and dev environments. I would seek Camunda advice before performing this hack in a prod environment.

regards

Rob

2 Likes

Hi Rob,
Thanks for your suggestion. I have made changes to the act_ge_property table inside the DB i.e I’ve changed the history level from 3 to 0 and restarted the Camunda server but still getting a similar error.
ERROR [org.camunda.bpm.engine.context] (ServerService Thread Pool -- 63) ENGINE-16004 Exception while closing command context: historyLevel mismatch: configuration says HistoryLevelNone(name=none, id=0) and database says HistoryLevelFull(name=full, id=3): org.camunda.bpm.engine.ProcessEngineException: historyLevel mismatch: configuration says HistoryLevelNone(name=none, id=0) and database says HistoryLevelFull(name=full, id=3) at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.checkHistoryLevel(SchemaOperationsProcessEngineBuild.java:109) at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:62) at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:35) at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104) at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) at org.camunda.bpm.engine.impl.ProcessEngineImpl.executeSchemaOperations(ProcessEngineImpl.java:126) at org.camunda.bpm.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:98) at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:650)

Is there any other property that needs to be changed inside the DB?

Sai

Hi @steja_d,

which query did you execute on your database?

Cheers,
Askar

Hi @aakhmerov,

     SELECT * FROM camunda_db.act_ge_property;

Regards
Sai

@steja_d,

I assume you have to execute something like
UPDATE ACT_GE_PROPERTY SET VALUE_ = '0' WHERE NAME_ = 'historyLevel';

Please note that this is not a supported change and you perform it at your own risk. Data in historic tables might get corrupted.

Cheers,
Askar.

@aakhmerov,
I have updated the value but it’s not fixing the exception.

BTW I’m trying to do this in my local system. Can you suggest me the Safe way to turn off the history?

Regards,
Sai

If this is local, is it important to you to preserve the current table contents? If not, wipe the database schema, configure Camunda with history level none and you’re good to go!

1 Like

@thorben,
That worked, Thanks.

Now, what should I do if I want to turn off the history in dev and prod environment safely without breaking anything?

Strictly speaking, you can’t. There is no Camunda feature that allows you to do so once you have data in the Camunda tables. The hints @aakhmerov and @Webcyberrob are how you can hack this at your own risk. If this does not work out for you, I suggest you try to debug the Camunda code and understand what the history level check is based on and why it still fails.

Just a thought, but you have to modify both the database entry AND whatever configuration file entry controls that. In WildFly, you must set the tag to “none”, “audit”, “full”, etc. You must also set the corresponding value in the database table as mentioned above.

I saw this because I was going to ask if this is supported or not and I guess I’ll have to ask “formally”.

I was trying the same & getting exception. May be this will help someone those all getting these exceptions. As suggested you have to change in both database & the configuration file that controls that.

Example :

ProcessEngineConfiguration.setHistory(“none”); //This can be “none”, “audit”, “full”, etc as suggested by mppfor_manu
and also db you have to set “historyLevel” = 0 on ACT_GE_PROPERTY table.