@ballPointPenguin and @patcon, I just tried to run the latest dev version of polis (54ac6b84fe38a70491159497b7d485089493a67a) on my 2012 macbook, which only supports os x 10.11 and "Docker Toolbox", and I got an error The data directory was initialized by PostgreSQL version 9.5, which is not compatible with this version 12.3.
I did not get this error on a 2016 macbook running os x 10.15 with docker desktop version 2.2.0.3.
I'm tagging Ben because of his interest in supporting old hardware ;).
I started with a clean install:
git clone https://github.com/pol-is/polisServer.git
docker rm $(docker ps -aq)
docker rmi $(docker images -q);
docker-compose up
What happened:
polis-postgres | 2020-07-03 23:36:31.174 UTC [1] FATAL: database files are incompatible with server
polis-postgres | 2020-07-03 23:36:31.174 UTC [1] DETAIL: The data directory was initialized by PostgreSQL version 9.5, which is not compatible with this version 12.3.
My next step is to reinstall so that I can get some clean --no-color logs.
Ah, volumes persist unless you wipe them and as we upgrade postgres in #322
Run docker system prune --volumes when all containers are down, and you'll do a full wipe :)
If you need to preserve the database, then you'll need to manually handle the migrate (do a dump of the old, prune to remove the volume, then reimport)
Lemme know if this resolved things for you!
@patcon, docker rm $(docker ps -aq) and docker rmi $(docker images -q) remove all previous images, so that's not the problem.
The problem seems to be that Leiningen is using postgres version 8, and the docker build is using version 12. I'm not sure why this is happening and if it also happens on my newer mac.
@metasoarous, I think I have two questions:
And, this is definitely not a high priority issue, but fixing it would broaden the set of users who could run their own servers.
PS. I like the new splash screen!
(base) CRKFrankenBook:polisServer crkrenn$ grep -i -A 2 -B 2 -e postgres polis_build_out.txt
Step 1/2 : FROM postgres:12.3-alpine
12.3-alpine: Pulling from library/postgres
Digest: sha256:7693f2082c681571d1dfa66d63f21689192c0c36108f4eb28be0aee0dc285921
--
Digest: sha256:7693f2082c681571d1dfa66d63f21689192c0c36108f4eb28be0aee0dc285921
Status: Downloaded newer image for postgres:12.3-alpine
---> 17150f4321a3
--
---> 17150f4321a3
Step 2/2 : COPY ./postgres/db_setup_draft.sql /docker-entrypoint-initdb.d/
---> 6684c239d975
Successfully built 6684c239d975
--
--
---> 6684c239d975
Successfully built 6684c239d975
Successfully tagged polisdemo/postgres:dev
Step 1/6 : FROM alpine:latest
latest: Pulling from library/alpine
--
--
Downloading Leiningen to /root/.lein/self-installs/leiningen-2.9.3-standalone.jar now...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
^M 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0^M100 637 100 637 0 0 7\
81 0 --:--:-- --:--:-- --:--:-- 781
^M 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0^M 9 13.9M 9 1324k 0 0 67\
7k 0 0:00:21 0:00:01 0:00:20 1229k^M 46 13.9M 46 6688k 0 0 2341k 0 0:00:06 0:00:02 0:00:04 3\
377k^M 80 13.9M 80 11.2M 0 0 2995k 0 0:00:04 0:00:03 0:00:01 3876k^M100 13.9M 100 13.9M 0 0 \
3253k 0 0:00:04 0:00:04 --:--:-- 4061k
**<output removed for clarity>**
Retrieving org/xerial/xerial-project/1.1/xerial-project-1.1.pom from central
Retrieving org/xerial/xerial/3/xerial-3.pom from central
Retrieving postgresql/postgresql/8.4-702.jdbc4/postgresql-8.4-702.jdbc4.pom from central
Retrieving org/apache/derby/derby/10.1.1.0/derby-10.1.1.0.pom from central
Retrieving incanter/incanter-zoo/1.9.3/incanter-zoo-1.9.3.pom from clojars
--
--
Retrieving org/tukaani/xz/1.5/xz-1.5.pom from central
Retrieving net/jpountz/lz4/lz4/1.3/lz4-1.3.pom from central
Retrieving org/postgresql/postgresql/42.2.5/postgresql-42.2.5.pom from central
Retrieving org/postgresql/pgjdbc-core-parent/1.1.5/pgjdbc-core-parent-1.1.5.pom from central
Retrieving org/postgresql/pgjdbc-versions/1.1.5/pgjdbc-versions-1.1.5.pom from central
Retrieving korma/korma/0.4.3/korma-0.4.3.pom from clojars
Retrieving com/mchange/c3p0/0.9.5.2/c3p0-0.9.5.2.pom from central
--
--
Retrieving org/clojure/core.incubator/0.1.4/core.incubator-0.1.4.jar from central
Retrieving mysql/mysql-connector-java/5.1.17/mysql-connector-java-5.1.17.jar from central
Retrieving postgresql/postgresql/8.4-702.jdbc4/postgresql-8.4-702.jdbc4.jar from central
Retrieving org/apache/derby/derby/10.1.1.0/derby-10.1.1.0.jar from central
Retrieving org/clojure/data.finger-tree/0.0.2/data.finger-tree-0.0.2.jar from central
--
--
Retrieving org/tukaani/xz/1.5/xz-1.5.jar from central
Retrieving net/jpountz/lz4/lz4/1.3/lz4-1.3.jar from central
Retrieving org/postgresql/postgresql/42.2.5/postgresql-42.2.5.jar from central
Retrieving com/mchange/c3p0/0.9.5.2/c3p0-0.9.5.2.jar from central
Retrieving com/mchange/mchange-commons-java/0.2.11/mchange-commons-java-0.2.11.jar from central
--
--
---> Using cache
---> fb0c2a7d7598
Step 3/10 : RUN apk add postgresql-dev
---> Running in 8386c3dfcbaf
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
--
--
(5/8) Installing libldap (2.4.48-r2)
(6/8) Installing libpq (12.2-r0)
(7/8) Installing postgresql-libs (12.2-r0)
(8/8) Installing postgresql-dev (12.2-r0)
Executing busybox-1.31.1-r9.trigger
OK: 20 MiB in 24 packages
Pls do run/investigate the command I suggested. It prunes and removes _volumes_. The ones you wrote only affect containers and images, and volumes are different -- they persist through removing all containers/images :)
I hit this same error after we upgrades our postgres container, and obliterating the persistent volume resolved it
@patcon, Thanks very much! Adding docker system prune --volumes did the trick. I'm not sure why it wasn't needed on my newer macbook, but all's good that ends well.
@metasoarous, I'm closing this issue, and will open another one shortly.
The magic recipe:
git clone https://github.com/pol-is/polisServer.git
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images -q)
docker system prune --volumes -f
docker-compose up
echo done
Yay! Glad you got it resolved, and glad that this is now in the issue queue for the next person :)
@crkrenn in general I encourage people to use docker-compose pull followed by docker-compose up for fast and reliable dockerized polis, unless you are specifically wanting to build fresh images with local code changes.
Most helpful comment
@patcon, Thanks very much! Adding
docker system prune --volumesdid the trick. I'm not sure why it wasn't needed on my newer macbook, but all's good that ends well.@metasoarous, I'm closing this issue, and will open another one shortly.
The magic recipe: