Flowable Docker Deployment Error : unknown version from database

I’m using a modified version of Flowable docker configuration modeler-task-idm-admin-postgres.yml.
And I’m getting the following error. (It has been running without issue for months, and this issue started happening only few days back).
I have tried to delete the docker volume for postgres and restart but did not solve the issue.

flowable-task | Caused by: org.flowable.common.engine.api.FlowableException: Could not update Flowable database schema: unknown version from database: '6.5.0.6'

Below is my docker compose yml:

version: '3.6'
services:
    flowable-modeler-app:
        image: flowable/flowable-modeler
        container_name: flowable-modeler
        depends_on:
            - flowable-db
            - flowable-idm-app
            - flowable-task-app
        environment:
            - SERVER_PORT=8888
            - SPRING_DATASOURCE_DRIVER-CLASS-NAME=org.postgresql.Driver
            - SPRING_DATASOURCE_URL=jdbc:postgresql://flowable-db:5432/flowable
            - SPRING_DATASOURCE_USERNAME=flowable
            - SPRING_DATASOURCE_PASSWORD=flowable
            - FLOWABLE_COMMON_APP_IDM-URL=http://flowable-idm-app:9090/flowable-idm
            - FLOWABLE_COMMON_APP_IDM-REDIRECT-URL=http://${HOSTNAME}:9090/flowable-idm
            - FLOWABLE_COMMON_APP_IDM-ADMIN_USER=flowLdap
            - FLOWABLE_COMMON_APP_IDM-ADMIN_PASSWORD=test
            - FLOWABLE_MODELER_APP_DEPLOYMENT-API-URL=http://flowable-task-app:9999/flowable-task/app-api
        ports:
            - 9091:8888
        entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "app.war"]
    flowable-task-app:
        build: 
            context: .
            network: host
        container_name: flowable-task
        depends_on:
            - flowable-db
            - flowable-idm-app
        environment:
            - SERVER_PORT=9999
            - SPRING_DATASOURCE_DRIVER-CLASS-NAME=org.postgresql.Driver
            - SPRING_DATASOURCE_URL=jdbc:postgresql://flowable-db:5432/flowable
            - SPRING_DATASOURCE_USERNAME=flowable
            - SPRING_DATASOURCE_PASSWORD=flowable
            - FLOWABLE_COMMON_APP_IDM-URL=http://flowable-idm-app:9090/flowable-idm
            - FLOWABLE_COMMON_APP_IDM-REDIRECT-URL=http://${HOSTNAME}:9090/flowable-idm
            - FLOWABLE_COMMON_APP_IDM-ADMIN_USER=flowLdap
            - FLOWABLE_COMMON_APP_IDM-ADMIN_PASSWORD=test
            - AAAAA_ENDPOINT=https://abc.com/aaa
            - BBBB_ENDPOINT=https://abc.com/bbb
            - CCC_ENDPOINT=https://abc.com/ccc
            - DDDD_ENDPOINT=https://abc.com/ddd
        ports:
            - 9999:9999
        entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-cp app.war", "-Dflowable.experimental.debugger.enabled=true", "-Dloader.path=app.war!/WEB-INF/classes/,app.war!/WEB-INF/,flowable-poc-1.0-SNAPSHOT.jar", "org.springframework.boot.loader.PropertiesLauncher"]
    flowable-idm-app:
        image: flowable/flowable-idm
        container_name: flowable-idm
        depends_on:
            - flowable-db
        environment:
            - SERVER_PORT=9090
            - SPRING_DATASOURCE_DRIVER-CLASS-NAME=org.postgresql.Driver
            - SPRING_DATASOURCE_URL=jdbc:postgresql://flowable-db:5432/flowable
            - SPRING_DATASOURCE_USERNAME=flowable
            - SPRING_DATASOURCE_PASSWORD=flowable
            #Default LDAP Admin User
            - FLOWABLE_IDM_APP_ADMIN_USER_ID=admin
            - FLOWABLE_IDM_APP_ADMIN_PASSWORD=admin
            - FLOWABLE_IDM_APP_ADMIN_FIRST_NAME=admin
            - FLOWABLE_COMMON_APP_IDM_ADMIN_USER=admin
            - FLOWABLE_COMMON_APP_IDM_ADMIN_PASSWORD=admin
            #FLowable-Ldap Configuration
            - FLOWABLE_IDM_LDAP_ENABLED=true
            - FLOWABLE_IDM_LDAP_SERVER=ldap://abc.com
            - FLOWABLE_IDM_LDAP_PORT=389
            - FLOWABLE_IDM_LDAP_USER=cn=admin,dc=abc,dc=com
            - FLOWABLE_IDM_LDAP_PASSWORD=admin
            - FLOWABLE_IDM_LDAP_BASE_DN=dc=abc,dc=com
            #Users
            - FLOWABLE_IDM_LDAP_USER_BASE_DN=ou=country,dc=abc,dc=com
            - FLOWABLE_IDM_LDAP_QUERY_USER_BY_FULL_NAME_LIKE=(&(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))
            - FLOWABLE_IDM_LDAP_QUERY_USER_BY_ID=(&(objectClass=inetOrgPerson)(uid={0}))
            - FLOWABLE_IDM_LDAP_QUERY_ALL_USERS=(objectClass=inetOrgPerson)
            - FLOWABLE_IDM_LDAP_ATTRIBUTE_USER_ID=uid
            - FLOWABLE_IDM_LDAP_ATTRIBUTE_FIRST_NAME=cn
            - FLOWABLE_IDM_LDAP_ATTRIBUTE_LAST_NAME=sn
            #Groups
            - FLOWABLE_IDM_LDAP_GROUP_BASE_DN=ou=groups,dc=abc,dc=com
            - FLOWABLE_IDM_LDAP_QUERY_GROUPS_FOR_USER=(&(objectClass=posixGroup)(gidNumber={0}))
            - FLOWABLE_IDM_LDAP_QUERY_ALL_GROUPS=(objectClass=posixGroup)
            - FLOWABLE_IDM_LDAP_QUERY_GROUP_BY_ID=(&(objectClass=posixGroup)(gidNumber={0}))
            - FLOWABLE_IDM_LDAP_ATTRIBUTE_GROUP_ID=gidNumber
            - FLOWABLE_IDM_LDAP_ATTRIBUTE_GROUP_NAME=cn
            - FLOWABLE_IDM_LDAP_CACHE_GROUP_SIZE=10000
            - FLOWABLE_IDM_LDAP_CACHE_GROUP_EXPIRATION=180000
        ports:
            - 9090:9090
        entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "app.war"]
    flowable-admin-app:
        image: flowable/flowable-admin
        container_name: flowable-admin
        depends_on:
            - flowable-db
            - flowable-idm-app
            - flowable-task-app
        environment:
            - SERVER_PORT=9988
            - SPRING_DATASOURCE_DRIVER-CLASS-NAME=org.postgresql.Driver
            - SPRING_DATASOURCE_URL=jdbc:postgresql://flowable-db:5432/flowable
            - SPRING_DATASOURCE_USERNAME=flowable
            - SPRING_DATASOURCE_PASSWORD=flowable
            - FLOWABLE_COMMON_APP_IDM-URL=http://flowable-idm-app:9090/flowable-idm
            - FLOWABLE_COMMON_APP_IDM-REDIRECT-URL=http://${HOSTNAME}:9090/flowable-idm
            - FLOWABLE_COMMON_APP_IDM-ADMIN_USER=flowLdap
            - FLOWABLE_COMMON_APP_IDM-ADMIN_PASSWORD=test
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_PROCESS_SERVER-ADDRESS=http://flowable-task-app
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_PROCESS_PORT=9999
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_PROCESS_CONTEXT-ROOT=flowable-task
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_PROCESS_REST-ROOT=process-api
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_CMMN_SERVER-ADDRESS=http://flowable-task-app
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_CMMN_PORT=9999
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_CMMN_CONTEXT-ROOT=flowable-task
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_CMMN_REST-ROOT=cmmn-api
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_DMN_SERVER-ADDRESS=http://flowable-task-app
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_DMN_PORT=9999
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_DMN_CONTEXT-ROOT=flowable-task
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_DMN_REST-ROOT=dmn-api
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_FORM_SERVER-ADDRESS=http://flowable-task-app
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_FORM_PORT=9999
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_FORM_CONTEXT-ROOT=flowable-task
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_FORM_REST-ROOT=form-api
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_CONTENT_SERVER-ADDRESS=http://flowable-task-app
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_CONTENT_PORT=9999
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_CONTENT_CONTEXT-ROOT=flowable-task
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_CONTENT_REST-ROOT=content-api
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_APP_SERVER-ADDRESS=http://flowable-task-app
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_APP_PORT=9999
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_APP_CONTEXT-ROOT=flowable-task
            - FLOWABLE_ADMIN_APP_SERVER-CONFIG_APP_REST-ROOT=app-api
        ports:
            - 9988:9988
        entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "java", "-jar", "app.war"]
    flowable-db:
        image: postgres:9.6-alpine
        container_name: flowable-postgres
        environment:
            - POSTGRES_PASSWORD=flowable
            - POSTGRES_USER=flowable
            - POSTGRES_DB=flowable
        volumes:
            - all-in-one_pgdata:/var/lib/postgresql/data
        ports:
            - 5433:5432
        command: postgres
volumes: 
    all-in-one_pgdata:

Hi,

it seems you did not delete the volume (or the wrong one) and that a container that is not based on the latest image version is communicating to that database schema.
In other words; the schema version is newer than the software.

Regards,

Yvo

Thanks yvo. It’s working after I deleted the all containers and volumes using stop-remove-containers.sh and remove-all-images.sh and restarted.

@yvo Facing this problem made me curious whether running flowable using docker in production environment is a good approach. Appreciate your thoughts.

Hi,

I’m not sure if I follow your reasoning but the issue you had was caused by ‘downgrading’ a Flowable application but keeping the same database (schema version).
This is not something you will encounter in production.

Yvo

Hi @yvo,

issue you had was caused by ‘downgrading’ a Flowable application but keeping the same database (schema version)

We did not downgrade the flowable application (nor upgrade the db schema version). It was the same docker-compose.yml which was being deployed and we got the above error. Any reason why the above error might happen?

Thank you for your quick responses. :slight_smile:

Perhaps this happend without you being aware of it; f.e. by pulling the latests image version. But the unknown version from database error indicates this.
Using an explicit image version in the docker compose spec file can prevent this.

Logically it could be pulling latest image issue. But All the other flowable apps except flowable-task running without issue. Only flowable-task is giving this problem. It is highly unlikely docker pulled a different image version only for flowable-task.

I looked at it and everything seems okay. So to the only thing I see now that could caused the issue is what I explained earlier; you ran an older version of a Flowable app against a newer db schema.
If you suspect something is wrong with the images or code; please try to reproduce the issue and provide more detailled info on the steps you took. (how you deployed / what exact version etc).
This info is essential.

1 Like