Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evr="" is sent to the database on creating a Package #3122

Closed
mdellweg opened this issue Aug 23, 2022 · 1 comment · Fixed by #3126
Closed

evr="" is sent to the database on creating a Package #3122

mdellweg opened this issue Aug 23, 2022 · 1 comment · Fixed by #3126
Labels

Comments

@mdellweg
Copy link
Member

Version
current main branches of everything.

Describe the bug
It looks like the evr field is translated into the insert query even if it was not set from the validated_data. Also it seems if should be populated by a database trigger and never be saved directly.

[('INSERT INTO "rpm_package" ("content_ptr_id", "name", "epoch", "version", "release", "arch", "evr", "pkgId", "checksum_type", "summary", "description", "url", "changelogs", "files", "requires", "provides", "conflicts", "obsoletes", "suggests", "enhances", "recommends", "supplements", "location_base", "location_href", "rpm_buildhost", "rpm_group", "rpm_license", "rpm_packager", "rpm_sourcerpm", "rpm_vendor", "rpm_header_start", "rpm_header_end", "size_archive", "size_installed", "size_package", "time_build", "time_file", "is_modular") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', (UUID('ff1f1dd3-d4bf-4104-a2ea-7baed11dc6e8'), 'lemon', '0', '0', '1', 'noarch', '', '847df5d46b4d8ab2a7af5bfc0ccfb4681786a2b40b0f3a2b9a56bbed8dfeeee6', 'sha256', 'A lemon', '', 'http://lem.on/Fruits/', '[]', '[]', '[]', '[["citrussy", null, null, null, null, false], ["fruity", null, null, null, null, false], ["lemon", null, null, null, null, false], ["lemon", "EQ", "0", "0", "1", false]]', '[]', '[]', '[]', '[]', '[]', '[]', '', 'lemon-0-1.noarch.rpm', '68aa50d573f8', 'Fruits', 'No Age Limitation', 'Mr. Bartender', 'lemon-0-1.src.rpm', 'Lem:ON!', 4504, 5924, 124, 0, 6040, 1657826273, 1661253000, False))]

To Reproduce
run the pulp-cli test for rpm content

pytest -m pulp_rpm -k content

Expected behavior
test should pass

Additional context
Add any other context about the problem here. Please provide links to any previous discussions via Discourse or Bugzilla.

@mdellweg mdellweg transferred this issue from pulp/pulp_rpm Aug 23, 2022
@mdellweg mdellweg added this to the 3.21.0 blockers milestone Aug 23, 2022
@mdellweg
Copy link
Member Author

This turned out to be a pulpcore issue.

In pulpcore we start doing orm calls before all apps are ready. This results in django-readonly-fields doing its ninja-move to swap out the SQL Compiler before django computes it and caches it in https://github.com/django/django/blob/main/django/db/backends/base/operations.py#L361 .

Lesson learned: Do not touch the orm before everything is ready.

Plan to resolve: Move the installation of the telemetry schedule into a new worker-startup hook.

mdellweg added a commit to mdellweg/pulpcore that referenced this issue Aug 24, 2022
mdellweg added a commit to mdellweg/pulpcore that referenced this issue Aug 24, 2022
mdellweg added a commit that referenced this issue Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants