functional test fails with RuntimeError: http_proxy or https_proxy set in environment, please unset

Bug #1706545 reported by Balazs Gibizer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Sean Dague

Bug Description

In an environment where http proxy is needed to create a python virtual env for the test run the functional tests fail with the similar stack traces:

    Traceback (most recent call last):
      File "nova/tests/functional/notification_sample_tests/test_instance.py", line 91, in setUp
        super(TestInstanceNotificationSample, self).setUp()
      File "nova/tests/functional/notification_sample_tests/notification_sample_base.py", line 86, in setUp
        self.useFixture(nova_fixtures.PlacementFixture())
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/testtools/testcase.py", line 756, in useFixture
        reraise(*exc_info)
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/testtools/testcase.py", line 731, in useFixture
        fixture.setUp()
      File "nova/tests/fixtures.py", line 1403, in setUp
        intercept.install_intercept()
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/wsgi_intercept/interceptor.py", line 89, in install_intercept
        self._module.install()
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/wsgi_intercept/_urllib3.py", line 34, in install
        'http_proxy or https_proxy set in environment, please unset')
    RuntimeError: http_proxy or https_proxy set in environment, please unset

This is because passenv config of tox.ini contains the http_proxy and https_proxy env variables and therefore tox passing them into the test executor.

Tags: testing
tags: added: testing
Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :
Download full text (4.3 KiB)

As a side note. If build a virtualenv with the proxy set, then unset the proxy variables then star tox -e functional then I got a different failure:
2017-07-26 10:38:02,702 ERROR [nova.compute.manager] Error updating resources for node fake-mini.
    Traceback (most recent call last):
      File "nova/compute/manager.py", line 6564, in update_available_resource_for_node
        rt.update_available_resource(context, nodename)
      File "nova/compute/resource_tracker.py", line 626, in update_available_resource
        self._update_available_resource(context, resources)
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 271, in inner
        return f(*args, **kwargs)
      File "nova/compute/resource_tracker.py", line 650, in _update_available_resource
        self._init_compute_node(context, resources)
      File "nova/compute/resource_tracker.py", line 536, in _init_compute_node
        self._update(context, cn)
      File "nova/compute/resource_tracker.py", line 816, in _update
        self.scheduler_client.update_compute_node(compute_node)
      File "nova/scheduler/client/__init__.py", line 68, in update_compute_node
        self.reportclient.update_compute_node(compute_node)
      File "nova/scheduler/client/__init__.py", line 37, in __run_method
        return getattr(self.instance, __name)(*args, **kwargs)
      File "nova/scheduler/client/report.py", line 869, in update_compute_node
        compute_node.hypervisor_hostname)
      File "nova/scheduler/client/report.py", line 481, in _ensure_resource_provider
        rp = self._get_resource_provider(uuid)
      File "nova/scheduler/client/report.py", line 56, in wrapper
        return f(self, *a, **k)
      File "nova/scheduler/client/report.py", line 375, in _get_resource_provider
        resp = self.get("/resource_providers/%s" % uuid)
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/fixtures/_fixtures/monkeypatch.py", line 89, in avoid_get
        return captured_method(*args, **kwargs)
      File "nova/tests/fixtures.py", line 1450, in _fake_get
        raise_exc=False)
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 845, in get
        return self.request(url, 'GET', **kwargs)
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/positional/__init__.py", line 101, in inner
        return wrapped(*args, **kwargs)
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 703, in request
        resp = send(**kwargs)
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 761, in _send_request
        resp = self.session.request(method, url, **kwargs)
      File "/home/cloudci/ebalgib/nova.git/functional/.tox/functional/local/lib/python2.7/site-packages/requests/sessions.py", line 502, in request
        resp = self.send(prep, **send_kwargs)
      File ...

Read more...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/487327

Changed in nova:
assignee: nobody → Balazs Gibizer (balazs-gibizer)
status: New → In Progress
Changed in nova:
importance: Undecided → Low
Changed in nova:
assignee: Balazs Gibizer (balazs-gibizer) → Sean Dague (sdague)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/487327
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=dd26d3d14139dedc97397639117f56970940b500
Submitter: Jenkins
Branch: master

commit dd26d3d14139dedc97397639117f56970940b500
Author: Balazs Gibizer <email address hidden>
Date: Wed Jul 26 11:03:13 2017 +0200

    do not pass proxy env variables by tox

    In an environment where http_proxy env variable is needed to buil a
    proper python virtualenv the functional test fails with:
    RuntimeError: http_proxy or https_proxy set in environment, please unset

    This patch removes passing proxy env varibles in tox.ini to avoid this
    error.

    Change-Id: Ia4d8fe952aecb5c3e688878ef0fdafd6fac4fc7a
    Closes-Bug: #1706545

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.0.0rc1

This issue was fixed in the openstack/nova 16.0.0.0rc1 release candidate.

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.