Bitcoin Forum
May 13, 2024, 03:42:27 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [ Phoenix-miner : revision 111 -> RPCProtocol.bug = fixed ] :)  (Read 901 times)
bpd3 (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 15, 2011, 07:15:36 PM
 #1

Hi,

Using svn version i got some error:
Code:
[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
Code:
        result = response = None
to:
Code:
        result = bpd3_fix =response = None

- line 250 change
Code:
            #Check for server messages                                                                                        
            result = loads(response.read())                                                                                   
to:
Code:
            #Check for server messages                                                                                        
            bpd3_fix = response.read()
   
            if len(bpd3_fix) > 0:
                     result = loads(bpd3_fix)                                                                                         

- line 263 change
Code:
            return (connection, result)                                                                                       
        finally:
to:
Code:
            return (connection, result)                                                                                       

        except:                                                                                                           
             self.log('Empyt answer...?')                                                                                 
        finally:

- line 410 (end of file) add
Code:
                 except:                                                                                                       
                       self.log('Long poll: keep-alive..!')

With that patch u should see smtg like this:
Code:
[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
1715614947
Hero Member
*
Offline Offline

Posts: 1715614947

View Profile Personal Message (Offline)

Ignore
1715614947
Reply with quote  #2

1715614947
Report to moderator
1715614947
Hero Member
*
Offline Offline

Posts: 1715614947

View Profile Personal Message (Offline)

Ignore
1715614947
Reply with quote  #2

1715614947
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715614947
Hero Member
*
Offline Offline

Posts: 1715614947

View Profile Personal Message (Offline)

Ignore
1715614947
Reply with quote  #2

1715614947
Report to moderator
1715614947
Hero Member
*
Offline Offline

Posts: 1715614947

View Profile Personal Message (Offline)

Ignore
1715614947
Reply with quote  #2

1715614947
Report to moderator
Newestminer
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 27, 2011, 05:02:46 AM
 #2

I am getting the same error as you were.  Tried your fix and restarted my miners.  I was hoping that you had better luck since this did not work for me Huh
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!