Bug 1130305

Summary: pulp-manage-db fails during 2.4 upgrade
Product: [Retired] Pulp Reporter: Bryce Pier <bryce.pier>
Component: z_otherAssignee: Barnaby Court <bcourt>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.4.0CC: bcourt, mhrivnak, pthomas, rbarlow
Target Milestone: ---Keywords: Triaged
Target Release: 2.5.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-24 21:33:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/var/log/messages output of pulp-manage-db execution
none
/var/log/messages output from attempt to restart httpd after pulp-manage-db run none

Description Bryce Pier 2014-08-14 19:49:46 UTC
Created attachment 926895 [details]
/var/log/messages output of pulp-manage-db execution

Description of problem:
pulp-manage-db fails with the following error:

bash-4.1$ pulp-manage-db
Loading content types.
/usr/lib/python2.6/site-packages/pulp/server/db/connection.py:140: DeprecationWarning: The safe parameter is deprecated. Please use write concern options instead.
  return method(*args, **kwargs)
Content types loaded.
Ensuring the admin role and user are in place.
Admin role and user are in place.
Beginning database migrations.
Migration package pulp.server.db.migrations is up to date at version 9
Migration package pulp_puppet.plugins.migrations is up to date at version 2
Applying pulp_rpm.plugins.migrations version 3
Applying migration pulp_rpm.plugins.migrations.0003_custom_metadata_on_scratchpad failed.  See log for details.
Database migrations complete.

syslog traceback attached


Version-Release number of selected component (if applicable):
2.4.0

How reproducible:
always

Steps to Reproduce:
1. upgrade pulp packages with yum
2. run pulp-manage-db as user apache
3.

Actual results:
successful migration of pulp-databse

Expected results:


Additional info:
attempting to run pulp-admin login after restarting mongod & httpd results in:

The web server reported an error trying to access the Pulp application. The
likely cause is that the pulp-manage-db script has not been run prior to
starting the server. More information can be found in Apache's error log file on
the server itself.

Comment 1 Bryce Pier 2014-08-14 19:54:50 UTC
Created attachment 926898 [details]
/var/log/messages output from attempt to restart httpd after pulp-manage-db run

Comment 2 Barnaby Court 2014-08-15 14:31:29 UTC
The problem is happening because the package for the pulp_rpm migrations changed from pulp_rpm.migrations to pulp_rpm.plugins.migrations.  Because of this the migration tracker does not catch that the earlier migrations have already run and is trying to rerun all of the old migrations.  

Best short term solution I can think of would be to rename the package back to pulp_rpm.migrations and push a Z release ASAP with just this change.

Comment 3 Barnaby Court 2014-08-19 13:14:36 UTC
This bug is limited to users who have migrated Pulp 2.0 or earlier of to any version prior to 2.4 and are performing a second migration to 2.4 

This is caused because of old data that is no longer needed. The following command can be used to remove the old data that is blocking the migration: 

find /var/lib/pulp/working/repos/ -path '*/yum_importer' -type d -exec rm -rf '{}' \;

Comment 4 Randy Barlow 2014-08-20 16:36:00 UTC
This is a documentation problem.

Comment 5 Barnaby Court 2014-08-21 19:25:29 UTC
PR: https://github.com/pulp/pulp_rpm/pull/552

Comment 6 Chris Duryee 2014-09-30 13:52:47 UTC
build: 2.5.0-0.6.beta

Comment 7 Preethi Thomas 2014-10-23 15:18:49 UTC
verified

Upgraded from 2.3 ->2.5 with different types for content.

pulp-manage-db ran without any errors