Project

Profile

Help

Issue #2911

Syncing file repo results in traceback

Added by dkliban@redhat.com over 2 years ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 22

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

Associated revisions

Revision de7bba7e View on GitHub
Added by jortel@redhat.com over 2 years ago

Fix passing SSL settings.
closes #2911

Revision de7bba7e View on GitHub
Added by jortel@redhat.com over 2 years ago

Fix passing SSL settings.
closes #2911

Revision de7bba7e View on GitHub
Added by jortel@redhat.com over 2 years ago

Fix passing SSL settings.
closes #2911

History

#1 Updated by jortel@redhat.com over 2 years ago

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

#2 Updated by jortel@redhat.com over 2 years ago

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

#3 Updated by jortel@redhat.com over 2 years ago

  • Status changed from NEW to ASSIGNED

#4 Updated by jortel@redhat.com over 2 years ago

  • Status changed from ASSIGNED to POST

#6 Updated by jortel@redhat.com over 2 years ago

  • Status changed from POST to MODIFIED

#7 Updated by bmbouter almost 2 years ago

  • Tags deleted (Pulp 3 Plugin Writer Alpha)

Cleaning up Redmine tags

#8 Updated by bmbouter over 1 year ago

  • Sprint set to Sprint 22

#9 Updated by bmbouter over 1 year ago

  • Sprint/Milestone deleted (41)

#10 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#11 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF