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

Script stuck randomly. #45

Open
hajro92 opened this issue Nov 28, 2018 · 1 comment
Open

Script stuck randomly. #45

hajro92 opened this issue Nov 28, 2018 · 1 comment

Comments

@hajro92
Copy link

hajro92 commented Nov 28, 2018

Hi, first I want to thank you all for making this API possible in PHP.

Now I want to represent my issue. Below is part of my code:

$client = new RouterOS\Client(IP, USERNAME, PASSWORD, 8728, false, 10);
$interface_data = $client->sendSync(new RouterOS\Request('/interface/wireless/print'));
// script usually stuck on this line forever after I get interfaces
$reg_table_data = $client->sendSync(new RouterOS\Request('/interface/wireless/registration-table/print'));

What I have noticed, it log in to my device and stays here logged in forever(see image below):
Screenshot

I have about ~500 mikrotik devices and code above is part of the loop. Sometimes it works fine but 50% of time it stuck forever and cannot stop it even with setting php max_execution_time 300.
Any help, suggestion, tip will be highly apprecitated.

Edit: I wanted to note that it happens randomly, it does not stuck always on same device.

@boenrobot
Copy link
Member

boenrobot commented Nov 28, 2018

The fact it works fine 50% of the time leads me to believe this is some sort of a RouterOS bug that is perhaps present in even the newest versions (since it happens on different devices) OR less likely but still possible - a PHP bug.

The only thing I can suggest you do is upgrade your whole stack to the latest stable versions - your web server OS (including libraries and drivers), your PHP version, and your RouterOS version on all of your devices.

If that doesn't help, report a bug to MikroTik, specifically about the '/interface/wireless/registration-table/print' API command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants