Does not install behind a proxy

Bug #1665623 reported by Andreas Hasenack
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
elasticsearch (Juju Charms Collection)
New
Undecided
Unassigned

Bug Description

I have a juju2 model whose applications have to use a proxy to reach the internet.

Most charms work ok, but elasticsearch seems to ignore the juju proxy settings and doesn't work:

2017-02-17 12:07:13 INFO juju-log Installing ansible with options: ['--option=Dpkg::Options::=--force-confold']
2017-02-17 12:07:13 INFO install Reading package lists...
2017-02-17 12:07:13 INFO install Building dependency tree...
2017-02-17 12:07:13 INFO install Reading state information...
2017-02-17 12:07:13 INFO install ansible is already the newest version.
2017-02-17 12:07:13 INFO install The following packages were automatically installed and are no longer required:
2017-02-17 12:07:13 INFO install libfreetype6 os-prober
2017-02-17 12:07:13 INFO install Use 'apt-get autoremove' to remove them.
2017-02-17 12:07:13 INFO install 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2017-02-17 12:07:13 INFO juju-log /usr/bin/rsync -r --delete --executability ansible_module_backports /usr/share/ansible
2017-02-17 12:07:14 INFO install
2017-02-17 12:07:14 INFO install PLAY [localhost] **************************************************************
2017-02-17 12:07:14 INFO install
2017-02-17 12:07:14 INFO install GATHERING FACTS ***************************************************************
2017-02-17 12:07:15 INFO install ok: [localhost]
2017-02-17 12:07:15 INFO install
2017-02-17 12:07:15 INFO install TASK: [Add apt key.] **********************************************************
2017-02-17 12:07:46 INFO install failed: [localhost] => {"failed": true, "item": "", "traceback": "Traceback (most recent call last):\n File \"/.ansible/tmp/ansible-tmp-1487333235.43-207024382735290/apt_key\", line 144, in download_key\n return rsp.read()\nAttributeError: 'NoneType' object has no attribute 'read'\n"}
2017-02-17 12:07:46 INFO install msg: error getting key id from url
2017-02-17 12:07:46 INFO install
2017-02-17 12:07:46 INFO install FATAL: all hosts have already failed -- aborting
2017-02-17 12:07:46 INFO install
2017-02-17 12:07:46 INFO install PLAY RECAP ********************************************************************
2017-02-17 12:07:46 INFO install localhost : ok=1 changed=0 unreachable=0 failed=1
2017-02-17 12:07:46 INFO install
2017-02-17 12:07:46 INFO install Traceback (most recent call last):
2017-02-17 12:07:46 INFO install File "/var/lib/juju/agents/unit-elasticsearch-0/charm/hooks/install", line 101, in <module>
2017-02-17 12:07:46 INFO install hooks.execute(sys.argv)
2017-02-17 12:07:46 INFO install File "/var/lib/juju/agents/unit-elasticsearch-0/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 171, in execute
2017-02-17 12:07:46 INFO install self.playbook_path, tags=[hook_name])
2017-02-17 12:07:46 INFO install File "/var/lib/juju/agents/unit-elasticsearch-0/charm/hooks/charmhelpers/contrib/ansible/__init__.py", line 116, in apply_playbook
2017-02-17 12:07:46 INFO install subprocess.check_call(call, env=env)
2017-02-17 12:07:46 INFO install File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
2017-02-17 12:07:46 INFO install raise CalledProcessError(retcode, cmd)
2017-02-17 12:07:46 INFO install subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'playbook.yaml', '--tags', 'install']' returned non-zero exit status 2
2017-02-17 12:07:46 ERROR juju.worker.uniter.operation runhook.go:107 hook "install" failed: exit status 1

And indeed:
# netstat -anp 2>/dev/null|grep SYN
tcp 0 1 10.245.204.158:48610 23.21.141.126:80 SYN_SENT 3282/python

$ juju model-config|grep -i proxy
apt-ftp-proxy default ""
apt-http-proxy default ""
apt-https-proxy default ""
ftp-proxy default ""
http-proxy controller http://squid.vmwarestack:3128/
https-proxy controller http://squid.vmwarestack:3128/
no-proxy controller localhost,127.0.0.1,10.245.200.25,169.254.169.254,10.245.200.27
proxy-ssh default false

on the elasticsearch/0 unit:
# cat /home/ubuntu/.juju-proxy
export http_proxy=http://squid.vmwarestack:3128/
export HTTP_PROXY=http://squid.vmwarestack:3128/
export https_proxy=http://squid.vmwarestack:3128/
export HTTPS_PROXY=http://squid.vmwarestack:3128/
export no_proxy=10.245.200.25,10.245.200.27,10.245.204.111,127.0.0.1,169.254.169.254,::1,localhost
export NO_PROXY=10.245.200.25,10.245.200.27,10.245.204.111,127.0.0.1,169.254.169.254,::1,localhost

I even copied that to /etc/environment, but didn't help.

apt has the right proxy settings over there:
root@juju-ce7091-25-lxd-0:/etc/apt# grep proxy -ri .
./apt.conf.d/42-juju-proxy-settings:Acquire::http::Proxy "http://squid.vmwarestack:3128/";
./apt.conf.d/42-juju-proxy-settings:Acquire::https::Proxy "http://squid.vmwarestack:3128/";

Maybe the charm needs to grow a specific proxy option.

Tags: landscape
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.