Page MenuHomePhabricator

One install faces an issue with LD_LIBRARY_PATH not being passed to subprocesses despite EGPCS variables_order
Open, WishlistPublic

Description

Currently we are using RHEL7 and rh-git29 (from Red Hat Sofware Collection), because the standard git is too old (1.8).

To use a software from a software collection you have to enable it (permant: "scl scl_source enable rh-git29" or temporay: "scl enable rh-git 'git <something>'"). This sets some environment variables (like PATH or LD_LIBRARY_PATH) and you ready to use it.

I know there are multiple ways to tell phabricator a different PATH variable (php config, phabricator config, ...), but afaik there is no way to set a different LD_LIBRARY_PATH variable which is needed for rh-git29. Even setting LD_LIBRARY_PATH in php-fpm.conf didn't work. Phabricator seems to ignore it.

It would be good if you could pass other enviroment variables (like LD_LIBRARY_PATH) to phabricator.

Event Timeline

This is probably T12071. Does your php.ini set variables_order to something like "GPCS"?

If so, try:

  • Setting it to EGPCS instead.
  • Restarting PHP-FPM.

variables_order was indeed set to "GPCS". I changed it to "EGPCS" but it has no effect.

My settings:

php.ini:

variables_order = "EGPCS"

php-fpm.conf:

env[PATH] = /opt/rh/rh-git29/root/usr/bin
env[LD_LIBRARY_PATH]  = /opt/rh/httpd24/root/usr/lib64

/opt/rh/rh-git29/root/usr/bin and /opt/rh/httpd24/root/usr/lib64:

$ ls -la /opt/rh/rh-git29/root/usr/bin
total 7608
dr-xr-xr-x.   2 root root     107 Apr 25 14:03 .
drwxr-xr-x.  13 root root     155 Apr 25 14:02 ..
-rwxr-xr-x. 115 root root 1924560 Oct 14  2016 git
-rwxr-xr-x. 115 root root 1924560 Oct 14  2016 git-receive-pack
-rwxr-xr-x.   2 root root  969728 Oct 14  2016 git-shell
-rwxr-xr-x. 115 root root 1924560 Oct 14  2016 git-upload-archive
-rwxr-xr-x.   2 root root 1040928 Oct 14  2016 git-upload-pack
 
$ ls -la /opt/rh/httpd24/root/usr/lib64
total 636
dr-xr-xr-x.  8 root root    214 Apr 25 14:03 .
drwxr-xr-x. 13 root root    155 Apr 25 14:03 ..
dr-xr-xr-x.  2 root root      6 May 18  2016 games
lrwxrwxrwx.  1 root root     24 Apr 25 14:03 libcurl-httpd24.so.4 -> libcurl-httpd24.so.4.4.0
-rwxr-xr-x.  1 root root 506712 Feb  9  2016 libcurl-httpd24.so.4.4.0
lrwxrwxrwx.  1 root root     28 Apr 25 14:03 libnghttp2-httpd24.so.14 -> libnghttp2-httpd24.so.14.4.1
-rwxr-xr-x.  1 root root 141536 Feb 17  2016 libnghttp2-httpd24.so.14.4.1
dr-xr-xr-x.  2 root root      6 May 18  2016 pkgconfig
dr-xr-xr-x.  5 root root     52 Apr 25 14:03 pm-utils
dr-xr-xr-x.  2 root root      6 May 18  2016 sse2
dr-xr-xr-x.  2 root root      6 May 18  2016 tls
dr-xr-xr-x.  2 root root      6 May 18  2016 X11

After restarting php-fpm I get a phabricator setup issue: Missing 'git' Binary.

My next try was to set environment.append-paths to ["/opt/rh/rh-git29/root/usr/bin"]. This works, but phabricator throws an exception while trying to execute the git binary: git-remote-http: error while loading shared libraries: libcurl-httpd24.so.4: cannot open shared object file: No such file or directory. LD_LIBRARY_PATH is still missing.

Same error occurs when symlinking git to <phabricator>/support/bin/git.

epriestley triaged this task as Wishlist priority.Apr 30 2017, 7:29 PM

We can look at this in more detail eventually, but I think there's like a 99% chance it's configuration issue which only affects you, not a bug in Phabricator, so it may be a very, very long time before we pursue it.

The expected behavior is that environmental variables are passed to subprocesses -- except in the case of T12071. This is true in the general case. If it is not true here, and not a configuration issue particular to your environment, we must have some uniquely incorrect behavior affecting LD_LIBRARY_PATH specifically, so I'm reclassifying this as a bug.

epriestley renamed this task from Make it possible to use GIT from a software collection to One install faces an issue with LD_LIBRARY_PATH not being passed to subprocesses despite EGPCS variables_order.Apr 30 2017, 7:31 PM
epriestley moved this task from Backlog to Fishing Expeditions on the Bug Report board.