dokuwiki
dokuwiki copied to clipboard
TypeError: call_user_func_array()
On a new Install with NGINX 1.18 and PHP 8.1.2 the search indexer stucked (always on the same page).
here is the error from the command line (php bin/indexer.php):
☠ TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method in .../inc/parserutils.php:525
Stack trace:
#0 .../inc/parserutils.php(289): p_render_metadata()
#1 .../inc/indexer.php(147): p_get_metadata()
#2 .../bin/indexer.php(82): idx_addPage()
#3 .../bin/indexer.php(71): IndexerCLI->index()
#4 .../bin/indexer.php(57): IndexerCLI->update()
#5 .../vendor/splitbrain/php-cli/src/CLI.php(175): IndexerCLI->main()
#6 .../vendor/splitbrain/php-cli/src/CLI.php(97): splitbrain\phpcli\CLI->execute()
#7 .../bin/indexer.php(107): splitbrain\phpcli\CLI->run()
#8 {main}
View the page also crash:

ERROR:
2022-09-30 14:21:06 .../inc/parserutils.php(525) TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method
#0 .../inc/parserutils.php(289): p_render_metadata()
#1 .../inc/common.php(246): p_get_metadata()
#2 .../doku.php(97): pageinfo()
#3 {main}
Release 2022-07-31a "Igor"
any news to this topic?
https://github.com/splitbrain/dokuwiki/blob/a24500554c259f9aa4cc688547a435181317028e/inc/parserutils.php#L522-L526
One of the instructions seems to be incomplete. I guess it is interesting to see which one. Do you have the possibility to create a bit more debug output?
I'm afraid I don't know how. I just get this error when I call the page (admittedly a very complex page).
Which plugins are used on that page? Is it possible to relate it to one of the plugins for example by temporary disabling/enabling them, or temporarily only having a part of the syntax on that page?
nothing special, but heavy use of wrap plugin
Unfortunately, it is not displayed where the problem would be exactly, then you could narrow it down.
I could at least narrow it down now, since we work a lot with the WRAP plugin and tables, it often happens that the line in the source code looks like this:
...
text</WRAP> |
| text
...
and then the whole thing crashes. If I make this from the upper line, nothing happens:
...
text</WRAP>
| text
...
Probably the line break is not set cleanly somewhere here, since we also create and edit tables with EditTable. Maybe this will help a little.
And one more thing, the source code works WITHOUT problems on this web server:
webserver Apache php_version 7.4.33 php_sapi fpm-fcgi
And also on this webserver
webserver Apache/2.4.54 (Unix) php_version 8.0.27 php_sapi cgi-fcgi
But NOT on this one (online if i change the line like above)
webserver nginx/1.18.0 php_version 8.1.2-1ubuntu2.10 php_sapi fpm-fcgi
Probably the line break is not set cleanly somewhere here, since we also create and edit tables with EditTable.
Are you sure this is a line break? EditTable sometimes inserts a lot of spaces when the cell contents are very different in width. This spreads a line of code over several lines of the editor. Turn off automatic wrapping in the editor window and you will see the actual lines.
- Michael Sy.
Probably the line break is not set cleanly somewhere here, since we also create and edit tables with EditTable.
Are you sure this is a line break? EditTable sometimes inserts a lot of spaces when the cell contents are very different in width. This spreads a line of code over several lines of the editor. Turn off automatic wrapping in the editor window and you will see the actual lines.
- Michael Sy.
The problem is, in 2 Dokuwiki installations with Apache and PHP 7.4.33 and PHP 8.0.27 it works, on NGINX with PHP 8.1.2 it does not work. the same file (ascii copy)
and it's not a linebreak, it's the " |" in the first line that causes problems (3x blank and 1x |)
UPDATE:
Main Error is
AH01071: Got error 'PHP message: PHP Warning: Undefined array key 0 in /......./inc/parserutils.php on line 540'
So I inserted the following code in line 540
if (empty($instruction[0])) return false;
then the page works as desired. Unfortunately, I can not estimate the "side effects" since I am not a developer. Can anyone check this?
The problem can now be recreated with sample code:
PROBLEM CODE:
| TEXT | <WRAP>TEXT<WRAP 50%>
^ A ^ B ^
| 1 | 2 |
| 1 | 2 |
</WRAP>
TEXT</WRAP> |
OK CODE:
| TEXT | <WRAP>TEXT<WRAP 50%>
^ A ^ B ^
| 1 | 2 |
| 1 | 2 |
</WRAP>
TEXT</WRAP>|
The problem comes from the last </WRAP> |, if there are spaces between > and |, the problem occurs. So </WRAP>| => OK, </WRAP> | => Crash.
This can only be a BUG. I just don't know if in the Dokuwiki or in WRAP.