Hi all!
Yesterday I ran into an issue using the plone-backend docker image.
Suddenly I could no longer create containers due to an error that had not occurred before.
It is possible to recreate the error by doing:
docker run --rm -p 8080:8080 -e ADDONS="collective.easyform[recaptcha]" plone/plone-backend:6.0.14 start
I tested this with several plone 6 images, always the same error.
2025-02-26 11:08:52 ERROR [plone.autoinclude.loader:60][MainThread] Could not import plone_formwidget_recaptcha. Set environment variable AUTOINCLUDE_ALLOW_MODULE_NOT_FOUND_ERROR=1 if you want to allow this. Or set it to 'plone_formwidget_recaptcha' to only allow for this project. Can be a comma-separated list of project names. Or replace the z3c.autoinclude.plugin entry point of this project with plone.autoinclude.plugin and a module name.
Traceback (most recent call last):
File "/app/lib/python3.11/site-packages/zope/configuration/xmlconfig.py", line 393, in endElementNS
self.context.end()
File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 703, in end
self.stack.pop().finish()
File "/app/lib/python3.11/site-packages/zope/configuration/config.py", line 873, in finish
actions = self.handler(context, **args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/plone/autoinclude/zcml.py", line 37, in includePluginsDirective
dists = loader.load_packages(target)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/plone/autoinclude/loader.py", line 139, in load_packages
z3c_dists = load_z3c_packages(target=target)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/plone/autoinclude/loader.py", line 50, in load_z3c_packages
dist = importlib.import_module(module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'plone_formwidget_recaptcha'
plone.formwidget.recaptcha was not imported since it's using z3c.autoinclude.plugin instead of plone.autoinclude.plugin.
There is a section in the docs about switching to plone.autoinclude:
I had some addons that still used z3c.autoinclude and I modified them to use plone.autoinclude, but that alone did not solve the problem because collective.easyform depends on plone.formwidget.recaptcha.
I also tried to create a custom Dockerfile adding the same dependency and the same error occurred.
The strange thing is that this did not happen until yesterday, does anyone know what happened?