Issue #5283
closedAPI paramenter issue
Description
HI,
I've been trying to use the Pulp 2.18 API but for some reason, I'm getting an error which could be something stupid but I'm didn't manage to figure out.
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: py.warnings:WARNING: [f22446a0] (31848-21504) /usr/lib64/python2.7/site-packages/pymongo/topology.py:74: UserWarning: MongoClient opened before fork. Create MongoClient with connect=False, or create client after forking. See PyMongo's documentation for details: http://api.mongodb.org/python/current/faq.html#using-pymongo-with-multiprocessing>
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: py.warnings:WARNING: [f22446a0] (31848-21504) "MongoClient opened before fork. Create MongoClient "
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: py.warnings:WARNING: [f22446a0] (31848-21504)
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: pulp.server.async.tasks:INFO: [f22446a0] Task failed : [f22446a0-0f8f-4703-a95c-5209c113b497]
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) Task pulp.server.managers.repo.unit_association.associate_from_repo[f22446a0-0f8f-4703-a95c-5209c113b497] raised unexpected: MissingResource({'repo_id': 'sle-module-adv-systems-management12-debuginfo-pool-sp3-snapshot-20190814'},)
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) Traceback (most recent call last):
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) R = retval = fun(*args, **kwargs)
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 529, in __call__
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) return super(Task, self).__call__(*args, **kwargs)
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 107, in __call__
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) return super(PulpTask, self).__call__(*args, **kwargs)
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) return self.run(*args, **kwargs)
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/unit_association.py", line 224, in associate_from_repo
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) dest_repo_importer = model.Importer.objects.get_or_404(repo_id=dest_repo_id)
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) File "/usr/lib/python2.7/site-packages/pulp/server/db/querysets.py", line 119, in get_or_404
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) raise pulp_exceptions.MissingResource(**kwargs)
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:ERROR: [f22446a0] (31848-21504) MissingResource: Missing resource(s): repo_id=sle-module-adv-systems-management12-debuginfo-pool-sp3-snapshot-20190814
Aug 14 15:18:33 n5lpulp00001.nike.com pulp[31848]: celery.app.trace:INFO: [bbdb1c06] Task pulp.server.async.tasks._release_resource[bbdb1c06-8511-4723-8580-7e14ad2fcd14] succeeded in 0.00149612990208s: None
The request which I'm sending is something like this:
copy_url = f"{repo_context}{new_repo_id}/actions/associate/"
# print(f"COPY URL {copy_url}")
copy_payload = {
"source_repo_id" : repo_id,
"override_config": {
"recursive": True
}
}
try:
copy_content = requests.post(copy_url, json=copy_payload, verify=False, cert=('cert_file', 'key_file'))
copy_content.raise_for_status()
except requests.exceptions.HTTPError as err:
new_repo_delete = requests.delete(f"{repo_context}/{new_repo_id}",verify=False, cert=('cert_file', 'key_file'))
print(err)
I'm not a developer and I'm only developing a small tool to take snapshots of the current repositories and the steps which I'm following are:
1 - Create a new repo
2 - Copy the units from a repo to another (It's failing)
3 - Publish the new repository
Thank you for any information.
Regards,
Flamarion
Updated by amacdona@redhat.com over 4 years ago
- Status changed from NEW to CLOSED - NOTABUG
I don't think there is a bug here so I am going to close, but we'd be happy to help you. The best way to get help is to join #pulp on freenode or send an email to pulp-list.
This is a link to pulp3 docs, but the community part is the same for pulp2. https://docs.pulpproject.org/en/3.0/nightly/#community
Updated by bmbouter almost 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.