Skip to content

Conversation

@jamesw-meta
Copy link

Context

While deploying Pulp in our environment, we encountered sync failures for upstream repositories containing packages with missing or incomplete EVR metadata. This patch resolves the issue and allows those repositories to sync successfully.

Solution

Modified the evr field in the Package model to accept null values by adding null=True, blank=True, and default=None to RpmVersionField. The existing database trigger continues to automatically populate the EVR field when complete metadata is available.

Changes

  • Modified pulp_rpm/app/models/package.py line 143
  • Added CHANGES/.bugfix changelog entry
  • Added pulp_rpm/tests/unit/test_package_null_evr.py unit tests

Test Plan

  • Unit tests added for null EVR handling
  • Verified all existing tests pass
  • Tested in production with previously failing repositories

The evr (Epoch-Version-Release) field in the Package model currently
does not allow null values, which causes database errors when syncing
certain RPM packages that may have missing or incomplete EVR data.

This change adds null=True, blank=True, and default=None to the
RpmVersionField to handle cases where packages don't have proper
EVR metadata, preventing sync failures.

Fixes database constraint violations during package synchronization.
@dralley
Copy link
Contributor

dralley commented Dec 5, 2025

I would say this is probably not the correct fix. evr is our own field type filled in by the values of epoch, version and release, it's not really a separate thing coming directly from the metadata. So the real question is how to avoid it having null values in the first place. We never want evr to be null, there's always some reasonable concrete value for it to have even if epoch, version and release were somehow incomplete.

@jamesw-meta Could you open up an issue with more specifics about the problem you're having and we can discuss the best solution?

@dralley dralley marked this pull request as draft December 5, 2025 21:15
@dralley
Copy link
Contributor

dralley commented Dec 11, 2025

@jamesw-meta And is this the issue you're seeing? #4227

@dralley
Copy link
Contributor

dralley commented Dec 17, 2025

@jamesw-meta ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants