Project

Profile

Help

Issue #2144

closed

unbound method send()

Added by Ichimonji10 over 7 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Urgent
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.8.7
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Yesterday, 2016-08-09, I provisioned a fresh pair of Fedora 23 VMs and installed the current nightly version of Pulp 2.9.3 and 2.10.0. I then ran the following command in a virtualenv with Pulp Smash installed:

python -m unittest2 pulp_smash.tests.rpm.api_v2.test_download_policies

All three test cases in the module failed. SSH-ing into the target systems and viewing the logs with journalctl shows the following error, numerous times:

Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264) unbound method send() must be called with PulpHTTPAdapter instance as first argument (got PreparedRequest instance instead)
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264) Traceback (most recent call last):
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264)   File "/usr/lib/python2.7/site-packages/nectar/downloaders/threaded.py", line 221, in _fetch
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264)     self.config.read_timeout))
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264)   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 487, in get
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264)     return self.request('GET', url, **kwargs)
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264)   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264)     resp = self.send(prep, **send_kwargs)
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264)   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 585, in send
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264)     r = adapter.send(request, **kwargs)
Aug 09 15:23:57 example.com pulp_streamer[5933]: nectar.downloaders.threaded:ERROR: (5933-79264) TypeError: unbound method send() must be called with PulpHTTPAdapter instance as first argument (got PreparedRequest instance instead)
Aug 09 15:23:57 example.com pulp_streamer[5933]: [-] "127.0.0.1" - - [09/Aug/2016:19:23:56 +0000] "GET /var/lib/pulp/content/units/rpm/62/7c493152b5de3cfccb681fb98b0f56089425db3030328767c0cc031b2235b3/bear-4.1-1.noarch.rpm HTTP/1.1" 503 - "-" "python-requests/2.11.0"

Here are the relevant packages installed on the first system:

$ ssh $hostname rpm -qa | grep -i nectar
python-nectar-1.5.2-1.fc23.noarch
$ ssh $hostname rpm -qa | sort | grep -i pulp                              
pulp-admin-client-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch
pulp-docker-admin-extensions-2.0.4-0.1.alpha.git.10.6ada825.fc23.noarch
pulp-docker-plugins-2.0.4-0.1.alpha.git.10.6ada825.fc23.noarch
pulp-ostree-admin-extensions-1.1.4-0.1.alpha.git.11.09a04e0.fc23.noarch
pulp-ostree-plugins-1.1.4-0.1.alpha.git.11.09a04e0.fc23.noarch
pulp-puppet-admin-extensions-2.9.3-0.1.alpha.git.1.3c25913.fc23.noarch
pulp-puppet-plugins-2.9.3-0.1.alpha.git.1.3c25913.fc23.noarch
pulp-python-admin-extensions-1.1.4-0.1.alpha.git.25.caa51b0.fc23.noarch
pulp-python-plugins-1.1.4-0.1.alpha.git.25.caa51b0.fc23.noarch
pulp-rpm-admin-extensions-2.9.3-0.1.alpha.git.1.27300b4.fc23.noarch
pulp-rpm-plugins-2.9.3-0.1.alpha.git.1.27300b4.fc23.noarch
pulp-selinux-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch
pulp-server-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch
python-kombu-3.0.33-6.pulp.fc23.noarch
python-pulp-bindings-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch
python-pulp-client-lib-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch
python-pulp-common-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch
python-pulp-docker-common-2.0.4-0.1.alpha.git.10.6ada825.fc23.noarch
python-pulp-oid_validation-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch
python-pulp-ostree-common-1.1.4-0.1.alpha.git.11.09a04e0.fc23.noarch
python-pulp-puppet-common-2.9.3-0.1.alpha.git.1.3c25913.fc23.noarch
python-pulp-python-common-1.1.4-0.1.alpha.git.25.caa51b0.fc23.noarch
python-pulp-repoauth-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch
python-pulp-rpm-common-2.9.3-0.1.alpha.git.1.27300b4.fc23.noarch
python-pulp-streamer-2.9.3-0.1.alpha.git.6.6b5603a.fc23.noarch

Here are the packages installed on the second system:

$ ssh $hostname rpm -qa | grep -i nectar
python-nectar-1.5.2-1.fc23.noarch
$ ssh $hostname rpm -qa | sort | grep -i pulp                              
pulp-admin-client-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch
pulp-docker-admin-extensions-2.1.0-0.1.beta.git.148.8bbf6a7.fc23.noarch
pulp-docker-plugins-2.1.0-0.1.beta.git.148.8bbf6a7.fc23.noarch
pulp-ostree-admin-extensions-1.1.3-1.fc23.noarch
pulp-ostree-plugins-1.1.3-1.fc23.noarch
pulp-puppet-admin-extensions-2.10.0-0.1.beta.git.154.ac3d234.fc23.noarch
pulp-puppet-plugins-2.10.0-0.1.beta.git.154.ac3d234.fc23.noarch
pulp-python-admin-extensions-1.1.3-1.fc23.noarch
pulp-python-plugins-1.1.3-1.fc23.noarch
pulp-rpm-admin-extensions-2.10.0-0.1.beta.git.393.fb77e10.fc23.noarch
pulp-rpm-plugins-2.10.0-0.1.beta.git.393.fb77e10.fc23.noarch
pulp-selinux-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch
pulp-server-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch
python-kombu-3.0.33-5.pulp.fc23.noarch
python-pulp-bindings-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch
python-pulp-client-lib-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch
python-pulp-common-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch
python-pulp-docker-common-2.1.0-0.1.beta.git.148.8bbf6a7.fc23.noarch
python-pulp-oid_validation-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch
python-pulp-ostree-common-1.1.3-1.fc23.noarch
python-pulp-puppet-common-2.10.0-0.1.beta.git.154.ac3d234.fc23.noarch
python-pulp-python-common-1.1.3-1.fc23.noarch
python-pulp-repoauth-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch
python-pulp-rpm-common-2.10.0-0.1.beta.git.393.fb77e10.fc23.noarch
python-pulp-streamer-2.10.0-0.1.beta.git.481.2cc9f54.fc23.noarch

No bueno.

Actions #2

Updated by jcline@redhat.com over 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jcline@redhat.com

Added by Jeremy Cline over 7 years ago

Revision 0856178a | View on GitHub

Instantiate the PulpHTTPAdapter

fixes #2144

Added by Jeremy Cline over 7 years ago

Revision 0856178a | View on GitHub

Instantiate the PulpHTTPAdapter

fixes #2144

Actions #3

Updated by jcline@redhat.com over 7 years ago

  • Status changed from ASSIGNED to POST
Actions #4

Updated by Anonymous over 7 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #5

Updated by semyers over 7 years ago

  • Priority changed from Normal to Urgent
  • Platform Release set to 2.8.7
  • Triaged changed from No to Yes

This will be included in 2.8.7. I'm also including this in the 2.9.2 hotfix, and it will be automatically included in the next 2.10 beta.

Added by Jeremy Cline over 7 years ago

Revision 75320287 | View on GitHub

Instantiate the PulpHTTPAdapter

fixes #2144

Added by Jeremy Cline over 7 years ago

Revision 75320287 | View on GitHub

Instantiate the PulpHTTPAdapter

fixes #2144

Actions #6

Updated by semyers over 7 years ago

  • Project changed from Nectar to Pulp
Actions #7

Updated by semyers over 7 years ago

  • Status changed from MODIFIED to 5
Actions #8

Updated by Ichimonji10 over 7 years ago

  • Status changed from 5 to ASSIGNED

Issue is still present in a current build of 2.8.7. Here's the command used: (The test also fails for the other two test cases in the module.)

python -m unittest2 pulp_smash.tests.rpm.api_v2.test_download_policies.BackgroundTestCase

Here's some entries from journalctl:

Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984) unbound method send() must be called with PulpHTTPAdapter instance as first argument (got PreparedRequest instance instead)
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984) Traceback (most recent call last):
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984)   File "/usr/lib/python2.7/site-packages/nectar/downloaders/threaded.py", line 221, in _fetch
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984)     self.config.read_timeout))
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984)   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 476, in get
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984)     return self.request('GET', url, **kwargs)
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984)   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 464, in request
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984)     resp = self.send(prep, **send_kwargs)
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984)   File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984)     r = adapter.send(request, **kwargs)
Aug 15 19:43:40 example.com pulp_streamer[14756]: nectar.downloaders.threaded:ERROR: (14756-73984) TypeError: unbound method send() must be called with PulpHTTPAdapter instance as first argument (got PreparedRequest instance instead)
Aug 15 19:43:40 example.com pulp_streamer[14756]: [-] 127.0.0.1 - - [15/Aug/2016:17:43:39 +0000] "GET /var/lib/pulp/content/units/rpm/62/7c493152b5de3cfccb681fb98b0f56089425db3030328767c0cc031b2235b3/bear-4.1-1.noarch.rpm HTTP/1.1" 503 - "-" "python-requests/2.11.0"

Here's some relevant package manager information:

$ ssh $hostname rpm -qa | grep -i nectar
python-nectar-1.5.2-1.el7.noarch
$ ssh $hostname rpm -qa | sort | grep -i pulp
pulp-admin-client-2.8.7-0.3.beta.el7.noarch
pulp-docker-admin-extensions-2.0.3-1.el7.noarch
pulp-docker-plugins-2.0.3-1.el7.noarch
pulp-ostree-admin-extensions-1.1.3-1.el7.noarch
pulp-ostree-plugins-1.1.3-1.el7.noarch
pulp-puppet-admin-extensions-2.8.7-0.2.beta.el7.noarch
pulp-puppet-plugins-2.8.7-0.2.beta.el7.noarch
pulp-python-admin-extensions-1.1.3-1.el7.noarch
pulp-python-plugins-1.1.3-1.el7.noarch
pulp-rpm-admin-extensions-2.8.7-0.2.beta.el7.noarch
pulp-rpm-plugins-2.8.7-0.2.beta.el7.noarch
pulp-selinux-2.8.7-0.3.beta.el7.noarch
pulp-server-2.8.7-0.3.beta.el7.noarch
python-isodate-0.5.0-4.pulp.el7.noarch
python-kombu-3.0.33-6.pulp.el7.noarch
python-pulp-bindings-2.8.7-0.3.beta.el7.noarch
python-pulp-client-lib-2.8.7-0.3.beta.el7.noarch
python-pulp-common-2.8.7-0.3.beta.el7.noarch
python-pulp-docker-common-2.0.3-1.el7.noarch
python-pulp-oid_validation-2.8.7-0.3.beta.el7.noarch
python-pulp-ostree-common-1.1.3-1.el7.noarch
python-pulp-puppet-common-2.8.7-0.2.beta.el7.noarch
python-pulp-python-common-1.1.3-1.el7.noarch
python-pulp-repoauth-2.8.7-0.3.beta.el7.noarch
python-pulp-rpm-common-2.8.7-0.2.beta.el7.noarch
python-pulp-streamer-2.8.7-0.3.beta.el7.noarch
Actions #9

Updated by semyers over 7 years ago

I did a manual install and smash on f23 and could not reproduce the failure.

$ python -m unittest2 pulp_smash.tests.rpm.api_v2.test_download_policies.BackgroundTestCase
....
----------------------------------------------------------------------
Ran 4 tests in 31.083s

OK
$ rpm -qa |grep nectar
python-nectar-1.5.2-1.fc23.noarch

$ rpm -qa |grep pulp|sort
pulp-admin-client-2.8.7-0.3.beta.fc23.noarch
pulp-docker-admin-extensions-2.0.3-1.fc23.noarch
pulp-docker-plugins-2.0.3-1.fc23.noarch
pulp-puppet-admin-extensions-2.8.7-0.2.beta.fc23.noarch
pulp-puppet-plugins-2.8.7-0.2.beta.fc23.noarch
pulp-rpm-admin-extensions-2.8.7-0.2.beta.fc23.noarch
pulp-rpm-plugins-2.8.7-0.2.beta.fc23.noarch
pulp-selinux-2.8.7-0.3.beta.fc23.noarch
pulp-server-2.8.7-0.3.beta.fc23.noarch
python-kombu-3.0.33-5.pulp.fc23.noarch
python-pulp-bindings-2.8.7-0.3.beta.fc23.noarch
python-pulp-client-lib-2.8.7-0.3.beta.fc23.noarch
python-pulp-common-2.8.7-0.3.beta.fc23.noarch
python-pulp-docker-common-2.0.3-1.fc23.noarch
python-pulp-oid_validation-2.8.7-0.3.beta.fc23.noarch
python-pulp-puppet-common-2.8.7-0.2.beta.fc23.noarch
python-pulp-repoauth-2.8.7-0.3.beta.fc23.noarch
python-pulp-rpm-common-2.8.7-0.2.beta.fc23.noarch
python-pulp-streamer-2.8.7-0.3.beta.fc23.noarch

Here's a package diff with the dist and arches stripped, you can see that I don't have ostree or python plugins installed, and the python-isodate package comes straight out of fedora:

$ diff -u el7 f23 
--- el7 2016-08-15 16:03:12.229475638 -0400
+++ f23 2016-08-15 16:03:35.483611393 -0400
@@ -2,26 +2,19 @@
 pulp-admin-client-2.8.7-0.3.beta
 pulp-docker-admin-extensions-2.0.3-1
 pulp-docker-plugins-2.0.3-1
-pulp-ostree-admin-extensions-1.1.3-1
-pulp-ostree-plugins-1.1.3-1
 pulp-puppet-admin-extensions-2.8.7-0.2.beta
 pulp-puppet-plugins-2.8.7-0.2.beta
-pulp-python-admin-extensions-1.1.3-1
-pulp-python-plugins-1.1.3-1
 pulp-rpm-admin-extensions-2.8.7-0.2.beta
 pulp-rpm-plugins-2.8.7-0.2.beta
 pulp-selinux-2.8.7-0.3.beta
 pulp-server-2.8.7-0.3.beta
-python-isodate-0.5.0-4.pulp
 python-kombu-3.0.33-6.pulp
 python-pulp-bindings-2.8.7-0.3.beta
 python-pulp-client-lib-2.8.7-0.3.beta
 python-pulp-common-2.8.7-0.3.beta
 python-pulp-docker-common-2.0.3-1
 python-pulp-oid_validation-2.8.7-0.3.beta
-python-pulp-ostree-common-1.1.3-1
 python-pulp-puppet-common-2.8.7-0.2.beta
-python-pulp-python-common-1.1.3-1
 python-pulp-repoauth-2.8.7-0.3.beta
 python-pulp-rpm-common-2.8.7-0.2.beta
 python-pulp-streamer-2.8.7-0.3.beta

I doubt that the difference in platform explains the different results, but am at a loss as to what else might be causing it.

Actions #10

Updated by semyers over 7 years ago

I unpacked the el7 rpm specifically, and the fix for this issue is applied. Here's line 150 of usr/lib/python2.7/site-packages/pulp/streamer/server.py in the RPM:

        self.session.mount('https://', pulp_adapters.PulpHTTPAdapter())
Actions #11

Updated by elyezer over 7 years ago

I have commented the Pulp Smash lines that was skipping the tests and ran them:

$ py.test pulp_smash/tests/rpm/api_v2/test_download_policies.py::BackgroundTestCase
========================== test session starts ===========================
platform linux -- Python 3.4.3, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/elyezer/code/pulp-smash, inifile: 
collected 4 items 

pulp_smash/tests/rpm/api_v2/test_download_policies.py ....

======================= 4 passed in 262.51 seconds =======================

All succeeded on the following Pulp packages on RHEL 7:

# rpm -qa | grep pulp | sort
pulp-admin-client-2.8.7-0.3.beta.el7.noarch
pulp-docker-admin-extensions-2.0.3-1.el7.noarch
pulp-docker-plugins-2.0.3-1.el7.noarch
pulp-ostree-admin-extensions-1.1.3-1.el7.noarch
pulp-ostree-plugins-1.1.3-1.el7.noarch
pulp-puppet-admin-extensions-2.8.7-0.2.beta.el7.noarch
pulp-puppet-plugins-2.8.7-0.2.beta.el7.noarch
pulp-python-admin-extensions-1.1.3-1.el7.noarch
pulp-python-plugins-1.1.3-1.el7.noarch
pulp-rpm-admin-extensions-2.8.7-0.2.beta.el7.noarch
pulp-rpm-plugins-2.8.7-0.2.beta.el7.noarch
pulp-selinux-2.8.7-0.3.beta.el7.noarch
pulp-server-2.8.7-0.3.beta.el7.noarch
python-isodate-0.5.0-4.pulp.el7.noarch
python-kombu-3.0.33-6.pulp.el7.noarch
python-pulp-bindings-2.8.7-0.3.beta.el7.noarch
python-pulp-client-lib-2.8.7-0.3.beta.el7.noarch
python-pulp-common-2.8.7-0.3.beta.el7.noarch
python-pulp-docker-common-2.0.3-1.el7.noarch
python-pulp-oid_validation-2.8.7-0.3.beta.el7.noarch
python-pulp-ostree-common-1.1.3-1.el7.noarch
python-pulp-puppet-common-2.8.7-0.2.beta.el7.noarch
python-pulp-python-common-1.1.3-1.el7.noarch
python-pulp-repoauth-2.8.7-0.3.beta.el7.noarch
python-pulp-rpm-common-2.8.7-0.2.beta.el7.noarch
python-pulp-streamer-2.8.7-0.3.beta.el7.noarch

# rpm -qa | grep -i nectar
python-nectar-1.5.2-1.el7.noarch

I have not tested on Fedora 23, but it should work.

Furthermore I ran the entire test_download_policies.py and got the following:

$ py.test pulp_smash/tests/rpm/api_v2/test_download_policies.py
========================== test session starts ===========================
platform linux -- Python 3.4.3, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/elyezer/code/pulp-smash, inifile: 
collected 17 items 

pulp_smash/tests/rpm/api_v2/test_download_policies.py .................

====================== 17 passed in 585.62 seconds =======================

The Pulp Smash diff used to test this is the following:

diff --git a/pulp_smash/tests/rpm/api_v2/test_download_policies.py b/pulp_smash/tests/rpm/api_v2/test_download_policies.py
index 5884b02..fab6b46 100644
--- a/pulp_smash/tests/rpm/api_v2/test_download_policies.py
+++ b/pulp_smash/tests/rpm/api_v2/test_download_policies.py
@@ -42,8 +42,8 @@ def setUpModule():  # pylint:disable=invalid-name
     cfg = config.get_config()
     if cfg.version < Version('2.8'):
         raise unittest2.SkipTest('This module requires Pulp 2.8 or greater.')
-    if selectors.bug_is_untestable(2144, cfg.version):
-        raise unittest2.SkipTest('https://pulp.plan.io/issues/2144')
+    # if selectors.bug_is_untestable(2144, cfg.version):
+    #     raise unittest2.SkipTest('https://pulp.plan.io/issues/2144')


 def _create_repo(server_config, download_policy):
Actions #12

Updated by pthomas@redhat.com over 7 years ago

  • Status changed from ASSIGNED to 5
Actions #13

Updated by pthomas@redhat.com over 7 years ago

  • Status changed from 5 to 6

As per the last two comments, moving the issue to verified.

Actions #14

Updated by semyers over 7 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #16

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF