Is there a way to make the Zeebe simple tasklist persistent so the user and groups remain?
I have tried:
- spring.jpa.hibernate.ddl-auto=update
- spring.datasource.url=jdbc:h2:/opt/h2-data/zeebe-tasklist
and also:
- spring.datasource.url=jdbc:h2:file:/opt/h2-data/db;DB_CLOSE_ON_EXIT=FALSE;AUTO_RECONNECT=TRUE
But no luck.
Hi @maartend.
By default, the simple tasklist should use a file-based H2 database.
How do you run/setup the tasklist?
Did you change any configuration?
Which version do you use?
Best regards,
Philipp
Hi @philipp.ossler,
I am using the following within docker-compose:
tasklist:
container_name: zeebe_tasklist
image: camunda/zeebe-simple-tasklist:0.4.0
environment:
- zeebe.client.broker.contactPoint=zeebe:26500
- zeebe.worker.hazelcast.connection=zeebe:5701
- spring.jpa.hibernate.ddl-auto=update
- spring.datasource.url=jdbc:h2:file:/opt/h2-data/zeebe-tasklist
volumes:
- ./tasklist-data/:/opt/h2-data/
Simple tasklist is staring:
2020-05-01 00:45:36.764 INFO 1 --- [ restartedMain] i.zeebe.tasklist.ZeebeSimpleTasklistApp : Starting ZeebeSimpleTasklistApp on fb039403d793 with PID 1 (/app/classes started by root in /)
2020-05-01 00:45:36.827 DEBUG 1 --- [ restartedMain] i.zeebe.tasklist.ZeebeSimpleTasklistApp : Running with Spring Boot v2.2.6.RELEASE, Spring v5.2.5.RELEASE
2020-05-01 00:45:36.860 INFO 1 --- [ restartedMain] i.zeebe.tasklist.ZeebeSimpleTasklistApp : No active profile set, falling back to default profiles: default
2020-05-01 00:47:18.825 INFO 1 --- [ restartedMain] i.zeebe.tasklist.ZeebeSimpleTasklistApp : Creating admin user with name 'demo' and password 'demo'
2020-05-01 00:47:24.971 INFO 1 --- [ restartedMain] io.zeebe.tasklist.HazelcastService : Connecting to Hazelcast 'zeebe:5701'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (file:/app/libs/hazelcast-3.12.6.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2020-05-01 00:47:33.228 INFO 1 --- [ restartedMain] i.z.h.connect.java.ZeebeHazelcast : Read from ringbuffer 'zeebe' starting from sequence '0'
2020-05-01 00:47:33.305 INFO 1 --- [ restartedMain] i.z.s.c.c.p.ZeebeWorkerPostProcessor : zeebeWorker: ClassInfo(bean=io.zeebe.tasklist.UserTaskJobHandler@2925dec5, beanName=userTaskJobHandler)
2020-05-01 00:47:59.437 INFO 1 --- [ restartedMain] i.z.s.c.c.p.ZeebeWorkerPostProcessor : register job worker: ZeebeWorkerValue(type=user, name=zeebe-simple-tasklist, timeout=2592000000, maxJobsActive=2, beanInfo=MethodInfo(classInfo=ClassInfo(bean=io.zeebe.tasklist.UserTaskJobHandler@2925dec5, beanName=userTaskJobHandler), method=public void io.zeebe.tasklist.UserTaskJobHandler.handle(io.zeebe.client.api.worker.JobClient,io.zeebe.client.api.response.ActivatedJob)))
2020-05-01 00:48:00.299 INFO 1 --- [ restartedMain] i.zeebe.tasklist.ZeebeSimpleTasklistApp : Started ZeebeSimpleTasklistApp in 152.66 seconds (JVM running for 164.691)
But webinterface is not coming up but not showing anything:
localhost:/var/zeebe-docker-compose/simple-monitor# curl -i http://127.0.0.1:8083/
HTTP/1.1 302
Set-Cookie: JSESSIONID=A27ED7FD8ECAEA09B9FCF5088F82FD82; Path=/; HttpOnly
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Location: http://127.0.0.1:8083/login
Content-Length: 0
Date: Fri, 01 May 2020 00:51:18 GMT
If I look on the volume on the disk I see a db file is created:
localhost:/var/zeebe-docker-compose/simple-monitor# ls -l tasklist-data
total 36
-rw-r--r-- 1 root root 36864 May 1 02:52 zeebe-tasklist.mv.db
I have no additional application.yaml file, so using defaults other then the additional variables in docker-compose.
When I remove the following lines:
- spring.jpa.hibernate.ddl-auto=update
- spring.datasource.url=jdbc:h2:file:/opt/h2-data/zeebe-tasklist
Simple tasklist is running perfectly.
Regards,
Maarten
@philipp.ossler, It seems I have been wrong, simple monitor is starting up, it took more time than I expected… probable due to my impatience.
However, can you confirm the above is the right way to make it persistent?
Do I need to create other volume mounts?
Also the spring.datasource.url, is it better or necessary to append “;DB_CLOSE_ON_EXIT=FALSE;AUTO_RECONNECT=TRUE” as I have done with simple monitor?
Thanks in advance,
Maarten
1 Like
As far as I can say, your configuration looks good 
I think it is not necessary to add the URL parameters or mount other volumes.
Feel free to create a new issue if something doesn’t work as expected 
@philipp.ossler, one remaining question though.
I could not find the option in the application.yaml, is it possible to have tasklist running from a different web (root) folder?
http://servername/tasklist/
Is this configurable?
Maarten
Yes, it should be possible to change this - thanks to Spring Boot
.
Try to set the following property in the application.yaml
:
server.servlet.context-path=/tasklist
Does this work for you?
@philipp.ossler,
I have done quite some changes to test things out, I started with only adding
- server.servlet.context-path=/tasklist
in the environment part of docker-compose, that works in a way, there is a login page… but not functional:

So made more changes:
- Changed the path’s in the the template files and mounted the changed template folder with docker-compose to /app/resources/templates. Changes that I made where e.g.
<form id="login-form" action="/tasklist/login" method="post">
in login.html
But also changes in header.html to add the right path.
that was already better, but adding a new user for example did not work, so I moved on to the .js files
- changes to .js files, since creating user’s did not work anymore, so for example:
url: withSecurityToken('/tasklist/api/tasks/' + taskKey + '/claim'), url: withSecurityToken('/tasklist/api/users/'), url: withSecurityToken('/tasklist/api/users/' + username),
in app.js and mounted to changes js folder to /app/resources/public/js
This resulted in a working app in /tasklist but only the login process did not work. After login it does a wrong redirect (missing /tasklist prefix), if I manually change the URL in the browser it works.
I suspect it is due to src/main/java/io/zeebe/tasklist/view/ViewController.java:
Not respecting the path settings from server.servlet.context-path.
My problem is I am not a java minded person, setting up a dev environment to make changes to these .java files and build the project again is not something I can do myself unfortunately. Also I have no dockerfile to create a new docker image.
If it was created in golang I coudl have done some more testing en experimenting… 
But does the above make sense?
Maarten
Nice try 
Please create an issue in the repository and I can take a deeper look into it.