Bug 751380 - pulp-migrate fails if consumergroup have no description
Summary: pulp-migrate fails if consumergroup have no description
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 30
Assignee: Jason Connor
QA Contact: dgao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-04 14:44 UTC by dgao
Modified: 2014-03-31 01:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description dgao 2011-11-04 14:44:25 UTC
Currently, the db marks the description field as required but the CLI does not enforce this rule. As a result, if a user create a consumergroup w/o description, and then try to run pulp-migrate, the following error occurs:

migration to data model version 23 started
migration to data model version 23 complete
migration to data model version 24 started
validation on previous data model version started
validation complete; data model at version 25
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
migration to data model version 26 started
migration to data model version 26 complete
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in Repo for model foo: field sync_options is not present
model validation failure in Repo for model cds_test_repo: field sync_options is not present
model validation failure in Repo for model package_group_test_repo: field sync_options is not present
model validation failure in Repo for model errata_pkg_upload_repo: field sync_options is not present
model validation failure in Repo for model feedless_repo: field sync_options is not present
model validation failure in Repo for model feed_repo: field sync_options is not present
model validation failure in Repo for model content_test_repo: field sync_options is not present
model validation failure in Repo for model foo.bar: field sync_options is not present
model validation failure in Repo for model smoketest_repo: field sync_options is not present
model validation failure in Repo for model mod_test_repo: field sync_options is not present
model validation failure in Repo for model faux_test_repo: field sync_options is not present
model validation failure in Repo for model relative_test_repo: field sync_options is not present
model validation failure in Repo for model upload_test_repo: field sync_options is not present
model validation failure in Repo for model package_test_repo: field sync_options is not present
model validation failure in Repo for model errata_test_repo: field sync_options is not present
migration to data model version 27 started
migration to data model version 27 complete
migration to data model version 28 started
migration to data model version 28 complete
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>
model validation failure in ConsumerGroup for model bar: field description is <type 'NoneType'> not <type 'unicode'>

Comment 1 dgao 2011-11-04 14:45:11 UTC
If pulp-server init fails, repo deletion seems to be effected as well. 

[root@pulp-qe ~]# pulp-admin -u admin -p admin repo delete --id=errata_test_repo
error:  error: operation failed: AttributeError: 'NoneType' object has no attribute 'find'


2011-11-04 09:29:57,943 6509:140074129491712: pulp.server.webservices.controllers.decorators:ERROR: decorators:52 Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 48, in report_error
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 127, in _auth_decorator
    value = method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/repositories.py", line 308, in GET
    task = scheduled_sync.find_scheduled_task(repo['id'], '_sync')
  File "/usr/lib/python2.7/site-packages/pulp/server/api/scheduled_sync.py", line 148, in find_scheduled_task
    for task in async.find_async(method_name=method_name):
  File "/usr/lib/python2.7/site-packages/pulp/server/async.py", line 105, in find_async
    return _queue.find(**kwargs)
AttributeError: 'NoneType' object has no attribute 'find'

Comment 2 Jason Connor 2011-11-11 17:15:05 UTC
The first bug is fixed, but the traceback from comment 1 is unrelated.

Comment 3 Jeff Ortel 2011-11-11 18:48:02 UTC
build: 0.248

Comment 4 dgao 2011-11-11 20:42:26 UTC
[root@pulp-qe pulp]# pulp-admin -u admin -p admin consumergroup create --id=foo
Successfully created Consumer group [ foo ] with description [ None ]

[root@pulp-qe pulp]# /etc/init.d/pulp-server init
data model in use matches the current version
database migration to version 29 complete
[root@pulp-qe pulp]# tail /var/log/pulp/db.log 
validation on previous data model version started
validation complete; data model at version 25
migration to data model version 26 started
migration to data model version 26 complete
migration to data model version 27 started
migration to data model version 27 complete
migration to data model version 28 started
migration to data model version 28 complete
migration to data model version 29 started
migration to data model version 29 complete
[root@pulp-qe pulp]# pulp-admin -u admin -p admin repo list
No repositories available to list

Comment 5 Preethi Thomas 2012-02-24 20:18:35 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 6 Preethi Thomas 2012-02-24 20:19:19 UTC
Pulp v1.0 is released.


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