Opened 2 years ago

Last modified 2 years ago

#5164 closed defect

"Server closed the connection unexpectedly" when installing PostGis on OS X with M1 chip — at Version 2

Reported by: chrisneve Owned by: pramsey
Priority: medium Milestone: PostGIS 3.2.2
Component: postgis Version: 3.2.x
Keywords: Cc: chrisneve

Description (last modified by pramsey)

I am attempting to install Postgis on my newly created Postgresql DB and am running into issues doing so.

Environment

  • OS X (Big Sur, 11.2.3 with a M1 chip)
  • Postgresql version: stable 14.3, installed with homebrew (more precisely, with the following syntax: arch -arm64 brew install postgresql)
  • Postgis version: stable 3.2.1, installed with homebrew (same)

What I'm trying to do

I want to install postgis on my postgresql database as such.

Christophers-MacBook-Air:postgres root# psql -U chrisneve -d mydbname psql (14.3) Type "help" for help.

mydbname=# create extension postgis;

The problem

The above snippet generates this error.

mydbname=# create extension postgis; server closed the connection unexpectedly

This probably means the server terminated abnormally before or while processing the request.

The connection to the server was lost. Attempting reset: Failed. !?>

Before trying with psql directly, I executed the same command using DataGrip, which generated this error. (I also tried with the "cascade" mode: create extension postgis cascade, which generated the same result).

mydbname.public> create extension postgis [2022-05-28 10:55:30] An I/O error occurred while sending to the backend. [2022-05-28 10:55:30] Unrecoverable error received, the connection is spoiled

DataGrip also displayed a popup-style error saying this.

Error [57P03]: FATAL: the database system is in recovery mode

What I tried

I initially didn't know exactly where the error lied, so I started by asserting that the problem wasn't with the creation of extensions (for whatever reason).

select * from mydbname.pg_catalog.pg_extension

drop extension plpgsql

create extension plpgsql

This worked just fine; other extensions load fine.

Realising the issue seemed to come from Postgis, I tried removing and reinstalling Postgis, and even Postgresql, with homebrew, multiple times. It changed nothing.

I then wanted to install Postgis from a different location of https://postgis.net/install/#binary-installers for OS X, but all other install mechanisms (other than homebrew) told me not to mix with other installations, so I didn't try them.

FWIW, I installed Postgis in the past on an identical DB on a Windows machine, so although I'm no Postgis expert I do know the install process.

It would be much appreciated if a Postgis maintainer could help me out with this. Is this a new bug with the M1 chips? I can provide logs if it helps.

Many thanks, Chris

Change History (2)

comment:1 by robe, 2 years ago

Description: modified (diff)

@chrisneve,

This could be an issue particular to M1 or Mac. Unfortunately I don't have an M1 to test with. I also don't use Mac, but Paul can at least confirm maybe it works on his Mac. Not sure if he uses homebrew.

That said, do you have gdb readily available.

Instructions here on how to debug with gdb https://trac.osgeo.org/postgis/wiki/DevWikiGettingABackTrace

If you can attach the bug trace to this ticket, that would help isolate where the issue is happening.

comment:2 by pramsey, 2 years ago

Description: modified (diff)

This is almost certainly a packaging problem. You could disambiguate the source of the issue by compiling postgis from source and seeing if it works in that case (it probably will). Otherwise we lack the tools to debug this at the moment (no M1 system in hand).

Note: See TracTickets for help on using tickets.