Project

Profile

Help

Issue #7282

closed

Advisory merge issue

Added by ArneCovens over 4 years ago. Updated over 3 years ago.

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

Description

When I try to update a update record the previous records gets removed but no new record is added. When debugging this issue I saw that the UUID for the return of def resolve_advisory_conflict in pulp_rpm/app/advisory.py is the same for the to_add and to_remove. I'm using pulp-rpm version 3.4 on Centos 8.

Is there any solution to fix this?

First Record

{
 "issued":  "2020-03-08 20:04:01",
 "id":  "CEBA-2019--2657",
 "type":  "Bug Fix Advisory",
 "release":  "1",
 "version": "1",
 "pkglist": [
   {
    "packages": [
     {
      "arch": "noarch",
      "epoch": "0",
      "filename": "bear-4.5-1.noarch.rpm",
      "name": "bear",
      "reboot_suggested": false,
      "relogin_suggested": false,
      "restart_suggested": false,
      "release": "1",
      "src": "http://www.fedoraproject.org",
      "sum": "",
      "sum_type": "",
      "version": "4.5"
     }
    ]
   }
  ],
 "severity":  "",
 "description":  "Not available",
 "reboot_suggested":  false,
 "updated":  "2020-03-08 20:04:01",
 "solution":  "Not available",
 "fromstr":  "centos-announce@centos.org"
}

Record to update

{
 "issued":  "2020-03-08 20:04:01",
 "id":  "CEBA-2019--2657",
 "type":  "Bug Fix Advisory",
 "release":  "1",
 "version": "1",
 "pkglist": [
   {
    "packages": [
     {
      "arch": "noarch",
      "epoch": "0",
      "filename": "bird-4.5-1.noarch.rpm",
      "name": "bird",
      "reboot_suggested": false,
      "relogin_suggested": false,
      "restart_suggested": false,
      "release": "1",
      "src": "http://www.fedoraproject.org",
      "sum": "",
      "sum_type": "",
      "version": "4.5"
     }
    ]
   }
  ],
 "severity":  "",
 "description":  "Not available",
 "reboot_suggested":  false,
 "updated":  "2020-03-08 20:04:01",
 "solution":  "Not available",
 "fromstr":  "centos-announce@centos.org"
}
Actions #1

Updated by ttereshc over 4 years ago

  • Project changed from Pulp to RPM Support

Please, describe your workflow. How are you updating the advisory?

Actions #2

Updated by ArneCovens over 4 years ago

I'm using the provided API call to create an update record. This is the command I use: http -a admin:pass --form POST http://pulphost:24817/pulp/api/v3/content/rpm/advisories/ file@./advisory.json repository=http://pulphost:24817/pulp/api/v3/repositories/rpm/rpm/a223d57e-7e55-4e4b-a051-d63b9b1e849b/

Actions #3

Updated by ttereshc over 4 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by ArneCovens over 4 years ago

It seems with the newest version that the field update_record_id stays NULL.

Record:


  "id": "CEBA-2019--2657",
  "updated_date": "2020-03-08 20:04:01",
  "description": "Not available",
  "issued_date": "2020-03-08 20:04:01",
  "fromstr": "centos-announce@centos.org",
  "status": "",
  "title": "",
  "summary": "",
  "version": "1",
  "type": "Bug Fix Advisory",
  "severity": "",
  "solution": "Not available",
  "release": "1",
  "rights": "",
  "pushcount": "",
  "pkglist": [
    {
      "name": "Test1",
      "shortname": "tes1",
      "module": {},
      "packages": [
        {
    "arch": "noarch",
    "epoch": "0",
    "filename": "bear-4.5-1.noarch.rpm",
    "name": "bear",
    "reboot_suggested": false,
    "relogin_suggested": false,
    "restart_suggested": false,
    "release": "1",
    "src": "http://www.fedoraproject.org",
    "sum": "",
    "sum_type": "",
    "version": "4.5"
  }
      ]
    }
  ],
  "references": [
    {}
  ],
  "reboot_suggested": true,
  "update_record_id": 1
}

Task:

HTTP 200 OK Allow: GET, PATCH, DELETE, HEAD, OPTIONS Content-Type: application/json Vary: Accept

{
    "pulp_href": "/pulp/api/v3/tasks/57f59bf6-2868-4c7c-9971-8c249cd07d0f/",
    "pulp_created": "2020-08-17T18:39:16.393068Z",
    "state": "failed",
    "name": "pulpcore.app.tasks.base.general_create_from_temp_file",
    "started_at": "2020-08-17T18:39:16.961519Z",
    "finished_at": "2020-08-17T18:39:17.682203Z",
    "error": {
        "traceback": "  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/rq/worker.py\", line 883, in perform_job\n    rv = job.perform()\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/rq/job.py\", line 657, in perform\n    self._result = self._execute()\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/rq/job.py\", line 663, in _execute\n    return self.func(*self.args, **self.kwargs)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/pulpcore/app/tasks/base.py\", line 24, in general_create_from_temp_file\n    general_create(app_label, serializer_name, data=data, *args, **kwargs)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/pulpcore/app/tasks/base.py\", line 41, in general_create\n    serializer.save()\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/rest_framework/serializers.py\", line 213, in save\n    self.instance = self.create(validated_data)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/pulp_rpm/app/serializers/advisory.py\", line 154, in create\n    coll.save()\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django_lifecycle/mixins.py\", line 128, in save\n    save(*args, **kwargs)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/models/base.py\", line 741, in save\n    force_update=force_update, update_fields=update_fields)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/models/base.py\", line 779, in save_base\n    force_update, using, update_fields,\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/models/base.py\", line 870, in _save_table\n    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/models/base.py\", line 908, in _do_insert\n    using=using, raw=raw)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/models/manager.py\", line 82, in manager_method\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/models/query.py\", line 1186, in _insert\n    return query.get_compiler(using=using).execute_sql(return_id)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/models/sql/compiler.py\", line 1375, in execute_sql\n    cursor.execute(sql, params)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/backends/utils.py\", line 67, in execute\n    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/backends/utils.py\", line 76, in _execute_with_wrappers\n    return executor(sql, params, many, context)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n    return self.cursor.execute(sql, params)\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/utils.py\", line 89, in __exit__\n    raise dj_exc_value.with_traceback(traceback) from exc_value\n  File \"/home/pulp/pulpvenv/lib64/python3.6/site-packages/django/db/backends/utils.py\", line 84, in _execute\n    return self.cursor.execute(sql, params)\n",
        "description": "null value in column \"update_record_id\" violates not-null constraint\nDETAIL:  Failing row contains (c3f53ee7-ab3a-46f3-b1ae-2f3f8dc5be10, 2020-08-17 18:39:17.462253+00, 2020-08-17 18:39:17.462281+00, Test1, , {}, null).\n"
    },
    "worker": "/pulp/api/v3/workers/83a0300e-adee-4bdd-a306-7cb7e3653b41/",
    "parent_task": null,
    "child_tasks": [],
    "task_group": null,
    "progress_reports": [],
    "created_resources": [
        "/pulp/api/v3/repositories/rpm/rpm/44916f2c-142c-4811-87e3-5b6ef70012e4/versions/2/"
    ],
    "reserved_resources_record": [
        "/pulp/api/v3/repositories/rpm/rpm/44916f2c-142c-4811-87e3-5b6ef70012e4/",
        "/pulp/api/v3/artifacts/5f600f7e-7e0c-4b1e-bad1-a5536db87b50/"
    ]
}
Actions #5

Updated by ggainey almost 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ggainey
Actions #6

Updated by ggainey almost 4 years ago

  • Sprint set to Sprint 92
Actions #7

Updated by rchan almost 4 years ago

  • Sprint changed from Sprint 92 to Sprint 93
Actions #8

Updated by rchan over 3 years ago

  • Sprint changed from Sprint 93 to Sprint 94
Actions #9

Updated by rchan over 3 years ago

  • Sprint changed from Sprint 94 to Sprint 95
Actions #10

Updated by pulpbot over 3 years ago

  • Status changed from ASSIGNED to POST

Added by ggainey over 3 years ago

Revision 99e3294c | View on GitHub

Taught advisory-upload to handle advisory-conflicts better.

fixes #7282

Actions #11

Updated by ggainey over 3 years ago

  • Status changed from POST to MODIFIED
Actions #12

Updated by ttereshc over 3 years ago

  • Sprint/Milestone set to 3.12.0
Actions #13

Updated by pulpbot over 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF