Bug 1130305 - pulp-manage-db fails during 2.4 upgrade
Summary: pulp-manage-db fails during 2.4 upgrade
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: 2.4.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
: 2.5.0
Assignee: Barnaby Court
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-14 19:49 UTC by Bryce Pier
Modified: 2014-11-24 21:33 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-24 21:33:36 UTC


Attachments (Terms of Use)
/var/log/messages output of pulp-manage-db execution (3.45 KB, text/plain)
2014-08-14 19:49 UTC, Bryce Pier
no flags Details
/var/log/messages output from attempt to restart httpd after pulp-manage-db run (10.88 KB, text/plain)
2014-08-14 19:54 UTC, Bryce Pier
no flags Details

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


Note You need to log in before you can comment on or make changes to this bug.