Project

Profile

Help

Issue #1929

closed

The 0023_importer_tls_storage.py migration assumes that Importers always have configs when they do not

Added by rbarlow almost 8 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Urgent
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
4. Urgent
Version:
2.8.3
Platform Release:
2.8.4
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

Description

Alan Sparks reported on pulp-list that he was unable to apply the upgrade to Pulp 2.8.3 due to an Importer in his database missing a config and the migration assuming the Importers always have configs:

Applying pulp.server.db.migrations version 23                                                                                                                                                                                                 
Applying migration pulp.server.db.migrations.0023_importer_tls_storage failed.                                                                                                                                                                

Halting migrations due to a migration failure.                                                                                                                                                                                                
'config'                                                                                                                                                                                                                                      
Traceback (most recent call last):                                                                                                                                                                                                            
  File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 193, in main                                                                                                                                                         
    return _auto_manage_db(options)                                                                                                                                                                                                           
  File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 256, in _auto_manage_db                                                                                                                                              
    migrate_database(options)                                                                                                                                                                                                                 
  File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 124, in migrate_database                                                                                                                                             
    update_current_version=not options.test)                                                                                                                                                                                                  
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrate/models.py", line 186, in apply_migration                                                                                                                                      
    migration.migrate()                                                                                                                                                                                                                       
  File "/usr/lib/python2.6/site-packages/pulp/server/db/migrations/0023_importer_tls_storage.py", line 25, in migrate                                                                                                                         
    _write_pem_file(pki_path, importer['config'], key, filename)                                                                                                                                                                              
KeyError: 'config'

We just need to patch the migration to handle the config missing from the Importer. I'm marking this urgent because it's blocking a user from applying a security update.

Thanks to Alan Sparks for the issue report!

Actions #1

Updated by semyers almost 8 years ago

+1 Urgent/Urgent

Actions #2

Updated by rbarlow almost 8 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to rbarlow
Actions #3

Updated by rbarlow almost 8 years ago

  • Version set to 2.8.3

Added by rbarlow almost 8 years ago

Revision 8487cd5a | View on GitHub

Change migration 23 to not assume that Importers have configs.

https://pulp.plan.io/issues/1929

fixes #1929

Added by rbarlow almost 8 years ago

Revision 8487cd5a | View on GitHub

Change migration 23 to not assume that Importers have configs.

https://pulp.plan.io/issues/1929

fixes #1929

Actions #4

Updated by rbarlow almost 8 years ago

  • Status changed from ASSIGNED to POST
  • Platform Release set to 2.8.4
Actions #5

Updated by jortel@redhat.com almost 8 years ago

  • Triaged changed from No to Yes
Actions #6

Updated by rbarlow almost 8 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #7

Updated by kfiresmith almost 8 years ago

+1 on this issue. Is it universal?

Actions #8

Updated by kfiresmith almost 8 years ago

The fix in Github got me farther onto the migration step 28:

https://paste.fedoraproject.org/370735/64188741/

Actions #9

Updated by bmbouter almost 8 years ago

I think a user would only experience the issue if an Importer definition lacks a 'config' field. That could be any user I imagine.

Actions #10

Updated by semyers almost 8 years ago

  • Status changed from MODIFIED to 5

Added by rbarlow almost 8 years ago

Revision 48bcea7a | View on GitHub

Change migration 23 to not assume that Importers have configs.

https://pulp.plan.io/issues/1929

fixes #1929

Added by rbarlow almost 8 years ago

Revision 48bcea7a | View on GitHub

Change migration 23 to not assume that Importers have configs.

https://pulp.plan.io/issues/1929

fixes #1929

Actions #11

Updated by rbarlow almost 8 years ago

  • Status changed from 5 to MODIFIED
Actions #12

Updated by semyers almost 8 years ago

  • Status changed from MODIFIED to 5
Actions #13

Updated by pthomas@redhat.com almost 8 years ago

  • Status changed from 5 to 6

verified
Created a repo through the api
Added an importer without any config
Upgraded pulp to 2.8.4 beta
Ran migration

Migration package pulp.server.db.migrations is up to date at version 23
Migration package pulp_docker.plugins.migrations is up to date at version 2
Migration package pulp_puppet.plugins.migrations is up to date at version 4
Applying pulp_rpm.plugins.migrations version 29
/usr/lib/python2.7/site-packages/pulp_rpm/plugins/migrations/0029_remove_rpm_unused_fields.py:23: DeprecationWarning: update is deprecated. Use replace_one, update_one or update_many instead.
  multi=True

/usr/lib/python2.7/site-packages/pulp_rpm/plugins/migrations/0029_remove_rpm_unused_fields.py:28: DeprecationWarning: update is deprecated. Use replace_one, update_one or update_many instead.
  multi=True

/usr/lib/python2.7/site-packages/mongoengine/document.py:367: DeprecationWarning: update is deprecated. Use replace_one, update_one or update_many instead.
  upsert=upsert, **write_concern)

Migration to pulp_rpm.plugins.migrations version 29 complete.
Applying pulp_rpm.plugins.migrations version 30
/usr/lib/python2.7/site-packages/pulp_rpm/plugins/migrations/0030_remove_errata_unused_fields.py:23: DeprecationWarning: update is deprecated. Use replace_one, update_one or update_many instead.
  multi=True

Migration to pulp_rpm.plugins.migrations version 30 complete.
Loading unit model: docker_blob = pulp_docker.plugins.models:Blob
Loading unit model: docker_manifest = pulp_docker.plugins.models:Manifest
Loading unit model: docker_image = pulp_docker.plugins.models:Image
Loading unit model: docker_tag = pulp_docker.plugins.models:Tag
Loading unit model: puppet_module = pulp_puppet.plugins.db.models:Module
Loading unit model: erratum = pulp_rpm.plugins.db.models:Errata
Loading unit model: distribution = pulp_rpm.plugins.db.models:Distribution
Loading unit model: package_group = pulp_rpm.plugins.db.models:PackageGroup
Loading unit model: package_category = pulp_rpm.plugins.db.models:PackageCategory
Loading unit model: iso = pulp_rpm.plugins.db.models:ISO
Loading unit model: package_environment = pulp_rpm.plugins.db.models:PackageEnvironment
Loading unit model: drpm = pulp_rpm.plugins.db.models:DRPM
Loading unit model: srpm = pulp_rpm.plugins.db.models:SRPM
Loading unit model: rpm = pulp_rpm.plugins.db.models:RPM
Loading unit model: yum_repo_metadata_file = pulp_rpm.plugins.db.models:YumMetadataFile
Database migrations complete.
Actions #14

Updated by semyers almost 8 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #16

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF