Zodbupdate - ModuleNotFoundError: No module named 'webdav.interfaces'

Most of my dbs have managed to get through a test zodbupdate but the below did not. Strangely, running zodbverify in py2 environment did not hint at a problem here.

./bin/zodbupdate --convert-py3 --file=/plndata/plone/filestorage/db12/Data.fs --encoding utf8 --encoding-fallback latin1
Updating magic marker for /plndata/plone/filestorage/db12/Data.fs
Loaded 1 rename rules from OFS:renames
Loaded 2 decode rules from AccessControl:decodes
Loaded 13 decode rules from OFS:decodes
Loaded 3 decode rules from Products.PythonScripts:decodes
Loaded 1 decode rules from Products.ZopeVersionControl:decodes
Warning: Missing factory for App.Product ProductFolder
Class Products.CMFFormController.ControllerPythonScript.ControllerPythonScript has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
Class Products.CMFFormController.ControllerValidator.ControllerValidator has a security declaration for nonexistent method 'ZPythonScriptHTML_changePrefs'
New implicit rule detected copy_reg _reconstructor to copyreg _reconstructor
New implicit rule detected __builtin__ object to builtins object
New implicit rule detected Products.CMFPlone.interfaces.controlpanel ILanguageSchema to plone.i18n.interfaces ILanguageSchema
Warning: Missing factory for Products.ResourceRegistries.interfaces.settings IResourceRegistriesSettings
Committing changes (#1).
Committing changes (#2).
An error occured
Traceback (most recent call last):
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/main.py", line 214, in main
    updater()
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/update.py", line 82, in __call__
    new = self.processor.rename(current)
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/serialize.py", line 333, in rename
    data = unpickler.load()
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/serialize.py", line 199, in __find_global
    return find_global(*self.__update_symb(klass_info), Broken=ZODBBroken)
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/serialize.py", line 177, in __update_symb
    symb = find_global(*symb_info, Broken=ZODBBroken)
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/ZODB-5.5.1-py3.6.egg/ZODB/broken.py", line 199, in find_global
    return getattr(sys.modules[modulename], globalname)
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zope.deferredimport-4.3-py3.6.egg/zope/deferredimport/deferredmodule.py", line 70, in __getattr__
    v = get.get()
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zope.deferredimport-4.3-py3.6.egg/zope/deferredimport/deferredmodule.py", line 54, in get
    return super(DeferredAndDeprecated, self).get()
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zope.deferredimport-4.3-py3.6.egg/zope/deferredimport/deferredmodule.py", line 37, in get
    v = __import__(module, *self._import_chicken)
ModuleNotFoundError: No module named 'webdav.interfaces'
Stopped processing, due to: No module named 'webdav.interfaces'
Traceback (most recent call last):
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/main.py", line 214, in main
    updater()
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/update.py", line 82, in __call__
    new = self.processor.rename(current)
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/serialize.py", line 333, in rename
    data = unpickler.load()
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/serialize.py", line 199, in __find_global
    return find_global(*self.__update_symb(klass_info), Broken=ZODBBroken)
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/serialize.py", line 177, in __update_symb
    symb = find_global(*symb_info, Broken=ZODBBroken)
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/ZODB-5.5.1-py3.6.egg/ZODB/broken.py", line 199, in find_global
    return getattr(sys.modules[modulename], globalname)
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zope.deferredimport-4.3-py3.6.egg/zope/deferredimport/deferredmodule.py", line 70, in __getattr__
    v = get.get()
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zope.deferredimport-4.3-py3.6.egg/zope/deferredimport/deferredmodule.py", line 54, in get
    return super(DeferredAndDeprecated, self).get()
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zope.deferredimport-4.3-py3.6.egg/zope/deferredimport/deferredmodule.py", line 37, in get
    v = __import__(module, *self._import_chicken)
ModuleNotFoundError: No module named 'webdav.interfaces'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./bin/zodbupdate", line 304, in <module>
    sys.exit(zodbupdate.main.main())
  File "/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/eggs/zodbupdate-1.2-py3.6.egg/zodbupdate/main.py", line 218, in main
    raise AssertionError()
AssertionError
(venv_p52_py3) zadmin@plone-btp-dev-02:/sprj/btp_zope_plone5/plone-btp-dev-02/buildouts/plone>

modulename: OFS.interfaces
globalname: IFTPAccess

Zope 4 has a deprecation warning to use webdav.interfaces.IFTPAccess instead - but this makes no sense because there's no webdav module in Zope4 like there was in Zope2. I tried to use alias_module but this didn't have any effect, possibly my mistake alias_module('webdav.interfaces.IFTPAccess', Interface)

zodbverify output in py2, pre conversion:

INFO:zodbverify:Done! Scanned 272437 records.
Found 3377 records that could not be loaded.
Exceptions and how often they happened:
ImportError: No module named ResourceRegistries.interfaces.settings: 10
AttributeError: 'module' object has no attribute 'IPersistentExtra': 3365
ImportError: No module named Product: 2

I got the same warnings in other dbs that did not have a problem converting to py3

Esoth via Plone Community wrote at 2019-10-21 21:29 +0000:

...
./bin/zodbupdate --convert-py3 --file=/plndata/plone/filestorage/db12/Data.fs --encoding utf8 --encoding-fallback latin1
...
An error occured
Traceback (most recent call last):
...
v = import(module, *self._import_chicken)
ModuleNotFoundError: No module named 'webdav.interfaces'

"webdav" was moved to become a part of ZServer. You may
need to install the ZServer package explicitly.

I am not sure whether the ZServer installation installs webdav
as a top level package. If not, you may need to add
from ZServer import webdav; from sys import modules; modules["webdav"] = webdav
to your startup code.

ZServer 4.0.1 is pinned by the 5.2 version config and it does have webdav as a top level project, but it is classified as python 2 only. I tried buildout installing it to test anyway, and there are indeed import errors specific to python 3.

As a workaround (with no ZServer), I modified Zope-4.1.1/OFS/interfaces.py to comment out this last block

deprecated(
    'Please import from webdav.interfaces.',
    IFTPAccess='webdav.interfaces:IFTPAccess',
)

I was able to run zodbupdate after that.

Sounds like a bug, may you file it?

1 Like

Submitted https://github.com/zopefoundation/Zope/issues/714