Net_RouterOS icon indicating copy to clipboard operation
Net_RouterOS copied to clipboard

Script stuck randomly.

Open hajro92 opened this issue 6 years ago • 1 comments

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.

hajro92 avatar Nov 28 '18 18:11 hajro92

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.

boenrobot avatar Nov 28 '18 20:11 boenrobot