Hi,
Using svn version i got some error:
[15/07/2011 20:28:06] Result: 879b394b accepted
[346.49 Mhash/sec] [6 Accepted] [0 Rejected] [RPC (+LP)]Traceback (most recent call last):
File "/home/miner1/p2/minerutil/RPCProtocol.py", line 399, in longPo[15/07/2011 20:28:07] Long poll exception:
[346.49 Mhash/sec] [6 Accepted] [0 Rejected] [RPC (+LP)] (connection, result) = self.request(connection, url, self.headers)
File "/home/miner1/p2/minerutil/RPCProtocol.py", line 250, in request
result = loads(response.read())
File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 360, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 378, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
I figured out that empty response message is passed to json parser. Although i never used python, i decided to fix it. C experience helps in almost every language :)
So in file RPCProtocol.py:
- line 233 change
to:
result = bpd3_fix =response = None
- line 250 change
#Check for server messages
result = loads(response.read())
to:
#Check for server messages
bpd3_fix = response.read()
if len(bpd3_fix) > 0:
result = loads(bpd3_fix)
- line 263 change
return (connection, result)
finally:
to:
return (connection, result)
except:
self.log('Empyt answer...?')
finally:
- line 410 (end of file) add
except:
self.log('Long poll: keep-alive..!')
With that patch u should see smtg like this:
[15/07/2011 20:59:48] Result: 09cfdec6 accepted
[15/07/2011 20:59:59] Empyt answer...?
[15/07/2011 20:59:59] Long poll: keep-alive..!
[15/07/2011 21:00:06] Result: 17221706 accepted
[346.60 Mhash/sec] [6 Accepted] [0 Rejected] [RPC (+LP)]
Since there is exception handling in separate thread this bug was rather annoying than critical (no crash). Please remember it's my first python experience ever but if you found this patch useful you can always send some bits to: 1F3cdXnq9ja7bB8DRkavZsG9WQH7USfZyz
Hope author of Phoenix-miner software or any miner interested in using revision 111 of Phoniex will find this post in the newbie section :)
Greetings