"Uncaught Error" when updating from 2.15 to 2.3-beta1

Found a bug? Tell us!!
jmglastetter
Regular
Posts: 9
Joined: Fri Dec 14, 2018 7:27 am

"Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by jmglastetter » Wed May 29, 2019 7:19 am

Hi!
When trying to update from 2.1.5 to 2.3 Beta1, I get the normal screen that states, "Serendipity has detected that your currently installed Serendipity version is 2.1.5. It seems you are attempting to upgrade to version 2.3-beta1, so you need to click here to continue the upgrade process."

After clicking, I get the following error listed below. I am able to get my site back online by changing the version number in config.inc.php back to version 2.1.5.

Fatal error: Uncaught ErrorException: Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php:253 Stack trace: #0 [internal function]: errorToExceptionHandler(2, 'sizeof(): Param...', '/home/user...', 253, Array) #1 /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php(253): sizeof(NULL) #2 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5cedf7509b6027_72816663(Object(Smarty_Internal_Template)) #3 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #4 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_internal_template.php(2 in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php on line 253
== ERROR-REPORT (BETA/ALPHA-BUILDS) ==
Fatal Error: Uncaught ErrorException: Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php:253 Stack trace: #0 [internal function]: errorToExceptionHandler(2, 'sizeof(): Param...', '/home/user...', 253, Array) #1 /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php(253): sizeof(NULL) #2 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5cedf7509b6027_72816663(Object(Smarty_Internal_Template)) #3 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #4 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_internal_template.php(2 in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php on line 253.
For more details set $serendipity['production'] = 'debug' in serendipity_config_local.inc.php to receive a stack-trace.

Fatal error: Uncaught ErrorException: Fatal Error: Uncaught ErrorException: Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php:253
Stack trace:
#0 [internal function]: errorToExceptionHandler(2, 'sizeof(): Param...', '/home/user...', 253, Array)
#1 /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php(253): sizeof(NULL)
#2 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5cedf7509b6027_72816663(Object(Smarty_Internal_Template))
#3 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#4 /home/user/public_html/bundled-libs/Smarty/libs/sys in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php on line 253
Last edited by jmglastetter on Sat Jun 01, 2019 2:11 pm, edited 2 times in total.

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by onli » Fri May 31, 2019 9:58 am

Code: Select all

 [internal function]: errorToExceptionHandler(2, 'sizeof(): Param...', '/home/iloveprec...', 253, Array
Sadly that messages prunes exactly the necessary information to help. Could you follow the reommendation it gives and see whether that helps giving a longer stracktrace?
For more details set $serendipity['production'] = 'debug' in serendipity_config_local.inc.php to receive a stack-trace.
It looks like something goes wrong in the template layer, when trying to render the upgrade page. Are there specific changes in the admin area of your fork of 2k11?

jmglastetter
Regular
Posts: 9
Joined: Fri Dec 14, 2018 7:27 am

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by jmglastetter » Fri May 31, 2019 3:59 pm

Hi Onli!
Thank you for helping with this. The first part regarding the stacktrace I have never performed before and would need a walk-through, but the second part regarding changes to the admin area...there are changes I made some time ago. Here are what notes I have on what was changed. Unfortunately, there may have been changes made before I realized my memory would only go so far before I started writing them down.

Added $serendipity['capabilities']['jquery'] = false; to the end of the file /templates/2k11-myfork/config.inc.php to remove render blocking JavaScript.

Added more save buttons in this file /plugins/serendipity_event_staticpage/backend_templates/default_staticpage_backend.tpl to make editing static pages faster on mobile. Also in this file, commented out the Content field label title and entire Pre-Content area to save space on mobile since I don't use them.

Removed ending slash from the meta description in this file /plugins/serendipity_event_staticpage/serendipity_event_staticpage.php


Another thing I notice in serendipity_config.inc.php. Should these point to my fork?

Code: Select all

// Name of folder for the default theme
$serendipity['defaultTemplate'] = '2k11';

Code: Select all

// Default backend theme
if (!isset($serendipity['template_backend'])) {
    $serendipity['template_backend'] = '2k11'; }

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by onli » Fri May 31, 2019 5:05 pm

Hi
Those changes should not be the issue.
Another thing I notice in serendipity_config.inc.php. Should these point to my fork?
No, it's okay when they point to the regular 2k11, it just defines what will be used as fallback if your template is missing the file serendipity asks for.
The first part regarding the stacktrace I have never performed before and would need a walk-through
It maybe sounds more complated than it is :) You need to access the files on your server, with ssh for example. There will be a file called serendipity_config_local.inc.php in your serendipity directory. Open it with an editor and add the line

Code: Select all

$serendipity['production'] = 'debug';
I'm not certain it will give us more useful information, but it's something to try.

jmglastetter
Regular
Posts: 9
Joined: Fri Dec 14, 2018 7:27 am

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by jmglastetter » Fri May 31, 2019 9:10 pm

Below is what appeared after adding the debug line to serendipity_config_local.inc.php. Also a separate Smarty Debug Console popped up as well.

Code: Select all

#0  errorToExceptionHandler(1, Uncaught ErrorException: Warning: Use of undefined constant INCLUDE_ANY - assumed 'INCLUDE_ANY' (this will throw an Error in a future version of PHP) in /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php:1290
Stack trace:
#0 /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(1290): errorToExceptionHandler(2, 'Use of undefine...', '/home/user...', 1290, Array)
#1 /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(1311): serendipity_event_staticpage->parseStaticPage()
#2 /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(3202): serendipity_event_staticpage->show()
#3 /home/user/public_html/include/plugin_api.inc.php(1138): serendipity_event_staticpage->event_hook('entries_header', Object(serendipity_property_bag), Array, '')
#4 /home/user/public_html/include/functions_smarty.inc.php(561):, /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php, 1290) called at [/home/user/public_html/include/compat.inc.php:254]
#1  fatalErrorShutdownHandler()
Fatal Error: Uncaught ErrorException: Warning: Use of undefined constant INCLUDE_ANY - assumed 'INCLUDE_ANY' (this will throw an Error in a future version of PHP) in /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php:1290 Stack trace: #0 /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(1290): errorToExceptionHandler(2, 'Use of undefine...', '/home/user...', 1290, Array) #1 /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(1311): serendipity_event_staticpage->parseStaticPage() #2 /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php(3202): serendipity_event_staticpage->show() #3 /home/user/public_html/include/plugin_api.inc.php(1138): serendipity_event_staticpage->event_hook('entries_header', Object(serendipity_property_bag), Array, '') #4 /home/user/public_html/include/functions_smarty.inc.php(561): in /home/user/public_html/plugins/serendipity_event_staticpage/serendipity_event_staticpage.php on line 1290.

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by onli » Fri May 31, 2019 11:47 pm

That might be an unrelated issue, but it's good of ix it as well. There should be an update available for the staticpage plugin that fixes this. Does it turn up in the list of available plugin updates?

jmglastetter
Regular
Posts: 9
Joined: Fri Dec 14, 2018 7:27 am

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by jmglastetter » Sat Jun 01, 2019 5:28 am

I indeed was able to update the Staticpage plugin and that cleared the debugging errors in 2.1.5. Although there's something else that's been fishy with my plugins...when I click Update Plugins, I get the error below. Clicking Update Plugins a second time normally clears it. I've checked that it is still doing this after updating the StaticPage plugin.

Code: Select all

Your browser did not sent a valid HTTP-Referrer string. This may have either been caused by a misconfigured browser/proxy or by a Cross Site Request Forgery (XSRF) aimed at you. The action you requested could not be completed.
After enabling debugging, and attempting 2.3-beta1 update again, this is the report.
Fatal error: Uncaught ErrorException: Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php:253 Stack trace: #0 [internal function]: errorToExceptionHandler(2, 'sizeof(): Param...', '/home/user...', 253, Array) #1 /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php(253): sizeof(NULL) #2 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5cf1ea930e3be2_97553720(Object(Smarty_Internal_Template)) #3 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #4 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_internal_template.php(2 in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php on line 253
== ERROR-REPORT (DEBUGGING ENABLED) ==
== (When you copy this debug output to a forum or other places, make sure to remove your username/passwords, as they may be contained within function calls) ==
#0 errorToExceptionHandler(1, Uncaught ErrorException: Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php:253
Stack trace:
#0 [internal function]: errorToExceptionHandler(2, 'sizeof(): Param...', '/home/user...', 253, Array)
#1 /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php(253): sizeof(NULL)
#2 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5cf1ea930e3be2_97553720(Object(Smarty_Internal_Template))
#3 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#4 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_internal_template.php(2, /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php, 253) called at [/home/user/public_html/include/compat.inc.php:254]
#1 fatalErrorShutdownHandler()
Fatal Error: Uncaught ErrorException: Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php:253 Stack trace: #0 [internal function]: errorToExceptionHandler(2, 'sizeof(): Param...', '/home/user...', 253, Array) #1 /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php(253): sizeof(NULL) #2 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5cf1ea930e3be2_97553720(Object(Smarty_Internal_Template)) #3 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #4 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_internal_template.php(2 in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php on line 253.


Fatal error: Uncaught ErrorException: Fatal Error: Uncaught ErrorException: Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php:253
Stack trace:
#0 [internal function]: errorToExceptionHandler(2, 'sizeof(): Param...', '/home/user...', 253, Array)
#1 /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.php(253): sizeof(NULL)
#2 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_5cf1ea930e3be2_97553720(Object(Smarty_Internal_Template))
#3 /home/user/public_html/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#4 /home/user/public_html/bundled-libs/Smarty/libs/sys in /home/user/public_html/templates_c/2k11_myfork/2f/b7/80/2fb780b66f570ea11b4260f85a7b0e49103f444c_0.file.upgrader.inc.tpl.phpon line 253
Lines 252 and 253 of the bolded file above are:

Code: Select all

252   <?php if (($_smarty_tpl->tpl_vars['errorCount']->value < 1)) {?>
253   <?php if ((sizeof($_smarty_tpl->tpl_vars['sqlfiles']->value) > 0)) {?>
Last edited by jmglastetter on Sat Jun 01, 2019 2:10 pm, edited 1 time in total.

jmglastetter
Regular
Posts: 9
Joined: Fri Dec 14, 2018 7:27 am

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by jmglastetter » Sat Jun 01, 2019 5:36 am

Also, something else I just noticed, in 2.1.5 when clicking Verify Installation Integrity within Maintenance, I get the error

Code: Select all

Unable to compare checksums! (No checksums.inc.php in main directory)
I verified the file is there, but it is an blank file.

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by onli » Sat Jun 01, 2019 1:41 pm

In your fork of 2k11, do you also have the admin directory?

It looks like a check against that situation is missing. That's either because Smarty removed it when translating the tpl to php, or it is because it is just not there in the tpl. This is how that check does look like in the current 2k11, that is in templates/2k11/admin/upgrader.inc.tpl on line 128:

Code: Select all

{if $sqlfiles && (sizeof($sqlfiles) > 0)}
Is it the same in your template?

You can ignore the checksum thing.

jmglastetter
Regular
Posts: 9
Joined: Fri Dec 14, 2018 7:27 am

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by jmglastetter » Sat Jun 01, 2019 2:20 pm

Line 128 of templates/2k11_myfork/admin/upgrader.inc.tpl

Code: Select all

{if (sizeof($sqlfiles) > 0)}
I also verified that this is the same code on line 128 of my regular 2k11.

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by onli » Sat Jun 01, 2019 3:23 pm

Then it's possible it's a bug in 2.1.5 we fixed only in 2.3. Could you change the line to the new one, in both those files? It should be

Code: Select all

{if $sqlfiles && (sizeof($sqlfiles) > 0)}

jmglastetter
Regular
Posts: 9
Joined: Fri Dec 14, 2018 7:27 am

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by jmglastetter » Sat Jun 01, 2019 3:55 pm

It worked! Thank you for being persistent!
Powered by Serendipity 2.3-beta1 and PHP 7.3.3
Is the Update Plugin HTTP-Referrer string error, and the CheckSum error anything the try to fix?

User avatar
onli
Regular
Posts: 2222
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by onli » Sat Jun 01, 2019 5:05 pm

The checksum error I'd assume just to be caused by the beta/alpha release process, though if I remember correctly the 2.3-beta1 should have that file. It's an area where I do not know s9y well, might be better in a dedicated thread for someone else to pick up.

The HTTP-Referrer however should be fixed already. Or isn't it for you?

jmglastetter
Regular
Posts: 9
Joined: Fri Dec 14, 2018 7:27 am

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by jmglastetter » Sun Jun 02, 2019 4:39 am

You are right, after trying Update Plugins a few times, and installing a few plugins to test, I'm not getting the HTTP-Referrer error anymore. :D

thh
Regular
Posts: 272
Joined: Thu Oct 26, 2006 2:38 pm
Location: Stuttgart, Germany
Contact:

Re: "Uncaught Error" when updating from 2.15 to 2.3-beta1

Post by thh » Sun Jun 02, 2019 10:45 am

onli wrote:
Sat Jun 01, 2019 5:05 pm
The checksum error I'd assume just to be caused by the beta/alpha release process, though if I remember correctly the 2.3-beta1 should have that file.
It should, and it does; it has about 307 kB in the tarball.

You don't get this file if you install from git, as it is generated in the release process.

Post Reply