cdhowie / Bitcoin-mining-proxy

Multi-pool, multi-worker proxy for Bitcoin miners, supporting long polling and pool failover
GNU Affero General Public License v3.0
126 stars 70 forks source link

Unhandled error on getwork #14

Closed alanpearce closed 13 years ago

alanpearce commented 13 years ago

I've managed to install and configure the proxy (adding pools, workers, and adding workers to pools), but when I point a miner to it, it seems that only the authentication happens. Here's what phoenix spits out:

[14/06/2011 21:13:34] Phoenix 1.48 starting...
[14/06/2011 21:13:34] Connected to server
[0 Khash/sec] [0 Accepted] [0 Rejected] [RPC]Unhandled Error
Traceback (most recent call last):
  File "phoenix.py", line 125, in <module>

  File "twisted\internet\base.pyc", line 1162, in run

  File "twisted\internet\base.pyc", line 1171, in mainLoop

--- <exception caught here> ---
  File "twisted\internet\base.pyc", line 793, in runUntilCurrent

  File "minerutil\RPCProtocol.pyc", line 127, in callback

  File "minerutil\RPCProtocol.pyc", line 319, in handleWork

exceptions.TypeError: argument of type 'NoneType' is not iterable

Phoenix r101 does not give any error messages, but stays at 0Mhash/s I've also tried using bitcoin getwork, to which I get error: no response from server. I'm not sure if this should work, however

The proxy is on PHP 5.3.6-pl0-gentoo (fpm-fcgi) on Cherokee 1.2.2

alanpearce commented 13 years ago

I decided to see what curl would do. For some reason I had difficulty with the command-line version, so I wrote some short PHP code to test it. Here's what it spat out:

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Date: Sat, 18 Jun 2011 12:11:37 GMT
Server: Cherokee/1.2.2 (Gentoo Linux)
X-Source-Code: https://github.com/cdhowie/Bitcoin-mining-proxy
Content-Type: application/json-rpc

{"error":"No enabled pools responded to the work request.","result":null,"id":1}1

I took the error_reporting directive out so that I could see what was happening. $http_response_header was undefined. At first I thought it was part of pecl_http, but actually it's just a php.ini setting that needs to be enabled: allow_url_fopen = On. You might want to add this to the readme. You could set it with ini_set or .htaccess, but not every server allows the former or supports the latter.

There was another notice: Undefined variable: force_getwork in /.../htdocs/index.php Just add $force_getwork = null; before the if statement, starting near # Check request (line 94)

cdhowie commented 13 years ago

Fixed. Thanks for investigating this.