Composer_wrapper will no use proxies

Hi folks,

So I’m trying to run composer_wrapper.php but for some reason it is ignoring my proxy settings.

these values are here…
declare -x HTTPS_PROXY=“http://proxy.ny9.redacted.com:80
declare -x HTTP_PROXY=“http://proxy.ny9.redacted.com:80

I am able to get to the web doing basic curls and my install, aside from this, was able to get to the Internet.

When I do a packet capture I can see that it is trying to go direct…

02:48:36.361877 IP 172.17.0.2.55624 > 185.199.108.153.https: Flags [S], seq 3911535672, win 29200, options [mss 1460,sackOK,TS val 1144135744 ecr 0,nop,wscale 7], length 0
02:48:44.377865 IP 172.17.0.2.55624 > 185.199.108.153.https: Flags [S], seq 3911535672, win 29200, options [mss 1460,sackOK,TS val 1144143760 ecr 0,nop,wscale 7], length 0
02:49:00.425895 IP 172.17.0.2.55624 > 185.199.108.153.https: Flags [S], seq 3911535672, win 29200, options [mss 1460,sackOK,TS val 1144159808 ecr 0,nop,wscale 7], length 0

that ip address is github.

I did an echo of the $proxy variable in the composer_wrapper.php inside the first if conditional and it displays the right value.

So I’m kinda at a loss as to what I am supposed to do.

Oh so to show that the proxies are working…

[root@32fe31951967 scripts]# curl https://composer.github.io/installer.sig
48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5

Some code was just committed changing how that script works.

Can you post the output of ./validate.php?

[root@32fe31951967 /]# cd /opt/librenms/
[root@32fe31951967 librenms]# ./validate.php

Component Version
LibreNMS 1.48.1-90-g3ad698f
DB Schema Not Connected (0)
PHP 7.2.14
MySQL ?
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2

====================================

[FAIL] No composer available, please install composer
[FIX]:

I am running this in a docker that I built. We needed RedHat so the standard dockers provided weren’t an option.

The mysql stuff is fine. This is a new build and I haven’t done the set up yet.

Looks like something changed on the latest build and it is working properly now.

I spoke too soon. I rebuilt the docker image to verify and it’s busted again.

Now I’m really confused.

So I have at least found out a solution sort of.

After I start up the container I have to do the following.

run ./daily.sh
I will get this error…

bash-4.2$ ./daily.sh
Updating to latest codebase FAIL
error: unable to unlink old ‘composer.json’ (Permission denied)

I then need to run, as root, git commit.
Then I can run ./daily.sh without the error.
Then I can run
./scripts/composer_wrapper.php install --no-dev

If I don’t run ./daily.sh I am unable to do the git commit as it says there is nothing to commit to.

Is this normal behavior? I am still learning git.

You have run some commands as the root user, which broke file permissions.

run ./validate.php and it will show you the commands to fix permissions.

That’s interesting. So I basically followed the Centos instructions.

If you look here…

https://docs.librenms.org/Installation/Installation-CentOS-7-Apache/

The instructions explicitly state that you are supposed to run everything as root.

If I try to run composer create-project --no-dev --keep-vcs librenms/librenms librenms dev-master as librenms it kicks back a permission error.

I have a work around but I’m curious as to how to sequence this properly.

I get that it is a file permission problem but I’m confused as to how the problem is created.

So I played around with this for much of the afternoon and I have to say that I don’t get what needs to be done here.

The instructions say that the composer command should be run as root eventhough it complains about running as root.

If I run it as librenms it can’t because it can’t create the /opt/librenms directory. If I create the directory it complains about it not being empty.

Is there something I’m missing here?

So I guess I should have realized this earlier but the fundamental problem appears to be that git needed the proxy configured as well.

git config --global http.proxy http://proxyserver:proxyport