Project

Profile

Help

Issue #3210

Update Importer configuration fails.

Added by jortel@redhat.com almost 4 years ago. Updated 8 months ago.

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

Description

Updating the importer config fails.

To recreate, PUT pulp/api/v2/repositories/<id>/importers/<id>/

produces the trace:

Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688) Task pulp.server.managers.repo.importer.update_importer_config[8a2b6d45-1829-4560-b441-055e6adb56f3] raised unexpec
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688) Traceback (most recent call last):
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)     R = retval = fun(*args, **kwargs)
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)   File "/home/jortel/git/pulp/server/pulp/server/async/tasks.py", line 529, in __call__
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)     return super(Task, self).__call__(*args, **kwargs)
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)   File "/home/jortel/git/pulp/server/pulp/server/async/tasks.py", line 107, in __call__
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)     return super(PulpTask, self).__call__(*args, **kwargs)
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)     return self.run(*args, **kwargs)
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)   File "/home/jortel/git/pulp/server/pulp/server/controllers/importer.py", line 277, in update_importer_config
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)     repo_importer.save()
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)   File "/home/jortel/git/pulp/server/pulp/server/db/model/__init__.py", line 291, in save
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)     super(Importer, self).save()
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)   File "/usr/lib/python2.7/site-packages/mongoengine/document.py", line 398, in save
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688)     raise OperationError(message % unicode(err))
Dec 15 15:39:51 f25d.redhat.com pulp[20619]: celery.worker.job:ERROR: (20619-02688) OperationError: Could not save document (Cannot update 'config' and 'config.feed' at the same time)

After some investigation, it seems to be data dependant. I tried various combinations of changing values and setting some to NULL which causes a dict.pop() but haven't found the magic combination yet.

This was found posting to update the OSTree importer but I'm convinced the problem is in the core. This PUT body reproduces is for me.

{
  "importer_config":{
    "basic_auth_username": null,
    "basic_auth_password": null,
    "depth":44,
    "feed":"http://xx"
  }
}

Associated revisions

Revision 80c7b96a View on GitHub
Added by ttereshc almost 4 years ago

Save importer config in a proper way for MongoDB DictField

MongoDB does not allow to change keys of the DictField and values of the same DictField simultaneously thus we need to save importer config twice.

closes #3210 https://pulp.plan.io/issues/3210

Revision ec118d32 View on GitHub
Added by ttereshc almost 4 years ago

Save importer config in a proper way for MongoDB DictField

MongoDB does not allow to change keys of the DictField and values of the same DictField simultaneously thus we need to save importer config twice.

closes #3210 https://pulp.plan.io/issues/3210

(cherry picked from commit 80c7b96afbf80937e0406b3c22857169aafe5b46)

History

#2 Updated by ttereshc almost 4 years ago

I observed similar issue with errata model at some point. Mongo doesn't let you change a document and the document/object nested into it.

You probably had a feed before and you changed it, at the same time you probably didn't have depth and you added it (new key to the config dict). If it was done sequencially, it would work. That's my guess.

An additional save call on the importer model may solve the issue. I'll take a look.

#4 Updated by ttereshc almost 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ttereshc

#6 Updated by ttereshc almost 4 years ago

  • Status changed from ASSIGNED to POST

https://github.com/pulp/pulp/pull/3247

The problem is in removing a key from a DictField (even an attempt of @pop@ing non-existing one) at the same time as updating a value of the same DictField.

#7 Updated by ttereshc almost 4 years ago

Probably the same change should be done for a distributor if the suggested approach in the PR ^ will be accepted.

#8 Updated by amacdona@redhat.com almost 4 years ago

  • Triaged changed from No to Yes

#9 Updated by dalley almost 4 years ago

Removed bz marked as duplicate

#11 Updated by ttereshc almost 4 years ago

  • Status changed from POST to MODIFIED

#12 Updated by pcreech almost 4 years ago

  • Platform Release set to 2.15.1

#14 Updated by pcreech almost 4 years ago

  • Status changed from MODIFIED to 5

#15 Updated by pcreech almost 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#17 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

#18 Updated by Adam99 over 1 year ago

Ineedtrip, a Ghaziabad based tour and travel company offers the best tour packages for international holiday and honeymoon destinations. The company serves over 15 of the top recommended international tour destinations from India, and it has the best tour packages in the industry. It’s Dubai honeymoon packages are one of the highest selling packages in India, with prices as low as Rs28K per person including flights, visa, hotels, food and more. Some popular destinations offered by ineedtrip include Bali, Maldives, Mauritius, Singapore, Seychelles. The packages to these destinations by ineedtrip are without a doubt the best tour packages both in terms of cost and inclusions.

#19 Updated by techshubham 8 months ago

Positive site, where did u consider the data on this posting? I'm satisfied I imagined that it was, nevertheless, cleared out be returning soon to discover what extra posts you merge. SEO Freelancer in Delhi

Please register to edit this issue

Also available in: Atom PDF