RADAR-base / ManagementPortal

Management Portal to manage research studies
Apache License 2.0
21 stars 16 forks source link

All updates made in the MP disappear when stopped #113

Closed yatharthranjan closed 6 years ago

yatharthranjan commented 6 years ago

When the Management Portal app container is stopped and removed and then started again, All the changes that were made are gone. Its like it was just instantiated with only the demo entities present. When I look in the postgres data directory, it shows that its empty. Could it be that postgres data is still being saved inside the container and not on the mounted volume?

nivemaham commented 6 years ago

What was your setup? Was it in prod profile. I never had this issue.

afolarin commented 6 years ago

looks like the postgres container db volume is updating. Can you check the entities are still in the db?

root@bc916b6f1c1d:/# ls -l /var/lib/postgresql/data/base
total 24
drwx------ 2 postgres postgres  4096 Nov  1 12:22 1
drwx------ 2 postgres postgres  4096 Nov  1 12:22 12406
drwx------ 2 postgres postgres  4096 Nov  1 12:23 12407
drwx------ 2 postgres postgres 12288 Nov  1 15:56 1638sudo ls -l 

/var/lib/docker/volumes/48ffca67772eb53ecb46e8791da225e24dd4c150c011b81022a5b9921f0db7bc/_data/base
total 24
drwx------ 2 999 docker  4096 Nov  1 12:22 1
drwx------ 2 999 docker  4096 Nov  1 12:22 12406
drwx------ 2 999 docker  4096 Nov  1 12:23 12407
drwx------ 2 999 docker 12288 Nov  1 15:56 16384
yatharthranjan commented 6 years ago

Mounting the data directory did the trick.

    volumes:
      - "${MP_POSTGRES_DIR}/data/:/var/lib/postgresql/data/"
yatharthranjan commented 6 years ago

Solved with https://github.com/RADAR-CNS/RADAR-Docker/pull/57