moopless / stratum-mining-litecoin

This fork is no longer maintained. Please use https://github.com/ahmedbodi/stratum-mining
Other
38 stars 35 forks source link

Processing of Message failed #31

Closed Neozonz closed 11 years ago

Neozonz commented 11 years ago

Getting some strange errors in my logs, see trace back.

410430519:2013-07-02 13:49:56,929 ERROR protocol protocol.dataReceived # Processing of message failed 410430612-Traceback (most recent call last): 410430648- File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/protocol.py", line 185, in dataReceived 410430769- self.lineReceived(line, request_counter) 410430815- File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/protocol.py", line 216, in lineReceived 410430936- raise custom_exceptions.ProtocolException("Cannot decode message '%s'" % line)

TheSerapher commented 11 years ago

I have those too with vips stratum ... Maybe they can be fixed? :-)

moopless commented 11 years ago

I think I found the problem in stratum. Is it always followed with a connectionMade line?

DEBUG protocol protocol.connectionMade # Connected x.x.x.x

I think there is a null/newline at the end that it tries to decode. This raises the exception which reset the socket connection with the miner. We can suppress the exception or ensure the string is not null. Either way we would do exactly what the catch block does (without throwing the exception). It is out of the scope of this project, so I cannot include a fix in my code, but I think we can make some easy modifications to stratum.

I added the following line to /usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/protocol.py:176 and have not seen the stack trace since.

lines = filter(None, lines)

Anyone want to give it a try?

Neozonz commented 11 years ago

Will once home On 2013-07-02 4:50 PM, "moopless" notifications@github.com wrote:

I think I found the problem in stratum. Is it always followed with a connectionMade\ line?

DEBUG protocol protocol.connectionMade # Connected x.x.x.x

I think there is a null/newline at the end that it tries to decode. This raises the exception which reset the socket connection with the miner. We can suppress the exception or ensure the string is not null. Either way we would do exactly what the catch block does (without throwing the exception). It is out of the scope of this project, so I cannot include a fix in my code, but I think we can make some easy modifications to stratum.

I added the following line to * /usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/protocol.py:176

  • and have not seen the stack trace since.

lines = filter(None, lines)

Anyone want to give it a try?

— Reply to this email directly or view it on GitHubhttps://github.com/moopless/stratum-mining-litecoin/issues/31#issuecomment-20375229 .

Neozonz commented 11 years ago

Added to line 176-

Still seeing issues

2013-07-02 21:30:05,291 ERROR protocol protocol.dataReceived # Processing of message failed Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/protocol.py", line 187, in dataReceived self.lineReceived(line, request_counter) File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/protocol.py", line 218, in lineReceived raise custom_exceptions.ProtocolException("Cannot decode message '%s'" % line) 'rotocolException: Cannot decode message 'POST / HTTP/1.1

Neozonz commented 11 years ago

Could this issue be because someone is connecting to stratum via a browser? "POST / HTTP/1.1"

moopless commented 11 years ago

Yeah. The it sounds like the socket does not know how to translate the HTTP header.