Actions
Issue #2911
closedSyncing file repo results in traceback
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
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
Updated by jortel@redhat.com over 7 years ago
Looks like a simple fix. Just passing the certificate/key to python-requests incorrectly.
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
Updated by jortel@redhat.com over 7 years ago
- Status changed from NEW to ASSIGNED
Added by jortel@redhat.com over 7 years ago
Added by jortel@redhat.com over 7 years ago
Revision de7bba7e | View on GitHub
Fix passing SSL settings. closes #2911
Updated by jortel@redhat.com over 7 years ago
- Status changed from ASSIGNED to POST
Updated by jortel@redhat.com over 7 years ago
Tested with feed: https://repos.fedorapeople.org/pulp/pulp/fixtures/file/PULP_MANIFEST
Updated by jortel@redhat.com over 7 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|de7bba7e82637e42b8fd0adff9f317b4ce82daf8.
Updated by bmbouter about 7 years ago
- Tags deleted (
Pulp 3 Plugin Writer Alpha)
Cleaning up Redmine tags
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions
Fix passing SSL settings. closes #2911