Plone 5.2 Upgrade failed

Plan to upgrade Plone 5.1.5 to Plone 5.2.1

  1. Upgrade from 5.1.5 to 5.1.6, and run /@@plone-upgrade for each sites, everything OK.
  2. Upgrade from 5.1.6 to 5.2.1, start OK, and create new test site also fine.
  3. But dry run /@@plone-upgrade failed.
Dry run selected.
Starting the migration from version: 5116
Role / permission map imported.
Step pas.plugins.ldap.setup has an invalid import handler
Ran upgrade step: Miscellaneous
Role / permission map imported.
Adapters registered.
The object None was not found, while trying to register an utility. The provided object definition was portal_metadata. The site used was: <PloneSite at /mis>
The object None was not found, while trying to register an utility. The provided object definition was portal_syndication. The site used was: <PloneSite at /mis>
The object None was not found, while trying to register an utility. The provided object definition was portal_undo. The site used was: <PloneSite at /mis>
Utilities registered.
Skins tool imported.
Removed record plone.resources/jquery-highlightsearchterms.deps.
Removed record plone.resources/jquery-highlightsearchterms.url.
Removed record plone.resources/jquery-highlightsearchterms.js.
Removed record plone.resources/jquery-highlightsearchterms.init.
Removed record plone.resources/jquery-highlightsearchterms.export.
Removed record plone.resources/jquery-highlightsearchterms.conf.
Removed record plone.resources/jquery-highlightsearchterms.css.
Step pas.plugins.ldap.setup has an invalid import handler
Rebuilding member data information. This step can take a while if your site has many users.
Upgrade aborted. Error:
Traceback (most recent call last):
  File "/opt/plone/buildout-cache/eggs/Products.CMFPlone-5.2.1-py2.7.egg/Products/CMFPlone/MigrationTool.py", line 292, in upgrade
    step['step'].doStep(setup)
  File "/opt/plone/buildout-cache/eggs/Products.GenericSetup-2.0.1-py2.7.egg/Products/GenericSetup/upgrade.py", line 168, in doStep
    self.handler(tool)
  File "/opt/plone/buildout-cache/eggs/plone.app.upgrade-2.0.31-py2.7.egg/plone/app/upgrade/v52/alphas.py", line 94, in to52alpha1
    rebuild_memberdata(context)
  File "/opt/plone/buildout-cache/eggs/plone.app.upgrade-2.0.31-py2.7.egg/plone/app/upgrade/v52/alphas.py", line 49, in rebuild_memberdata
    for member in ms_tool.searchForMembers():
  File "/opt/plone/buildout-cache/eggs/Products.PlonePAS-6.0.5-py2.7.egg/Products/PlonePAS/tools/membership.py", line 248, in searchForMembers
    members = [getUserById(userid) for userid in uf_users]
  File "/opt/plone/buildout-cache/eggs/Products.PluggableAuthService-2.2.1-py2.7.egg/Products/PluggableAuthService/PluggableAuthService.py", line 233, in getUserById
    return self._findUser(plugins, user_info['id'], user_info['login'])
  File "/opt/plone/buildout-cache/eggs/Products.PluggableAuthService-2.2.1-py2.7.egg/Products/PluggableAuthService/PluggableAuthService.py", line 732, in _findUser
    data = propfinder.getPropertiesForUser(user, request)
  File "/opt/plone/buildout-cache/eggs/pas.plugins.ldap-1.7.0-py2.7.egg/pas/plugins/ldap/plugin.py", line 556, in getPropertiesForUser
    return LDAPUserPropertySheet(user_or_group, self)
  File "/opt/plone/buildout-cache/eggs/pas.plugins.ldap-1.7.0-py2.7.egg/pas/plugins/ldap/sheet.py", line 29, in __init__
    if self._ldapprincipal_id in plugin.users:
  File "/opt/plone/buildout-cache/eggs/node-0.9.23-py2.7.egg/node/behaviors/mapping.py", line 56, in __contains__
    self[key]
  File "/opt/plone/buildout-cache/eggs/plumber-1.5-py2.7.egg/plumber/instructions.py", line 390, in entrance
    return plumbing_method(_next, self, *args, **kw)
  File "/opt/plone/buildout-cache/eggs/node-0.9.23-py2.7.egg/node/behaviors/nodespace.py", line 39, in __getitem__
    return _next(self, key)
  File "/opt/plone/buildout-cache/eggs/node-0.9.23-py2.7.egg/node/locking.py", line 32, in _locktree_decorator
    result = fn(self, *args, **kwargs)
  File "/opt/plone/buildout-cache/eggs/node.ext.ldap-1.0b9-py2.7.egg/node/ext/ldap/ugm/_api.py", line 533, in __getitem__
    context = context[rdn]
  File "/opt/plone/buildout-cache/eggs/plumber-1.5-py2.7.egg/plumber/instructions.py", line 390, in entrance
    return plumbing_method(_next, self, *args, **kw)
  File "/opt/plone/buildout-cache/eggs/node-0.9.23-py2.7.egg/node/behaviors/nodespace.py", line 39, in __getitem__
    return _next(self, key)
  File "/opt/plone/buildout-cache/eggs/node.ext.ldap-1.0b9-py2.7.egg/node/ext/ldap/_node.py", line 229, in __getitem__
    attrlist=['']  # no need for attrs
  File "/opt/plone/buildout-cache/eggs/node.ext.ldap-1.0b9-py2.7.egg/node/ext/ldap/session.py", line 59, in search
    cookie
  File "/opt/plone/buildout-cache/eggs/node.ext.ldap-1.0b9-py2.7.egg/node/ext/ldap/base.py", line 240, in search
    key = '-'.join([str(_) for _ in key_items])
UnicodeEncodeError: 'ascii' codec can't encode character u'\u3000' in position 8: ordinal not in range(128)
End of upgrade path, main migration has finished.
The upgrade path did NOT reach current version.
Migration has failed
Dry run selected, transaction aborted

That sounds like Unicode trouble. u3000 is the unicode for the ideographic space (used in the CJK languages), and LDAP can be very temperamental when there are non-ascii characters in some key LDAP attributes like cn.

It should usually handle them OK with sn and others, but if you are indeed using an LDAP with Chinese, Japanese or Korean names in it there will be some troubles ahead. You might want to specifically ask help from other Plone people using those character sets.

The ideographic space can also have landed accidentally via copy/paste in your LDAP, and then it's hard to spot as it's, well, a space...

2 Likes

Thanks a lot!

This should be a bug, how to report it?

You might want to have a look at the notes from node.ext.ldap package = Character Encoding. You can monkey-patch to handle possible encode errors.