Bug 2055336
Summary: | null value in column "issued_date" violates not-null constraint while syncing EPEL7 repository | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Yogendra <yyadav> |
Component: | Pulp | Assignee: | satellite6-bugs <satellite6-bugs> |
Status: | CLOSED NOTABUG | QA Contact: | Vladimír Sedmík <vsedmik> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.9.9 | CC: | ahumbe, dalley, ggainey, hyu, jsherril, mkushwah |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-10-31 14:57:49 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Yogendra
2022-02-16 17:59:55 UTC
Hello Grant,
First i verified on Customer affected 6.10 Satellite Server if there is any number of empty-string-issue-date-advisories with below command.
---
# DJANGO_SETTINGS_MODULE=pulpcore.app.settings PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager shell
Python 3.6.8 (default, Aug 13 2020, 07:46:32)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from pulp_rpm.app.models.advisory import UpdateRecord
>>> UpdateRecord.objects.filter(issued_date="").count()
0
---
As the count was zero so requested him to update the issued date on Red Hat Satellite 6.9 from where content is fetched with below command and then try the sync of affected repository on Satellite 6.10.
---
# mongo pulp_database --eval 'db.units_erratum.find({$or: [{issued: null}, {issued: ""}]}, {_id: 1, errata_id: 1, issued: 1, updated: 1}).forEach(function(erratum) { print("Updating issued date for " + erratum.errata_id + " to " + erratum.updated); db.units_erratum.update({_id: erratum._id}, {"$set": {issued: erratum.updated}}) })'
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/pulp_database
MongoDB server version: 3.4.9
Updating issued date for FEDORA-EPEL-2018-d57e8992f6 to 2021-05-12 05:02:13
Updating issued date for FEDORA-EPEL-2018-701ce7a3d5 to 2021-05-12 05:06:32
---
But still repository sync is failing with same error on Red Hat Satellite 6.10
-------------------------------------------
null value in column "issued_date" violates not-null constraint
DETAIL: Failing row contains (72ef1381-e881-45d1-96ff-54b8f498629a, FEDORA-EPEL-2018-d57e8992f6, 2021-05-12 05:02:13, Initial package release, null, updates, stable, ykushcmd-1.1.0-1.el7, ykushcmd-1.1.0-1.el7 enhancement update, 2.0, enhancement, None, , Fedora EPEL 7, Copyright (C) 2021 Red Hat, Inc. and others., , 8eef5f8957f9e9837b8eceff5f9ce0c885dcca2e2606cb351a6ece6362b7f122, f).
-------------------------------------------
Closing as NOTABUG because Pulp 3 is correct to reject the metadata - however, this is triggered by a Pulp 2 bug which can be resolved using the command in comment #14 Note that while comment #14 states that it didn't work, it did work later, presumably after the repository got republished. Making sure the repo is republished (forcibly if need be) after the data is fixed in the database is a necessary step to being able to sync the repo afterwards. The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days |