Skip to content

postgresql segfault installing postgis extension #256

@happyjaxx

Description

@happyjaxx

Hi,

Unsure if I'm at the right place, but using pgedge platform, i'm having an issue on vanilla Debians (good'ol LXC/Proxmox , nothing fishy like Docker)

I have set up two dual node clusters in two locations, one pg16 and another pg17, both show hard failures upon installing postgis-pg16/17 via "./pgedge um install" (even with -a False, the shared_preload_libraries is still modified, the only difference is the instance isn't restarted and "CREATE EXTENSION IF NOT EXISTS postgis CASCADE" postgres" isn't attempted (which didn't work anyways since the daemon died before))

It usually goes like this:

pgedge@bdd-201:~/pgedge$ ./pgedge um install postgis-pg17

########### Installing postgis-pg17 ###############
  ['postgis-pg17']

Get:1 https://pgedge-download.s3.amazonaws.com/REPO postgis-pg17-3.5.0-1-amd
   50 MB [35%]
  100 MB [70%]
  141 MB [100%]

Unpacking postgis-pg17-3.5.0-1-amd.tgz
  new: shared_preload_libraries = 'pg_stat_statements, snowflake, spock, postgis-3'

pg17 stopping
pg17 starting on port 5432
pg_ctl: could not start server
Examine the log output.

$ pg17/bin/psql -p 5432 -c "CREATE EXTENSION IF NOT EXISTS postgis CASCADE" postgres
psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?
pgedge@bdd-201:~/pgedge$

Logs would be like:

2025-01-28 10:53:27 UTC [370]: [3-1] user=,db=,app=,client= LOG:  starting PostgreSQL 17.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.3.1 20240611 (Red Hat 13.3.1-2), 64-bit
2025-01-28 10:53:27 UTC [370]: [4-1] user=,db=,app=,client= LOG:  listening on IPv4 address "0.0.0.0", port 5432
2025-01-28 10:53:27 UTC [370]: [5-1] user=,db=,app=,client= LOG:  listening on IPv6 address "::", port 5432
2025-01-28 10:53:27 UTC [370]: [6-1] user=,db=,app=,client= LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2025-01-28 10:53:27 UTC [374]: [1-1] user=,db=,app=,client= LOG:  database system was interrupted; last known up at 2025-01-28 10:47:04 UTC
2025-01-28 10:53:27 UTC [374]: [2-1] user=,db=,app=,client= LOG:  database system was not properly shut down; automatic recovery in progress
2025-01-28 10:53:27 UTC [374]: [3-1] user=,db=,app=,client= LOG:  recovered replication state of node 1 to 0/2077118
2025-01-28 10:53:27 UTC [374]: [4-1] user=,db=,app=,client= LOG:  invalid record length at 0/2810C30: expected at least 24, got 0
2025-01-28 10:53:27 UTC [374]: [5-1] user=,db=,app=,client= LOG:  redo is not required
2025-01-28 10:53:27 UTC [372]: [1-1] user=,db=,app=,client= LOG:  checkpoint starting: end-of-recovery immediate wait
2025-01-28 10:53:27 UTC [372]: [2-1] user=,db=,app=,client= LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.005 s, sync=0.002 s, total=0.015 s; sync files=2, longest=0.002 s, average=0.001 s; distance=0 kB, estimate=0 kB; lsn=0/2810C30, redo lsn=0/2810C30
2025-01-28 10:53:27 UTC [370]: [7-1] user=,db=,app=,client= LOG:  startup process (PID 374) was terminated by signal 11: Segmentation fault
2025-01-28 10:53:27 UTC [370]: [8-1] user=,db=,app=,client= LOG:  terminating any other active server processes
2025-01-28 10:53:27 UTC [370]: [9-1] user=,db=,app=,client= LOG:  shutting down due to startup process failure
2025-01-28 10:53:27 UTC [370]: [10-1] user=,db=,app=,client= LOG:  database system is shut down

and the proxmox kernel messages would be:

[Tue Jan 28 11:51:37 2025] postgres[911616]: segfault at ffffffffffffffff ip 00007fec3a4b7eca sp 00007ffd8889f6d0 error 5 in libc.so.6[7fec3a445000+155000] likely on CPU 28 (core 4, socket 0)
[Tue Jan 28 11:51:37 2025] Code: dc 2c 10 00 e8 27 63 fe ff 0f 1f 80 00 00 00 00 48 85 ff 0f 84 bf 00 00 00 55 48 8d 77 f0 53 48 83 ec 18 48 8b 1d 16 8f 13 00 <48> 8b 47 f8 64 8b 2b a8 02 75 5b 48 8b 15 9c 8e 13 00 64 48 83 3a
[Tue Jan 28 11:51:37 2025] postgres[911612]: segfault at ffffffffffffffff ip 00007fec3a4b7eca sp 00007ffd8889ec20 error 5 in libc.so.6[7fec3a445000+155000] likely on CPU 29 (core 5, socket 0)
[Tue Jan 28 11:51:37 2025] Code: dc 2c 10 00 e8 27 63 fe ff 0f 1f 80 00 00 00 00 48 85 ff 0f 84 bf 00 00 00 55 48 8d 77 f0 53 48 83 ec 18 48 8b 1d 16 8f 13 00 <48> 8b 47 f8 64 8b 2b a8 02 75 5b 48 8b 15 9c 8e 13 00 64 48 83 3a
[Tue Jan 28 11:51:37 2025] postgres[911613]: segfault at ffffffffffffffff ip 00007fec3a4b7eca sp 00007ffd8889d630 error 5 in libc.so.6[7fec3a445000+155000] likely on CPU 8 (core 8, socket 0)
[Tue Jan 28 11:51:37 2025] Code: dc 2c 10 00 e8 27 63 fe ff 0f 1f 80 00 00 00 00 48 85 ff 0f 84 bf 00 00 00 55 48 8d 77 f0 53 48 83 ec 18 48 8b 1d 16 8f 13 00 <48> 8b 47 f8 64 8b 2b a8 02 75 5b 48 8b 15 9c 8e 13 00 64 48 83 3a

Both couple of instances are plain Debian Templates from Proxmox (mostly up to date) on separate proxmox clusters (mine and a clients), updated to Debian 12.9... even installed libgdal25 in case it was a missing dep.

removing "postgis-3" from shared_preload_libraries allows the daemon to start hopefully, and the extension can be created on a database...

this could be 1000% PEBKAC, but it's a bit too easy to crash an instance by simply issuing a ./pgedge um install postgis-pgxx ... there might be something to explore

Thanks for your insight !
JaXX./.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions