Project

Profile

Help

Issue #2911

closed

Syncing file repo results in traceback

Added by dkliban@redhat.com over 7 years ago. Updated about 5 years ago.

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

Description

[vagrant@dev devel]$ http POST http://localhost:1234/api/v3/repositories/test-repo/importers/file/test-importer/sync/

Syncing a file repo without repo protection causes a traceback while the task is running.

2017-07-15 03:56:38,950: WARNING/PoolWorker-1] FileImporter: synchronizing repository test-repo
[2017-07-15 03:56:38,950: WARNING/PoolWorker-1] FileImporter: synchronizing repository test-repo
[2017-07-15 03:56:52,681: ERROR/PoolWorker-1] Task failed : [9532e8c4-ad1a-4188-ba38-61b9fd204047]
[2017-07-15 03:56:52,692: ERROR/PoolWorker-1] Task pulpcore.app.tasks.importer.sync[9532e8c4-ad1a-4188-ba38-61b9fd204047] raised unexpected: TypeError('argument sho
uld be string, bytes or integer, not tuple',)
Traceback (most recent call last):
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/celery/app/trace.py", line 367, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/vagrant/devel/pulp/platform/pulpcore/tasking/tasks.py", line 272, in __call__
    return super(UserFacingTask, self).__call__(*args, **kwargs)
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/celery/app/trace.py", line 622, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/vagrant/devel/pulp/platform/pulpcore/app/tasks/importer.py", line 75, in sync
    importer.sync()
  File "/home/vagrant/devel/pulp_file/pulp_file/app/models.py", line 85, in sync
    changeset = self._build_changeset()
  File "/home/vagrant/devel/pulp_file/pulp_file/app/models.py", line 225, in _build_changeset
    manifest = self._fetch_manifest()
  File "/home/vagrant/devel/pulp_file/pulp_file/app/models.py", line 131, in _fetch_manifest
    download()
  File "/home/vagrant/devel/pulp/platform/pulpcore/download/single.py", line 230, in __call__
    self._attempt()
  File "/home/vagrant/devel/pulp/platform/pulpcore/download/single.py", line 149, in _attempt
    self._send()
  File "/home/vagrant/devel/pulp/platform/pulpcore/download/http.py", line 214, in _send
    self.reply = self.method()
  File "/home/vagrant/devel/pulp/platform/pulpcore/download/http.py", line 192, in _get
    return self.session.get(self.url, **self._settings()) 
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/requests/sessions.py", line 515, in get
    return self.request('GET', url, **kwargs)
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/requests/sessions.py", line 502, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/requests/sessions.py", line 612, in send
    r = adapter.send(request, **kwargs)
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/requests/adapters.py", line 407, in send
    self.cert_verify(conn, request.url, verify, cert)
  File "/home/vagrant/.virtualenvs/pulp/lib/python3.5/site-packages/requests/adapters.py", line 224, in cert_verify
    if not cert_loc or not os.path.exists(cert_loc):
  File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/genericpath.py", line 19, in exists
    os.stat(path)
TypeError: argument should be string, bytes or integer, not tuple

The following diff got me past this problem.

diff --git a/platform/pulpcore/download/http.py b/platform/pulpcore/download/http.py
index 78b55d4..1dcac5b 100644
--- a/platform/pulpcore/download/http.py
+++ b/platform/pulpcore/download/http.py
@@ -170,12 +170,12 @@ class HttpDownload(Download):
             }
         if self.headers:
             options['headers'] = self.headers
-        if self.ssl.ca_certificate:
-            options['verify'] = self.ssl.ca_certificate
-        if self.ssl.client_certificate:
-            options['cert'] = self.ssl.client_certificate
-        if self.ssl.client_key:
-            options['cert'] = (options['cert'], self.ssl.client_key)
+        #if self.ssl.ca_certificate:
+        #    options['verify'] = self.ssl.ca_certificate
+        #if self.ssl.client_certificate:
+        #    options['cert'] = self.ssl.client_certificate
+        #if self.ssl.client_key:
+        #    options['cert'] = (options['cert'], self.ssl.client_key)

         return options
Actions #1

Updated by jortel@redhat.com over 7 years ago

Looks like a simple fix. Just passing the certificate/key to python-requests incorrectly.

Actions #2

Updated by jortel@redhat.com over 7 years ago

  • Assignee set to jortel@redhat.com
  • Sprint/Milestone set to 41
  • Triaged changed from No to Yes
Actions #3

Updated by jortel@redhat.com over 7 years ago

  • Status changed from NEW to ASSIGNED

Added by jortel@redhat.com over 7 years ago

Revision de7bba7e | View on GitHub

Fix passing SSL settings. closes #2911

Added by jortel@redhat.com over 7 years ago

Revision de7bba7e | View on GitHub

Fix passing SSL settings. closes #2911

Actions #4

Updated by jortel@redhat.com over 7 years ago

  • Status changed from ASSIGNED to POST
Actions #6

Updated by jortel@redhat.com over 7 years ago

  • Status changed from POST to MODIFIED
Actions #7

Updated by bmbouter about 7 years ago

  • Tags deleted (Pulp 3 Plugin Writer Alpha)

Cleaning up Redmine tags

Actions #8

Updated by bmbouter almost 7 years ago

  • Sprint set to Sprint 22
Actions #9

Updated by bmbouter almost 7 years ago

  • Sprint/Milestone deleted (41)
Actions #10

Updated by daviddavis over 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #11

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #12

Updated by bmbouter about 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF