Issue #4741

Updated by ttereshc about 5 years ago

The error is seen for repos with f26 content, those repos don't exist any more: 

 ValidationError (Modulemd:938e503c-9913-48e0-8ebd-c68791db80d0) (Field is required: ['context']) 
 Traceback (most recent call last): 
   File "/usr/lib/python2.7/site-packages/pulp/server/db/", line 239, in main 
     return _auto_manage_db(options) 
   File "/usr/lib/python2.7/site-packages/pulp/server/db/", line 306, in _auto_manage_db 
   File "/usr/lib/python2.7/site-packages/pulp/server/db/", line 135, in migrate_database 
     update_current_version=not options.test) 
   File "/usr/lib/python2.7/site-packages/pulp/server/db/migrate/", line 189, in apply_migration 
   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/migrations/", line 343, in migrate 
     add_modulemds(repository, modulemds, working_dir) 
   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/migrations/", line 218, in add_modulemds 
     add_modulemd(repository, modulemd, model, working_dir) 
   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/migrations/", line 164, in add_modulemd 
   File "/usr/lib/python2.7/site-packages/pulp/server/db/model/", line 921, in save_and_import_content 
   File "/usr/lib/python2.7/site-packages/mongoengine/", line 304, in save 
   File "/usr/lib/python2.7/site-packages/mongoengine/base/", line 413, in validate 
     raise ValidationError(message, errors=errors) 
 ValidationError: ValidationError (Modulemd:938e503c-9913-48e0-8ebd-c68791db80d0) (Field is required: ['context']) 


 Modules in those repos have no @context@ which is a part of unit_key for a modulemd content so it cant' be imported into Pulp. 

 Possible solutions: 

  * provide list of content for user to manually remove before migration 
  * skip this broken content and proceed proceeding with migration 

     * skipping it will mean that this content will be removed from a repo and become orphaned. 

  * anything else? I'm hesitant to keep bad mad modules.yaml files as unparsed yum_repo_metadata_file content for consistency reasons. 

 No data how many users might be affected. Hopefully not many since this issue didn't blow up earlier.