Setting of LD_LIBRARY_PATH breaks curl

I have couchbase server installed in a docker container in /opt/couchbase and LD_LIBRARY_PATH environment set to:


There seems to be issue however with the content of the /opt/couchbase/lib directory because it also contains

lrwxrwxrwx  1 couchbase couchbase       16 Sep 18  2015 ->
lrwxrwxrwx  1 couchbase couchbase       16 Sep 18  2015 ->
-rw-r--r--  1 couchbase couchbase   405840 Sep 18  2015

when I run curl I always get an error message:

root@srvr01:/opt/couchbase/lib# curl
curl: no version information available (required by curl)
curl: try 'curl --help' or 'curl --manual' for more information

ldd shows that curl is forced (via LD_LIBRARY_PATH) to pick up libcurl in /opt/couchbase/lib first:

root@srvr01:/# ldd `which curl`
/usr/bin/curl: /opt/couchbase/lib/ no version information available (required by /usr/bin/curl) (0x00007ffc29465000)
!!!!!! => /opt/couchbase/lib/ (0x00007fa755045000) => /lib/x86_64-linux-gnu/ (0x00007fa754e25000) => /lib/x86_64-linux-gnu/ (0x00007fa754c07000) => /lib/x86_64-linux-gnu/ (0x00007fa75485c000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa7545fb000) => /usr/lib/x86_64-linux-gnu/ (0x00007fa7541fe000)
	/lib64/ (0x00005598875ac000) => /lib/x86_64-linux-gnu/ (0x00007fa753ffa000)

when I unset LD_LIBRARY_PATH then error message goes away, but of course some other things will probably break too since /opt/couchbase/lib contains much more. I can’t understand why couchbase installer brings the libcurl shared library on its own instead of relying on package dependendency management.

I believe it is a bug.
As a workaround I see only one viable option which is to delete libcurl* from /opt/couchbase/lib

Linux srvr01 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 GNU/Linux

curl installed:

root@srvr01:/# curl --version
curl: /opt/couchbase/lib/ no version information available (required by curl)
curl 7.38.0 (x86_64-pc-linux-gnu) libcurl/7.40.0-DEV OpenSSL/1.0.1t zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP 

Is it safe to remove libcurl* from /opt/couchbase/lib without breaking anything ?

why do you want to set LD_LIBRARY_PATH at all?

As I mentioned it is a docker container. I reused most of the official 4.0 Dockerfile:

Now I tried to download official couchbase:community-4.0.0 docker image and run it and LD_LIBRARY_PATH is set there as well:

root@3b8c7ab0a349:/# env | grep LD_LIB

so I assume it is necessary for some reason

I moved this into wrapper, so that LD_LIBRARY_PATH affects only curl and will not be exported. Change is on

@traun could you review it?