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!

Also available in: Atom PDF