Upgrading 6.1.1 to 6.1.2 - Unexpected error whilst trying to apply transform chain

Hi,

I have a site running plone 6.1.1, which I updated to 6.1.2 yesterday via buildout. This completed OK and I can start the site, but instance.log records the following errors:

2025-08-20 12:06:49,442 ERROR   [plone.transformchain:60][waitress-0] Unexpected error whilst trying to apply transform chain
Traceback (most recent call last):
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.transformchain-3.0.1-py3.12.egg/plone/transformchain/transformer.py", line 50, in __call__
    newResult = handler.transformIterable(result, encoding)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.app.theming-5.0.13-py3.12.egg/plone/app/theming/transform.py", line 183, in transformIterable
    transformed = transform(result.tree, **params)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/xslt.pxi", line 596, in lxml.etree.XSLT.__call__
lxml.etree.XSLTApplyError: Undefined variable
2025-08-20 12:06:49,442 ERROR   [plone.transformchain:60][waitress-0] Unexpected error whilst trying to apply transform chain
Traceback (most recent call last):
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.transformchain-3.0.1-py3.12.egg/plone/transformchain/transformer.py", line 50, in __call__
    newResult = handler.transformIterable(result, encoding)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.app.theming-5.0.13-py3.12.egg/plone/app/theming/transform.py", line 183, in transformIterable
    transformed = transform(result.tree, **params)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/xslt.pxi", line 596, in lxml.etree.XSLT.__call__
lxml.etree.XSLTApplyError: Undefined variable
2025-08-20 12:06:49,668 WARNING [waitress.queue:113][MainThread] Task queue depth is 1
2025-08-20 12:08:56,427 ERROR   [plone.transformchain:60][waitress-1] Unexpected error whilst trying to apply transform chain
Traceback (most recent call last):
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.transformchain-3.0.1-py3.12.egg/plone/transformchain/transformer.py", line 50, in __call__
    newResult = handler.transformIterable(result, encoding)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.app.theming-5.0.13-py3.12.egg/plone/app/theming/transform.py", line 183, in transformIterable
    transformed = transform(result.tree, **params)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/xslt.pxi", line 596, in lxml.etree.XSLT.__call__
lxml.etree.XSLTApplyError: Undefined variable
2025-08-20 12:08:56,427 ERROR   [plone.transformchain:60][waitress-1] Unexpected error whilst trying to apply transform chain
Traceback (most recent call last):
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.transformchain-3.0.1-py3.12.egg/plone/transformchain/transformer.py", line 50, in __call__
    newResult = handler.transformIterable(result, encoding)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.app.theming-5.0.13-py3.12.egg/plone/app/theming/transform.py", line 183, in transformIterable
    transformed = transform(result.tree, **params)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/xslt.pxi", line 596, in lxml.etree.XSLT.__call__
lxml.etree.XSLTApplyError: Undefined variable
2025-08-20 12:08:56,559 WARNING [waitress.queue:113][MainThread] Task queue depth is 1
2025-08-20 12:09:01,605 ERROR   [plone.transformchain:60][waitress-0] Unexpected error whilst trying to apply transform chain
Traceback (most recent call last):
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.transformchain-3.0.1-py3.12.egg/plone/transformchain/transformer.py", line 50, in __call__
    newResult = handler.transformIterable(result, encoding)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.app.theming-5.0.13-py3.12.egg/plone/app/theming/transform.py", line 183, in transformIterable
    transformed = transform(result.tree, **params)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/xslt.pxi", line 596, in lxml.etree.XSLT.__call__
lxml.etree.XSLTApplyError: Undefined variable
2025-08-20 12:09:01,605 ERROR   [plone.transformchain:60][waitress-0] Unexpected error whilst trying to apply transform chain
Traceback (most recent call last):
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.transformchain-3.0.1-py3.12.egg/plone/transformchain/transformer.py", line 50, in __call__
    newResult = handler.transformIterable(result, encoding)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/web/terahertzsystems-plone6/terahertzsystems/eggs/plone.app.theming-5.0.13-py3.12.egg/plone/app/theming/transform.py", line 183, in transformIterable
    transformed = transform(result.tree, **params)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/lxml/xslt.pxi", line 596, in lxml.etree.XSLT.__call__
lxml.etree.XSLTApplyError: Undefined variable

This site has numerous problems:

  • The text for all page titles and sub tilles appears in "viewlet-above-content-title" (but not when logged in as admin)
  • When editing any content the text of the page just appears in the editor as "Text", and the editor
  • Resource Registries is reporting that " Javascript disabled or error(s) occurred If this message persists, a Javascript Error occurred within the resources below."

My buildout file is very simple:

[buildout]
extends = https://dist.plone.org/release/6.1.2/versions.cfg
parts = instance

[instance]
recipe = plone.recipe.zope2instance
eggs =
	Plone
	plone.volto
user=admin:XXXXXXXXXX
http-address = 9090

[versions]
packaging=25.0
pip=25.1.1
setuptools=80.9.0
wheel=0.46.1
zc.buildout=4.1.12

I guess these issue are related to the transform chain error above. Any ideas how I can fix this?

Thanks,

Lee.

An update....

I rolled this site back to the backup I took of 6.1.1 before updating to 6.1.2 and I noticed that the errors were still there...

A bit of digging has shown that this is not a plone issue. the Apache config that sits in fron of plone was updated to "improve security" and this was the cause.

The config that caused this issue was:

Header set Content-Security-Policy "default-src 'self'

I've changed this to:

Header set Content-Security-Policy "default-src 'self' 'unsafe-inline'

All works as expected on 6.1.2 now.

How would the lxml error have anything with CSP?! I get the same error in Plone 6.1.3. The CSS for Plone Classic is broken and I can’t run the upgrades from 6.0.15 to 6.1.3:

Starting the migration from version: 6026
Ran upgrade step: Miscellaneous
Ran upgrade step: Miscellaneous
Ran upgrade step: Miscellaneous
Upgrade aborted. Error:
Traceback (most recent call last):
File "/app/lib/python3.12/site-packages/Products/CMFPlone/MigrationTool.py", line 291, in upgrade
step\["step"\].doStep(setup)
File "/app/lib/python3.12/site-packages/Products/GenericSetup/upgrade.py", line 191, in doStep
self.handler(tool)
File "/app/lib/python3.12/site-packages/plone/app/upgrade/v61/alpha.py", line 33, in add_feature_tinymce_accordion_plugin
plugins_record.value = old_value_plugins
^^^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.12/site-packages/plone/registry/record.py", line 79, in \_set_value
field.validate(value)
File "/app/lib/python3.12/site-packages/zope/schema/\_bootstrapfields.py", line 295, in validate
self.\_validate(value)
File "/app/lib/python3.12/site-packages/zope/schema/\_field.py", line 772, in \_validate
raise WrongContainedType(
zope.schema.\_bootstrapinterfaces.WrongContainedType: (\[ConstraintNotSatisfied('hr', ''), ConstraintNotSatisfied('noneditable', ''), ConstraintNotSatisfied('paste', ''), ConstraintNotSatisfied('print', ''), ConstraintNotSatisfied('tabfocus', '')\], 'value')
End of upgrade path, main migration has finished.
The upgrade path did NOT reach current version.
Migration has failed

Fixed in plone.app.upgrade==3.3.1 … note, that you have to pin this version yourself, because versions in dist.plone.org are on 3.3.0