Skip to content

12-alpine (same version start issue) #662

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

Closed
gsugambit opened this issue Jan 28, 2020 · 11 comments
Closed

12-alpine (same version start issue) #662

gsugambit opened this issue Jan 28, 2020 · 11 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@gsugambit
Copy link

gsugambit commented Jan 28, 2020

I've been using the 12-alpine container of postgres for a long time on one of my server. Recently, all the images were removed and pulled so now the latest image I have is from 4 days ago. It seems the new version of 12-alpine is not compatible with the latest 😞
So, I tried executing the command to backup the DB, but the container is exiting because of the incompatibility message. Is there a clean way to handle this situation? It seems I'll not be able to retrieve the old version of 12-alpine since the tag will only give me the latest.Postgres backup command: docker exec POSTGRES_CONTAINER pg_dumpall -U postgres > dump.sql
Error in my postgres container:

gitpostgres_1 | 2020-01-28 05:30:57.747 UTC [1] FATAL: database files are incompatible with server
gitpostgres_1 | 2020-01-28 05:30:57.747 UTC [1] DETAIL: The database cluster was initialized with CATALOG_VERSION_NO 201907221, but the server was compiled with CATALOG_VERSION_NO 201909212.
gitpostgres_1 | 2020-01-28 05:30:57.747 UTC [1] HINT: It looks like you need to initdb.
gitpostgres_1 | 2020-01-28 05:30:57.747 UTC [1] LOG: database system is shut down

Note I still have my data folder on the host machine. I just need to know how i can get to a state where i can export / dump all so that i can next restore

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Jan 28, 2020
@wglambert
Copy link

wglambert commented Jan 28, 2020

I think this was your version 5ad8e92 12beta4
You can pull it by its sha256 hash
docker pull postgres@sha256:422f5e2ad999126f505b44c2d56abe726a08ed7e50e2d268e9906c879831805f
docker pull postgres@sha256:74dbf54102221baabd97b31be9a44a52a9cec4217942d199f4f45d9ab24c2e94
https://www.postgresql.org/developer/beta/

@gsugambit
Copy link
Author

@wglambert Ah, it looks like maybe that image is not still being hosted. I was trying to find the old tag hash last night and i could not find it.
docker pull postgres@sha256:422f5e2ad999126f505b44c2d56abe726a08ed7e50e2d268e9906c879831805f Error response from daemon: manifest for postgres@sha256:422f5e2ad999126f505b44c2d56abe726a08ed7e50e2d268e9906c879831805f not found: manifest unknown: manifest unknown

@wglambert
Copy link

Here it is, 12-beta4-alpine

docker pull postgres@sha256:74dbf54102221baabd97b31be9a44a52a9cec4217942d199f4f45d9ab24c2e94

https://github.com/docker-library/repo-info/tree/05604ce9317437e403fdf141fb9b9d2321c9f6ca/repos/postgres/remote

@wglambert
Copy link

$ docker run -d --rm --name postgres-beta4 postgres@sha256:74dbf54102221baabd97b31be9a44a52a9cec4217942d199f4f45d9ab24c2e94
Unable to find image 'postgres@sha256:74dbf54102221baabd97b31be9a44a52a9cec4217942d199f4f45d9ab24c2e94' locally
sha256:74dbf54102221baabd97b31be9a44a52a9cec4217942d199f4f45d9ab24c2e94: Pulling from library/postgres
9d48c3bd43c5: Already exists 
f112202a5fec: Pull complete 
e2827e7bbe4a: Pull complete 
c02d006ddf20: Pull complete 
81bbbf517cba: Pull complete 
bb629934ef6f: Pull complete 
d5a103dae745: Pull complete 
135dc04ce32f: Pull complete 
Digest: sha256:74dbf54102221baabd97b31be9a44a52a9cec4217942d199f4f45d9ab24c2e94
Status: Downloaded newer image for postgres@sha256:74dbf54102221baabd97b31be9a44a52a9cec4217942d199f4f45d9ab24c2e94
1b5942df13b731ff05632911bdb08c079b00a10a09e2a4d63664ced1d95df161

$ docker exec postgres-beta4 cat /usr/local/include/postgresql/server/catalog/catversion.h | grep CATALOG_VERSION_NO
#define CATALOG_VERSION_NO      201907221

$ docker run -d --rm --name postgres-latest postgres:latest
68f44b1892261245bfb7804f3462110052f5094800ce9779280e012c87ee00d1

$ docker exec postgres-latest cat /usr/share/postgresql/12/catalog_version
201909212

I'm not sure of the upgrade path you have to take, if it's beta4->rc1 or beta4->ga
https://www.postgresql.org/about/news/1975/

To upgrade to PostgreSQL 12 RC 1 from Beta 4 or an earlier version of PostgreSQL 12, you will need to use a strategy similar to upgrading between major versions of PostgreSQL (e.g. pg_upgrade or pg_dump / pg_restore). For more information, please visit the documentation section on upgrading.

@wglambert
Copy link

Closing since this is resolved

@gsugambit
Copy link
Author

gsugambit commented Feb 1, 2020

@wglambert sorry did not get to check the thread the last couple of days. This new image works for me. Thank you so much!

@thewaytoai
Copy link

I have meet the same problem too, my version is postgres:13-alpine, but after a few month later, I can't start this postgres.

PostgreSQL Database directory appears to contain a database; Skipping initialization 2020-11-09 09:17:35.840 UTC [1] FATAL: database files are incompatible with server 2020-11-09 09:17:35.840 UTC [1] DETAIL: The database cluster was initialized with CATALOG_VERSION_NO 202005171, but the server was compiled with CATALOG_VERSION_NO 202007201. 2020-11-09 09:17:35.840 UTC [1] HINT: It looks like you need to initdb. 2020-11-09 09:17:35.841 UTC [1] LOG: database system is shut down

I have no idea how to fix this problem, it's running in my k8s。Would you please give some suggestions?Thanks.

@yosifkit
Copy link
Member

yosifkit commented Nov 9, 2020

@thewaytoai, postgres should be compatible for database files within a major version, but not for a pre-release. Likely you were using postgres:13-alpine when 13 was still pre-release. The release was only add here in 8d28111 and pushed to the Docker Hub with docker-library/official-images#8770. I would guess the "simplest" solution would be to dump and restore.

@thewaytoai
Copy link

Thanks. I've solve this problem. If possible, I sugesst that the docker tag should be postgres:13-alpine-rc , then this problem will never happen.

@yosifkit
Copy link
Member

Tags: 13-rc1-alpine, 13-alpine

They were also tagged with -rc1.

@tianon
Copy link
Member

tianon commented Dec 17, 2020

I've filed #797 to help alleviate this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

5 participants