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

Fatal queuedtracking:monitor issue #269

Closed
german-drulyk opened this issue Oct 21, 2024 · 12 comments · Fixed by #271
Closed

Fatal queuedtracking:monitor issue #269

german-drulyk opened this issue Oct 21, 2024 · 12 comments · Fixed by #271

Comments

@german-drulyk
Copy link

german-drulyk commented Oct 21, 2024

Error:

ERROR     [2024-10-21 13:39:35] 5424  Uncaught exception: Error: Call to undefined function Piwik\Plugins\QueuedTracking\Commands\readline_callback_handler_install() in matomo\plugins\QueuedTracking\Commands\Monitor.php:74

Platform:
Windows Server 2022
PHP x64 8.3.10
Matomo 5.1.1
Queued Tracking 5.1.0

Issue:
Windows PHP DOES NOT ship with readline_callback_handler_install(); contrary to the claim made at https://www.php.net/manual/en/readline.installation.php

PHP Versions tested:
7.1.0 x64
7.4.9 x64
8.1.9 x64
8.3.10 x64
8.3.12 x64

Additional resources
https://stackoverflow.com/a/71178783

@AltamashShaikh
Copy link
Contributor

@german-drulyk Sorry to hear this, can you please check if changing this Line in QueuedTracking\Commands\Monitor.php with below code solves the issue for you ??

if (function_exists('readline_callback_handler_install')) {
            readline_callback_handler_install('', function () {
            });
        }

@AltamashShaikh
Copy link
Contributor

@haristku FYI

@german-drulyk
Copy link
Author

@AltamashShaikh Thank you for the quick response.

Yes, using function_exists() does alleviate the symptom.

@AltamashShaikh
Copy link
Contributor

@german-drulyk Does everything else works as expected ?

@german-drulyk
Copy link
Author

german-drulyk commented Oct 21, 2024

@AltamashShaikh

I am seeing no further errors in my logs and the queue does seem to be processing.

However, the CMD window no longer auto-refreshes. I have to terminate and re-invoke queuedtracking:monitor. This is not a major issue to me but I just wanted to make you aware of what I am experiencing.

Please let me know if you would like additional testing of something specific.

Thanks!

@haristku
Copy link
Contributor

@german-drulyk @AltamashShaikh

i was worried that this might happen, since i didn't have a chance to try the "monitor" feature in a windows environment.
i'll try to find a work around to replace the readline_callback_handler_install function.

brb..

@AltamashShaikh
Copy link
Contributor

@german-drulyk Can you check if this PR solves the problem completely for you ?

@german-drulyk
Copy link
Author

@AltamashShaikh The PR does seem to solve the readline_callback_handler_install() fatal error but I have not tested the dev code nor reviewed the code in its entirety.

The conditional check resulting in line 267 seems susceptible to false positives.

Simplifying the function like this would seem sufficient:

private function interactiveCapability()
{
    return function_exists('readline_callback_handler_install');
}

@AltamashShaikh
Copy link
Contributor

@german-drulyk Can you replace Commands/Monitor.php with this file and check once ?

@german-drulyk
Copy link
Author

@AltamashShaikh I replaced Monitor.php with the dev version, re-ran the command, and have found zero new errors.

Additionally, the window does auto-refresh the queue counts now.

@AltamashShaikh
Copy link
Contributor

@german-drulyk Thanks for testing this 👍
We have requested the change for interactiveCapability on PR and should merge it once done and release a new version accordingly 👍

AltamashShaikh added a commit that referenced this issue Oct 23, 2024
disable monitor interactive paging on windows #269
@AltamashShaikh
Copy link
Contributor

@german-drulyk Released v5.1.1 of the plugin with a fix.

@innocraft-automation innocraft-automation removed this from the Current sprint milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants