FS#35816 - [postgis] Error loading postgis-2.0.so ( possible missing link to json-c ? )

Attached to Project: Community Packages
Opened by marco (marcoG74) - Sunday, 16 June 2013, 13:15 GMT
Last edited by Balló György (City-busz) - Tuesday, 24 December 2013, 10:05 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jaroslav Lichtblau (Dragonlord)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 12
Private No

Details

Description:

Loading of postgis-2.0.so failed. ( Missing link to json-c ? )

Additional info:

* Bug affects postgis 2.0.3-1, not present in previous version.

* ldd /usr/lib/postgresql/postgis-2.0.so
linux-vdso.so.1 (0x00007fff7d3fe000)
libgeos_c.so.1 => /usr/lib/libgeos_c.so.1 (0x00007f8cc9ce0000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f8cc9a8d000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f8cc9725000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f8cc9426000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f8cc9079000)
libgeos-3.3.8.so => /usr/lib/libgeos-3.3.8.so (0x00007f8cc8cd7000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f8cc89d2000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f8cc87bc000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f8cc85b8000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f8cc83a1000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f8cc817e000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f8cca1a3000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f8cc7f61000)



Steps to reproduce:

On the first hand, I've got this error when browsing a postgis enabled database in PgAdmin3 (msg translated from italian ):

ERROR loading "/usr/lib/postgresql/postgis-2.0.so" failed: /usr/lib/postgresql/postgis-2.0.so: undefined symbol: json_tokener_errors
SQL Status: 58P01

On the second hand I've got this same error when trying to enable postgis extension on a newly created database:

create extension postgis;

or

psql -d MYDATABASE -f /usr/share/postgresql/contrib/postgis-2.0/postgis.sql

This task depends upon

Closed by  Balló György (City-busz)
Tuesday, 24 December 2013, 10:05 GMT
Reason for closing:  No response
Additional comments about closing:  If you still get this problem, then contact with upstream.
Comment by Allie (allie_o) - Monday, 17 June 2013, 09:12 GMT
I am also experiencing this issue. I happened to have the abs PKGBUILD for 2.0.2 so I was able to downgrade, but that didn't solve the issue. Only by then symlinking /usr/lib/libjson.so to point to /usr/lib/libjson-c.so was I able to work around the issue (I found the suggestion to do so from a google search). This suggests to me that it's not just an issue with this package but that the json-c package is also involved.

-- edit: for the convenience of those who might stumble on this looking to solve this issue, I've attached the aformentioned 2.0.2 PKGBUILD

   PKGBUILD (0.9 KiB)
Comment by Patrick Hanckmann (hanckmann) - Monday, 17 June 2013, 09:42 GMT
I am experiencing the same issue.
I have not found any solution yet (I did not get the PKGBUILD to work). If I find anything I will post back.
Comment by Alessandro Candini (canduc17) - Monday, 17 June 2013, 11:44 GMT
The same here.
Comment by Dale Floer (dalef) - Tuesday, 18 June 2013, 07:50 GMT
I figured out how to get postgis building and linking against libjson-c properly with the help of a friend (Robin Johnson from Gentoo, robbat2@gentoo.org).
Gentoo has two patches to fix the issue (for 2.0.2, but they worked for this version as well) available at: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-db/postgis/files/
After applying the patches, autogen.sh needed to be run again.

It works!
I've attached the two patches and the modified PKGBUILD (which might need to be cleaned up) in a tarball. I needed to modify the json patch to have the proper includes for Arch, but other than that, the patches are unchanged.

Rebuilding after the change. Note the fourth line of the output:
$ ldd /usr/lib/postgresql/postgis-2.0.so
linux-vdso.so.1 (0x00007fff06be9000)
libgeos_c.so.1 => /usr/lib/libgeos_c.so.1 (0x00007f72d2441000)
libproj.so.0 => /usr/lib/libproj.so.0 (0x00007f72d21ee000)
libjson-c.so.2 => /usr/lib/libjson-c.so.2 (0x00007f72d1fe3000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007f72d1c7a000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f72d197c000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f72d15cf000)
libgeos-3.3.8.so => /usr/lib/libgeos-3.3.8.so (0x00007f72d11ea000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f72d0ee6000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f72d0cd0000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f72d0acb000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f72d08b5000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f72d0692000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f72d2904000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f72d0475000)

EDIT: Added Robin's email.
Comment by Bruno (gabuzo) - Wednesday, 19 June 2013, 08:58 GMT
dalef's patches worked for me.
Thanks!
Comment by CalimeroTeknik (Calimero) - Thursday, 20 June 2013, 13:29 GMT
Somebody else wrote a patch for this, http://trac.osgeo.org/postgis/ticket/2213
So I made a PKGBUILD including it (it solves the bug): http://sprunge.us/fhJV

Looking forward to 2.0.3-2 in [community] with these fixes included, for the current postgis package in [community] just doesn't work at all.
Also maybe upstream?

Anyway, usual cleanliness/robustness fixes to dalef's PKGBUILD from postgis.tar (try and build in a folder with spaces in its name, and with -j3 in makepkg.conf, you'll need these fixes): http://sprunge.us/TWPS
Comment by dan bruegge (haengebruegge) - Thursday, 22 August 2013, 14:21 GMT
Thanks @dalef, this worked. :)
Comment by dan bruegge (haengebruegge) - Friday, 18 October 2013, 13:02 GMT
  • Field changed: Percent Complete (100% → 0%)
The 2.1.0 don't solve the problem for me.
Comment by Jaroslav Lichtblau (Dragonlord) - Monday, 11 November 2013, 18:57 GMT
So, how about in postgis-2.1.1-1 now?

Loading...