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

Unable to run CLI command afer upgrade plugin to newest version on Kaos 6a #17

Open
macin opened this issue Aug 21, 2024 · 6 comments
Open
Labels
bug Something isn't working

Comments

@macin
Copy link

macin commented Aug 21, 2024

Issue Description

Hi, I just upgraded the AI Chat plugin to latest version. After this, CLI stopped working with the following error

image

Any ideas how to fix this?

@macin macin added the bug Something isn't working label Aug 21, 2024
@macin
Copy link
Author

macin commented Aug 21, 2024

I found this is related to this new addition in latest update: e125188

Do I need to do any adjustments on my side? Couldn't find anything in the docs
What would be the impact if I comment this out: auth_setup();

@ImhotepDE
Copy link

I have exactly the same problem. It comes after I have initialized.

Is there a solution?

@macin
Copy link
Author

macin commented Sep 11, 2024

I have commented out the auth_setup(); line as I think, based on the commit description, this change does not affect me. After that it works back again. But still waiting for the confirmation from the author .

@splitbrain
Copy link
Member

Assuming this is running on Kaos, the issue is caused by these lines:

https://github.com/dokuwiki/dokuwiki/blob/aad0b49e48318eb343208b2c865291716c1819b3/inc/auth.php#L190-L193

As you can see the array_change_key_case method is called on the return of getallheaders(). That method only makes sense in HTTP context, not on the command line. Consequently, that method should not exist on CLI and this is the case for me (PHP 8.3).

What PHP versions are you running?

@macin
Copy link
Author

macin commented Nov 25, 2024

@splitbrain
Looks like the php version is 8.2.7

@splitbrain
Copy link
Member

Also on this specific version the function should not exist:

$ docker run -it --rm php:8.2.7-cli php -r 'var_dump(function_exists("getallheaders"));'
bool(false)

Maybe you're running the CGI version instead of the CLI variant? I'm not sure if that's even possible, but I don't see why the method should exist on command line. Can you please run the following and report the full output here?

php -v

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