prdatur / phpminer

PHPMiner is a web interface for cgminer on linux machines
Other
34 stars 15 forks source link

Warning: reset() expects parameter 1 to be array, boolean given #17

Closed nicoschtein closed 10 years ago

nicoschtein commented 10 years ago

I'm getting this warning in many setups and only one rig is displayed, and only the header and no rows for gpus.

Warning: reset() expects parameter 1 to be array, boolean given in /var/phpminer/controllers/main.php on line 971
prdatur commented 10 years ago

Please check it with the new update. I didn't changed anything at this line. But I want just to be sure that the error still exists.

prdatur commented 10 years ago

Did the error occured again?

nicoschtein commented 10 years ago

It is weird, the website hangs waiting for an offline rig to respond so i can't actually say if it still does...

nicoschtein commented 10 years ago

After 2 minutes of waiting it does load fine with all rigs except the one that is not online but with this error printed:

Warning: socket_recv(): unable to read from socket [104]: Connection reset by peer in .../phpminer/includes/PHPMinerRPC.class.php on line 937
prdatur commented 10 years ago

will check it. maybe i forgot a timeout somewhere.

nicoschtein commented 10 years ago

I think the timeout is there, but it is not being used by PHP. Are you setting stream_set_blocking() to true ?

nicoschtein commented 10 years ago

After checking the code, i see you are setting the timeout with a function used for streams and you are using sockets that is not going to work.

https://github.com/prdatur/phpminer/blob/master/includes/PHPMinerRPC.class.php#L893-L894

prdatur commented 10 years ago

thx

prdatur commented 10 years ago

Have pushed the changes, please check if it is working now.

nicoschtein commented 10 years ago

It worked for a while, timeout is fixed, but i dont get any rig listed and got this error multiple times (looks like once per GPU) at the end of the page:

Error: WARNING: reset() expects parameter 1 to be array, boolean given in /phpminer/controllers/main.php on line 1025
Backtrace:
File: /var/phpminer/index.php
Line: 155: call_user_func_array (Args: array(), array())
File: (unknown)
Line: (unknown): main->init (no args)
File: /var/phpminer/controllers/main.php
Line: 452: main->get_device_data (Args: 1)
Line: 925: main->get_detailed_rig_data (Args: "RIG-NAME", 1)
Line: 1025: reset (Args: 1)
nicoschtein commented 10 years ago

Weird thing, it fixed itself... But nonetheless it will happen again

nicoschtein commented 10 years ago

Nope, it did not fix itself, my bad, disregard the last message..

prdatur commented 10 years ago

I have checked it and i also got some bug reports with this error. I assume the miner had no pools configured? Because this error determines that the miner api command "pools" had an empty response. Please check it again and tell me if it now works or if now other magic things happend :)

nicoschtein commented 10 years ago

The "server" has a cgminer running fine (with pool from group configured by phpminer) , also 2 other clients are running fine too one with sgminer and one with cgminer. None of the 3 appear in phpminer web, and the error i pasted above is still showing up. :(

prdatur commented 10 years ago

With the latest commit the error can't be showing up. If there is an error, it must be a bit different. Because i really check if it is an array and if not i create an empty one. Can you please verify you are on the latest version and if so please repost the error message. If it is really the same error message also the same line etc. I have to recheck it.

prdatur commented 10 years ago

I think this error was in conjunction with the sgminer issue. If not make a new report please.