2.8.6 upgrade failed

Summary

Upgraded our development site to 2.8.6 this morning. Manager works but part of the site is not viewable

Step to reproduce

Observed behavior

The development site consists of two containers - Visitor Facility( Teignmouth NCI Test - Home) and Main Site (https://www.revo.teignmouth-nci.org.uk/). The first container is working the second isn’t.

I have gone back to a back of 2.8.5, both files and database, but the behaviour is still the same ie
manager -available and working
visitor facility container - viewable
main site container - not viewable

Expected behavior

Both containers should be viewable

Environment

Modx 2.8.5 to 2.8.6 PHP8.2

What exactly do you mean by “containers”? Contexts in MODX?


The site that fails returns a 500 response status code. Can you take a look at the server error log (This is not the error log in MODX) to see what the actual error message is.

Hi Harry
I really did mean containers. With luck I have attached an image of our resource tree.
image

These are the last two entries in the error log

[04-Oct-2023 14:24:43 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function each() in /home/teignmou/subs/revo/core/cache/includes/elements/modsnippet/4.include.cache.php:416
Stack trace:
#0 /home/teignmou/subs/revo/core/model/modx/modscript.class.php(76): include()
#1 /home/teignmou/subs/revo/core/model/modx/modparser.class.php(537): modScript->process()
#2 /home/teignmou/subs/revo/core/model/modx/modparser.class.php(251): modParser->processTag()
#3 /home/teignmou/subs/revo/core/model/modx/modresource.class.php(546): modParser->processElementTags()
#4 /home/teignmou/subs/revo/core/model/modx/modresource.class.php(498): modResource->parseContent()
#5 /home/teignmou/subs/revo/core/model/modx/modresponse.class.php(62): modResource->prepare()
#6 /home/teignmou/subs/revo/core/model/modx/modrequest.class.php(138): modResponse->outputContent()
#7 /home/teignmou/subs/revo/core/model/modx/modrequest.class.php(122): modRequest->prepareResponse()
#8 /home/teignmou/subs/revo/core/model/modx/modx.class.php(1461): modRequest->handleRequest()
#9 /home/teignmou/subs/revo/index.php(54): modX->handleRequest()
#10 {main}
thrown in /home/teignmou/subs/revo/core/cache/includes/elements/modsnippet/4.include.cache.php on line 416
[04-Oct-2023 14:55:40 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function each() in /home/teignmou/subs/revo/core/cache/includes/elements/modsnippet/4.include.cache.php:416
Stack trace:
#0 /home/teignmou/subs/revo/core/model/modx/modscript.class.php(76): include()
#1 /home/teignmou/subs/revo/core/model/modx/modparser.class.php(537): modScript->process()
#2 /home/teignmou/subs/revo/core/model/modx/modparser.class.php(251): modParser->processTag()
#3 /home/teignmou/subs/revo/core/model/modx/modresource.class.php(546): modParser->processElementTags()
#4 /home/teignmou/subs/revo/core/model/modx/modresource.class.php(498): modResource->parseContent()
#5 /home/teignmou/subs/revo/core/model/modx/modresponse.class.php(62): modResource->prepare()
#6 /home/teignmou/subs/revo/core/model/modx/modrequest.class.php(138): modResponse->outputContent()
#7 /home/teignmou/subs/revo/core/model/modx/modrequest.class.php(122): modRequest->prepareResponse()
#8 /home/teignmou/subs/revo/core/model/modx/modx.class.php(1461): modRequest->handleRequest()
#9 /home/teignmou/subs/revo/index.php(54): modX->handleRequest()
#10 {main}
thrown in /home/teignmou/subs/revo/core/cache/includes/elements/modsnippet/4.include.cache.php on line 416

I hope they make more sense to you than they do to me.

The error occurs in the snippet with the ID = 4 (on line 416).

Can you check in the MODX manager (tab “Elements”) what snippet in your system has the ID = 4?
(The ID is in brackets after the snippet name. Unless it’s a folder. Then the number in brackets is the amount of snippets in the folder.)

Is this snippet from an installed extra (and if yes, which one) or does it contain custom PHP code?

2 Likes

getResources was the culprit. I upgraded all addons only a couple of weeks ago including taking getresources to 1.7.1 but I have had to restore from back up a couple of times and getResources obviously reverted to 1.6.1. Now back to 1.7.1 and the site now works again.
Very many thanks
Think I might change my handle to flounderingjohn

1 Like

TIL what the leading number in those cache files means.

My thanks!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.