Thread: createlang error(s)

createlang error(s)

From
John Burski
Date:
Greetings, everyone!

I'm experiencing some troubles using the createlang command to add
plperl to my PostgreSQL installation.  When I issue the command
"createlang plperl template1" I receive the following error message:

createlang: language installation failed: ERROR: could not load library
"/usr/lib/postgresql/plperl.so": libperl.so: cannot open shared object
file: No such file or directory

Some installation specifications:
Running OpenSuSE 11.1
PostgreSQL 8.3.8
Yast2 shows the following modules as installed: postgresql-plperl,
postgresql-plpython, postgresql-pltcl

I've located the "plperl.so" file - it's in the /usr/lib/postgresql
directory and has permissions of 755.
The "libperl.so" file is located in the
/usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE directory and has
permissions of 555.

I've attempted the command as the "postgres" user and using my own user
ID (I'm a "superuser") but the results are the same.  I've also tried
the createlang command to add tcl and python, with similar results.

I'm thinking that the installation is looking for the problem files in a
location different from where they're actually located (but I may be
completely off base on that assumption).

Does anyone have a solution?

Thanks in advance.

John

Re: createlang error(s)

From
Tom Lane
Date:
John Burski <SnowCritter@charter.net> writes:
> createlang: language installation failed: ERROR: could not load library
> "/usr/lib/postgresql/plperl.so": libperl.so: cannot open shared object
> file: No such file or directory

ldd on plperl.so might be informative.

> The "libperl.so" file is located in the
> /usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE directory and has
> permissions of 555.

I don't know for sure about SUSE, but on Red Hat-derived systems it's
standard (and no I don't think this is sane) to put plperl.so into
a directory such as that, but not include that directory in the ldconfig
search path.  This means that plperl.so MUST have an explicit rpath
to that directory or it will fail as above.  So if ldd shows plperl.so
as not resolving its link to libperl.so, that's probably your problem.

Where did you get your postgres build from?  This is pretty clear
packager error IMHO.

> ... I've also tried
> the createlang command to add tcl and python, with similar results.

Hmm.  libtcl and libpython are normally installed in sane locations, so
whatever their problem is is something different.  Again, ldd would be
informative.

            regards, tom lane

Re: createlang error(s)

From
Tom Lane
Date:
John Burski <snowcritter@charter.net> writes:
> I got my postgresql build from the from a Novell SuSE Linux repository
> (mirror.susestudio.com).

> Here's the result of a run of ldd against the plperl.so file:

>     linux-gate.so.1 =>  (0xffffe000)
>     libperl.so => not found

File a bug with the SUSE packager.  "Medium broil" would be about right.
Don't they test their packages?

> I copied the "libperl.so" file from its original location to the
> "/lib" directory and tried the "createlang" command again - SUCCESS!

OK as a short-term workaround, but that's no excuse for it not being
right to start with ...

            regards, tom lane

Re: createlang error(s)

From
John Burski
Date:
Thanks for your response, Tom!

I got my postgresql build from the from a Novell SuSE Linux repository
(mirror.susestudio.com).

Here's the result of a run of ldd against the plperl.so file:

    linux-gate.so.1 =>  (0xffffe000)
    libperl.so => not found
    libnsl.so.1 => /lib/libnsl.so.1 (0xb76aa000)
    libdl.so.2 => /lib/libdl.so.2 (0xb76a5000)
    libm.so.6 => /lib/libm.so.6 (0xb767c000)
    libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7644000)
    libutil.so.1 => /lib/libutil.so.1 (0xb7640000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xb7626000)
    libc.so.6 => /lib/libc.so.6 (0xb74ca000)
    /lib/ld-linux.so.2 (0xb76f1000)

Apparently it is unable to locate the libperl.so file in its current
location.  It looked like the "libperl.so" file is expected to be in the
"/lib" directory (an assumption, but a good one if figured). I copied
the "libperl.so" file from its original location to the "/lib" directory
and tried the "createlang" command again - SUCCESS!

Thanks for your help!

Best regards!

John Burski

On Sun, 2009-11-01 at 18:00 -0500, Tom Lane wrote:
> John Burski <SnowCritter@charter.net> writes:
> > createlang: language installation failed: ERROR: could not load library
> > "/usr/lib/postgresql/plperl.so": libperl.so: cannot open shared object
> > file: No such file or directory
>
> ldd on plperl.so might be informative.
>
> > The "libperl.so" file is located in the
> > /usr/lib/perl5/5.10.0/i586-linux-thread-multi/CORE directory and has
> > permissions of 555.
>
> I don't know for sure about SUSE, but on Red Hat-derived systems it's
> standard (and no I don't think this is sane) to put plperl.so into
> a directory such as that, but not include that directory in the ldconfig
> search path.  This means that plperl.so MUST have an explicit rpath
> to that directory or it will fail as above.  So if ldd shows plperl.so
> as not resolving its link to libperl.so, that's probably your problem.
>
> Where did you get your postgres build from?  This is pretty clear
> packager error IMHO.
>
> > ... I've also tried
> > the createlang command to add tcl and python, with similar results.
>
> Hmm.  libtcl and libpython are normally installed in sane locations, so
> whatever their problem is is something different.  Again, ldd would be
> informative.
>
>             regards, tom lane


Re: createlang error(s)

From
Joshua Tolley
Date:
On Wed, Nov 04, 2009 at 12:12:50AM -0500, Tom Lane wrote:
> John Burski <snowcritter@charter.net> writes:
> > I got my postgresql build from the from a Novell SuSE Linux repository
> > (mirror.susestudio.com).
>
> > Here's the result of a run of ldd against the plperl.so file:
>
> >     linux-gate.so.1 =>  (0xffffe000)
> >     libperl.so => not found
>
> File a bug with the SUSE packager.  "Medium broil" would be about right.
> Don't they test their packages?
>
> > I copied the "libperl.so" file from its original location to the
> > "/lib" directory and tried the "createlang" command again - SUCCESS!
>
> OK as a short-term workaround, but that's no excuse for it not being
> right to start with ...
>
>             regards, tom lane

I've had this problem, too, though I hate to admit that I haven't actually
filed a bug already SUSE. I was fairly far removed from the actual
installation in that case, if it's any excuse ;) Anyway, I can confirm you're
not the only one having this problem.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Attachment