AttributeError: 'module' object has no attribute 'MultiString'

Asked by Hua Zhang

Hello,
     it said "AttributeError: 'module' object has no attribute 'MultiString'" when I run devstack below, all codes are the latest today, does anyone know why ? thanks in advanced.

$ /bak/openstack/keystone/bin/keystone-manage db_sync
Traceback (most recent call last):
  File "/bak/openstack/keystone/bin/keystone-manage", line 30, in <module>
    from keystone import cli
  File "/bak/openstack/keystone/keystone/cli.py", line 22, in <module>
    from keystone import assignment
  File "/bak/openstack/keystone/keystone/assignment/__init__.py", line 15, in <module>
    from keystone.assignment import controllers # noqa
  File "/bak/openstack/keystone/keystone/assignment/controllers.py", line 24, in <module>
    from keystone.assignment import schema
  File "/bak/openstack/keystone/keystone/assignment/schema.py", line 13, in <module>
    from keystone.common import validation
  File "/bak/openstack/keystone/keystone/common/validation/__init__.py", line 16, in <module>
    from keystone.common.validation import validators
  File "/bak/openstack/keystone/keystone/common/validation/validators.py", line 16, in <module>
    from keystone import exception
  File "/bak/openstack/keystone/keystone/exception.py", line 18, in <module>
    from keystone.common import config
  File "/bak/openstack/keystone/keystone/common/config.py", line 16, in <module>
    from oslo import messaging
  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/__init__.py", line 18, in <module>
    from .exceptions import *
  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/exceptions.py", line 13, in <module>
    from oslo_messaging.exceptions import * # noqa
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/__init__.py", line 18, in <module>
    from .notify import *
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/notify/__init__.py", line 23, in <module>
    from .notifier import *
  File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/notify/notifier.py", line 32, in <module>
    help='Driver or drivers to handle sending notifications.'),
  File "/usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py", line 1039, in __init__
    item_type=types.MultiString(),
AttributeError: 'module' object has no attribute 'MultiString'

Question information

Language:
English Edit question
Status:
Solved
For:
oslo.config Edit question
Assignee:
No assignee Edit question
Solved by:
Hua Zhang
Solved:
Last query:
Last reply:
Revision history for this message
ChangBo Guo(gcb) (glongwave) said :
#1

what's the linux dist are you running devstack on ?
It seems like module 'types' in not linked to oslo.config , not sure if 'types' are overwritten by built-in module "types".

Revision history for this message
ChangBo Guo(gcb) (glongwave) said :
#2

Maybe you need use pdb to debug,

Add one line in usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py
import pdb;pdb.set_trace()

use >> type(types)
to show what's the types is .

Revision history for this message
Hua Zhang (zhhuabj) said :
#3

I have fixed this problem, it's caused by myunclean env, execute the following commands, then re-run the devstack and it becames normal. thanks.
sudo rm -rf /usr/local/lib/python2.7/dist-packages/oslo*
sudo rm -rf /usr/local/lib/python2.7/dist-packages/*keystone*
sudo rm -rf /usr/local/lib/python2.7/dist-packages/*glance*
sudo rm -rf/usr/local/lib/python2.7/dist-packages/*swift*
sudo rm -rf /usr/local/lib/python2.7/dist-packages/*cinder*
sudo rm -rf /usr/local/lib/python2.7/dist-packages/*nova*
sudo rm -rf /usr/local/lib/python2.7/dist-packages/*neutron*