Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime bundle fails to start the first time it runs #3015

Closed
miguelruizdev opened this issue Nov 29, 2019 · 0 comments
Closed

Runtime bundle fails to start the first time it runs #3015

miguelruizdev opened this issue Nov 29, 2019 · 0 comments
Assignees
Milestone

Comments

@miguelruizdev
Copy link
Contributor

@miguelruizdev miguelruizdev commented Nov 29, 2019

From @daedmunoz:

It occurs when using PostgreSQL and the TTC example.

Short description:
The first time the application runs it fails to deploy the processes (due to missing columns in ACT_RE_DEPLOYMENT table).
If you restart the app, it updates the table (adds the columns PROJECT_RELEASEVERSION and VERSION_) and the processes are deployed correctly.

What is the correct way to fix this? I think that it could be fixed by adding those columns in org/activiti/db/create/activiti.postgres.create.engine.sql file.

Details:
Activiti version: 7.1.169 (Also happens in 7.1.0.M5)
PostgreSQL 11.3
Java 11

Steps to reproduce:
Clone the repo of the TTC English Campaign: repo: https://github.com/Activiti/ttc-rb-english-campaign
Connect to a PostgreSQL database
Run the application.
What should happen? Deploy the processes
What is happening? It throws the following error

org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: column "version_" of relation "act_re_deployment" does not exist
  Position: 103
### The error may involve org.activiti.engine.impl.persistence.entity.DeploymentEntityImpl.insertDeployment-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RE_DEPLOYMENT(ID_, NAME_, CATEGORY_, KEY_, TENANT_ID_, DEPLOY_TIME_, ENGINE_VERSION_, VERSION_, PROJECT_RELEASE_VERSION_)     values(?, ?, ?, ?, ?, ?, ?, ?, ?)
### Cause: org.postgresql.util.PSQLException: ERROR: column "version_" of relation "act_re_deployment" does not exist
  Position: 103
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
        at org.activiti.engine.impl.db.DbSqlSession.flushRegularInsert(DbSqlSession.java:787)
        at org.activiti.engine.impl.db.DbSqlSession.flushInsertEntities(DbSqlSession.java:662)
        at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:642)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:525)
        at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:237)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:102)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:68)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:29)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:44)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:39)
        at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:82)
        at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:233)
        at org.activiti.spring.autodeployment.NeverFailAutoDeploymentStrategy.deployResources(NeverFailAutoDeploymentStrategy.java:46)
        at org.activiti.spring.SpringProcessEngineConfiguration.autoDeployResources(SpringProcessEngineConfiguration.java:128)
        at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:81)
        at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:57)```

The create SQL scripts should reflect the latest state of all the applied update scripts.
Currently, it's missing the latest changes adding the columns VERSION_ and PROJECT_RELEASE_VERSION_ to the ACT_RE_DEPLOYMENT table.
@miguelruizdev miguelruizdev self-assigned this Nov 29, 2019
@erdemedeiros erdemedeiros added this to the 7.1.0.M6 milestone Nov 29, 2019
@erdemedeiros erdemedeiros added this to Open in Activiti 7.x via automation Nov 29, 2019
Activiti 7.x automation moved this from Open to Closed Nov 29, 2019
@erdemedeiros erdemedeiros changed the title Updates to engine database scripts Runtime bundle fails to start the first time it runs Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Activiti 7.x
  
Closed
2 participants
You can’t perform that action at this time.