Skip to content
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

Running postgis/postgis crashes on Apple Sillicon #5122

Closed
1 of 2 tasks
derdaele opened this issue Dec 11, 2020 · 7 comments
Closed
1 of 2 tasks

Running postgis/postgis crashes on Apple Sillicon #5122

derdaele opened this issue Dec 11, 2020 · 7 comments
Assignees
Labels

Comments

@derdaele
Copy link

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: N/A currently not supported by the current dev preview.

Expected behavior

The run works.

Actual behavior

The run fails with a PANIC error message.

Information

  • macOS Version: Big Sur 11.0.1 (20B29)
  • Docker Version: Apple Silicon dev preview 5
  • Computer: MacBook Pro 13' with Apple Silicon (M1 chip).

Remark: The official postgis/postgis isn't available for arm64. Using a community postgis arm64 image does properly work.

Diagnostic logs

$ docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=password postgis/postgis

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/lib/postgresql/12/bin/pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2020-12-11 18:41:33.838 UTC [121] LOG:  starting PostgreSQL 12.5 (Debian 12.5-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2020-12-11 18:41:33.878 UTC [121] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2020-12-11 18:41:34.116 UTC [125] LOG:  database system was shut down at 2020-12-11 18:41:33 UTC
2020-12-11 18:41:34.191 UTC [121] LOG:  database system is ready to accept connections
 done
server started

/usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/10_postgis.sh
CREATE DATABASE
Loading PostGIS extensions into template_postgis
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
CREATE EXTENSION
Loading PostGIS extensions into postgres
2020-12-11 18:44:08.811 UTC [136] PANIC:  stuck spinlock detected at LWLockWaitListLock, /build/postgresql-12-JGfMpC/postgresql-12-12.5/build/../src/backend/storage/lmgr/lwlock.c:833
qemu: uncaught target signal 6 (Aborted) - core dumped
2020-12-11 18:44:08.818 UTC [121] LOG:  background worker "logical replication launcher" (PID 136) was terminated by signal 6: Aborted
2020-12-11 18:44:08.818 UTC [121] LOG:  terminating any other active server processes
2020-12-11 18:44:08.821 UTC [133] WARNING:  terminating connection because of crash of another server process
2020-12-11 18:44:08.821 UTC [133] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2020-12-11 18:44:08.821 UTC [133] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2020-12-11 18:44:08.821 UTC [211] WARNING:  terminating connection because of crash of another server process
2020-12-11 18:44:08.821 UTC [211] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2020-12-11 18:44:08.821 UTC [211] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2020-12-11 18:44:08.849 UTC [121] LOG:  all server processes terminated; reinitializing
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.
connection to server was lost

Steps to reproduce the behavior

  1. docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=password postgis/postgis
@SputnikTea
Copy link

Can this be related to #5123?

@paltman
Copy link

paltman commented Dec 18, 2020

I'm seeing the exact same thing on MacBook Air M1, macOS 11.0.1, and postgis/postgis:12-3.0-alpine

@derdaele
Copy link
Author

FYI, this doesn't crash when running a native arm image.

I opened postgis/docker-postgis#216 to publish arm postgis image, in the meanwhile one can use https://github.com/postgis/docker-postgis/blob/69856e1090dfd6a755ba3aebf13c594e0c0aa5a3/13-3.0/Dockerfile to locally build an arm image.

@gangstead
Copy link

gangstead commented Jan 8, 2021

Thanks @derdaele that worked for me. I ended up having to clone https://github.com/postgis/docker-postgis to run the build. I pushed it up to docker hub https://hub.docker.com/repository/docker/gangstead/postgis so if anyone just wants to run postgis for local development they can just use mine as a stopgap until there's an arm64 tagged image.

@stephen-turner
Copy link
Contributor

This is a qemu bug, which is the upstream component we use for running Intel (amd64) containers on M1 (arm64) chips, and is unfortunately not something we control. In general we recommend running arm64 containers on M1 chips because (even ignoring any crashes) they will always be faster and use less memory.

Please encourage the author of this container to supply an arm64 or multi-arch image, not just an Intel one. Now that M1 is a mainstream platform, we think that most container authors will be keen to do this.

@DonikaV
Copy link

DonikaV commented Mar 19, 2021

@gangstead hey, do you know by the chance a similar image but for postgre 11 and postgis 2.5? On my current project, we use postgres 11 and after we added postgis 2.5 I spent many hours to try to install it to my mac PostGIS 2.5 but with no success then tried to use docker for DB and only after I found your link I was able to start the app.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Apr 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants