Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial indexing crashes with TypeError #22

Open
WetenSchaap opened this issue Oct 13, 2024 · 2 comments
Open

Initial indexing crashes with TypeError #22

WetenSchaap opened this issue Oct 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@WetenSchaap
Copy link

Issue Description

When I try to perform the initial indexing using ./plugin.php elasticsearch index, I get the following error:

☠ TypeError: array_change_key_case(): Argument #1 ($array) must be of type array, string given in /app/www/public/inc/auth.php:192
Stack trace:
#0 /app/www/public/inc/auth.php(192): array_change_key_case()
#1 /app/www/public/inc/auth.php(98): auth_tokenlogin()
#2 /config/dokuwiki/lib/plugins/elasticsearch/cli.php(67): auth_setup()
#3 /app/www/public/vendor/splitbrain/php-cli/src/Base.php(217): cli_plugin_elasticsearch->main()
#4 /app/www/public/vendor/splitbrain/php-cli/src/Base.php(145): splitbrain\phpcli\Base->execute()
#5 /app/www/public/bin/plugin.php(45): splitbrain\phpcli\Base->run()
#6 /app/www/public/vendor/splitbrain/php-cli/src/Base.php(217): PluginCLI->main()
#7 /app/www/public/vendor/splitbrain/php-cli/src/Base.php(145): splitbrain\phpcli\Base->execute()
#8 /app/www/public/bin/plugin.php(110): splitbrain\phpcli\Base->run()
#9 {main}

I am not entirely sure what is going wrong, and whether I am responsible somehow - but the result is that indexing does not work. Search results are always empty.

We run Dokuwiki using the Linuxserver docker image, if that matters.

@WetenSchaap WetenSchaap added the bug Something isn't working label Oct 13, 2024
@splitbrain
Copy link
Member

Seems to be similar to cosmocode/dokuwiki-plugin-aichat#17

@jeffka11
Copy link

jeffka11 commented Feb 15, 2025

I'm getting the same error too on Kaos, info that was requested in cosmocode/dokuwiki-plugin-aichat#17:

www-data@dokuwiki:~/html$ ./bin/plugin.php elasticsearch createindex

Deprecated: Constant E_STRICT is deprecated in /var/www/html/inc/init.php on line 47

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/inc/init.php:47) in     /var/www/html/inc/init.php on line 53
☠ TypeError: array_change_key_case(): Argument #1 ($array) must be of type array, string given in     /var/www/html/inc/auth.php:192
Stack trace:
#0 /var/www/html/inc/auth.php(192): array_change_key_case('')
#1 /var/www/html/inc/auth.php(98): auth_tokenlogin()
#2 /var/www/html/lib/plugins/elasticsearch/cli.php(66): auth_setup()
#3 /var/www/html/vendor/splitbrain/php-cli/src/Base.php(217): cli_plugin_elasticsearch-    >main(Object(splitbrain\phpcli\Options))
#4 /var/www/html/vendor/splitbrain/php-cli/src/Base.php(145): splitbrain\phpcli\Base->execute()
#5 /var/www/html/bin/plugin.php(45): splitbrain\phpcli\Base->run()
#6 /var/www/html/vendor/splitbrain/php-cli/src/Base.php(217): PluginCLI->main(Object(splitbrain\phpcli\Options))
#7 /var/www/html/vendor/splitbrain/php-cli/src/Base.php(145): splitbrain\phpcli\Base->execute()
#8 /var/www/html/bin/plugin.php(110): splitbrain\phpcli\Base->run()
#9 {main}

www-data@dokuwiki:~/html$ php -v
PHP 8.4.4 (cli) (built: Feb 14 2025 02:30:53) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.4.4, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.4, Copyright (c), by Zend Technologies

www-data@dokuwiki:~/html$ php -r 'var_dump(function_exists("getallheaders"));
bool(false)

I'm running this in a Docker container using FROM php:8.4-apache-bookworm

Edit:
Unrelated to this issue, I don't think php:8.4-apache-bookworm works well with Dokuwiki - I get the following when I try to load any page:

Deprecated: Constant E_STRICT is deprecated in /var/www/html/inc/init.php on line 47
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/inc/init.php:47) in /var/www/html/inc/init.php on line 53

When I downgrade to php 8.3 or 8.2, I get the same results though (same error, so I removed that from the output):

www-data@dokuwiki:~/html$ php -v
PHP 8.2.27 (cli) (built: Feb  4 2025 04:37:35) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.27, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.27, Copyright (c), by Zend Technologies

www-data@dokuwiki:~/html$ php -r 'var_dump(function_exists("getallheaders"));'
bool(false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants