Pages:
Author

Topic: Electrum server discussion thread - page 17. (Read 61495 times)

jr. member
Activity: 53
Merit: 2
October 15, 2012, 12:31:43 PM
The server has been running for ~48 hours with no problems, so I'm willing to declare this problem solved. In case anyone comes across this problem in the future, setting "binary-type = hex" in abe.conf did the trick.
legendary
Activity: 1386
Merit: 1097
October 12, 2012, 02:47:36 PM
Good luck by reindexing blockchain again Wink
jr. member
Activity: 53
Merit: 2
October 12, 2012, 02:05:01 PM
Hm, raw output script should be in hex form. It looks like this variable is filled directly from the database (https://github.com/spesmilo/electrum-server/blob/master/backends/abe/__init__.py), so maybe this is related to version of Abe and/or postgresql driver in Abe?

I know that Abe is doing wild variable conversions for keeping compatibility with wide area of databases, so maybe this is question to Abe developers, more than Electrum developers...

Oh! I set "binary-type = pg-bytea" in abe.conf. I'll bet that if I set it back to "binary-type = hex" it'll get fixed.
legendary
Activity: 1386
Merit: 1097
October 12, 2012, 01:59:57 PM
Hm, raw output script should be in hex form. It looks like this variable is filled directly from the database (https://github.com/spesmilo/electrum-server/blob/master/backends/abe/__init__.py), so maybe this is related to version of Abe and/or postgresql driver in Abe?

I know that Abe is doing wild variable conversions for keeping compatibility with wide area of databases, so maybe this is question to Abe developers, more than Electrum developers...
jr. member
Activity: 53
Merit: 2
October 12, 2012, 01:50:20 PM
hm, there's "raw output script", which is buffer object. Something is broken here. Are you using latest git?

Yes. I actually wrote an Archlinux PKGBUILD that clones git://github.com/spesmilo/electrum-server.git
legendary
Activity: 1386
Merit: 1097
October 12, 2012, 01:44:09 PM
hm, there's "raw output script", which is buffer object. Something is broken here. Are you using latest git?
jr. member
Activity: 53
Merit: 2
October 12, 2012, 01:25:03 PM
Can you please add "print response.__repr__()" to line /usr/share/electrum-server/transports/stratum_tcp.py, line 30?

This is the object that it fails to serialize:
Code:
{'id': 15, 'result': [{'block_hash': '00000000000002d8c76e662906670ed570ccf1dcdab0f9ecc0fe40ff7aceda2d', 'is_input': 0, 'tx_hash': '39a539f1bf330287c259620b217232f5ea77d116f0f5a88d316d2957e4caf863', 'index': 1, 'outputs': ['1NFbPZr7KD3V8ZvjdssdnidepvjMSTARUZ', '1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'timestamp': 1340853742, 'inputs': ['1DGUkqgt8ecdSmTtFosujuEx2nBxM2tXAQ'], 'value': 2000000000, 'height': 186565}, {'tx_hash': '5c297e69d89b2cdb8e46799711df7e8745aaed1e119652c9decaaf48e2140350', 'inputs': ['13HLfocvUzAz7dZghau3hpZJ2YhDRWzLMw', '1DqSR6MiL4kB62Z6YMmQ1KpPNsK23Kb5Po'], 'outputs': ['1372wdd5bwdwWf5HvzW7s8D9of6vcxFNj2', '1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'height': 186572, 'block_hash': '00000000000002baa2474fa9bbcde9ff68cd1639d755a9dbeb933cc2e3fb8900', 'is_input': 0, 'index': 1, 'value': 6000000000, 'raw_output_script': , 'timestamp': 1340857517}, {'block_hash': '000000000000047f5c61faad21a0242ff37e087e804d0adeb3f9c61dd682a26d', 'is_input': 1, 'tx_hash': 'f32c96681776bc7065206ed53c6c62f0e47002384e5536153f4da243a5caed59', 'index': 0, 'outputs': ['1G7EXGeahYYmXsYVAfBjT9G8RjywhstuB8', '1BYKEj4odWztfvWXvYf6SvnQv5PtyRJiSp'], 'timestamp': 1348980703, 'inputs': ['1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'value': -2000000000, 'height': 201182}, {'tx_hash': '5c297e69d89b2cdb8e46799711df7e8745aaed1e119652c9decaaf48e2140350', 'inputs': ['13HLfocvUzAz7dZghau3hpZJ2YhDRWzLMw', '1DqSR6MiL4kB62Z6YMmQ1KpPNsK23Kb5Po'], 'outputs': ['1372wdd5bwdwWf5HvzW7s8D9of6vcxFNj2', '1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'height': 0, 'block_hash': 'mempool', 'is_input': 0, 'index': 1, 'value': 6000000000, 'raw_output_script': , 'timestamp': 0}, {'block_hash': 'mempool', 'is_input': 0, 'tx_hash': '39a539f1bf330287c259620b217232f5ea77d116f0f5a88d316d2957e4caf863', 'index': 1, 'outputs': ['1NFbPZr7KD3V8ZvjdssdnidepvjMSTARUZ', '1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'timestamp': 0, 'inputs': ['1DGUkqgt8ecdSmTtFosujuEx2nBxM2tXAQ'], 'value': 2000000000, 'height': 0}, {'block_hash': 'mempool', 'is_input': 1, 'tx_hash': 'f32c96681776bc7065206ed53c6c62f0e47002384e5536153f4da243a5caed59', 'index': 0, 'outputs': ['1G7EXGeahYYmXsYVAfBjT9G8RjywhstuB8', '1BYKEj4odWztfvWXvYf6SvnQv5PtyRJiSp'], 'timestamp': 0, 'inputs': ['1NAt9bC3fNCkoAXL2Bo3FqnXhWiZHb7vJ8'], 'value': -2000000000, 'height': 0}]}
legendary
Activity: 1386
Merit: 1097
October 12, 2012, 01:16:00 PM
Can you please add "print response.__repr__()" to line /usr/share/electrum-server/transports/stratum_tcp.py, line 30?

It is now:
data = json.dumps(response) + "\n"

Should be:
print response.__repr__()
data = json.dumps(response) + "\n"

This will give us some info what information is server trying to serialize...
jr. member
Activity: 53
Merit: 2
October 12, 2012, 01:08:52 PM
That "KeyboardInterrupt" traceback is just telling you that you interrupted the script by Ctrl+C, nothing more.
Right, I thought that the relevant bit of that traceback was where the command was hanging.

electrum-stop script is connecting to the server over RPC, so if server is loading block database or is busy with something else, it won't response. Please send "tail electrum.log" here. You can also check "top" command; if database is under load, then electrum is updating Abe db.
I'm not quite sure what you're saying here, but the database isn't under any significant load. top shows that neither the python process, nor postgres are using any significant amounts of CPU. iotop also shows that there's no disk activity from either process.

Here's an example of the output when the server isn't running properly:
Code:
[bitcoin@uncle-enzo /]$ electrum-server
Starting Electrum server on uncle-enzo.mit.edu
Coin chain_id = 1
blockchain: 202904 blocks
TCP server started.
HTTP server started.
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/share/electrum-server/processor.py", line 246, in run
    self.update()
  File "/usr/share/electrum-server/processor.py", line 260, in update
    self.send_response(internal_id, response)
  File "/usr/share/electrum-server/processor.py", line 276, in send_response
    session.send_response(response)
  File "/usr/share/electrum-server/transports/stratum_tcp.py", line 30, in send_response
    data = json.dumps(response) + "\n"
  File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: is not JSON serializable

[12/10/2012-00:13:53] TCP 10 1.0
[12/10/2012-00:13:53] TCP 12 1.0
[12/10/2012-00:13:53] TCP 7 1.01-e
[12/10/2012-00:13:54] TCP 16 1.0
block number: 202904
Stopping Stratum
processor terminating
Server stopped
exit timer


I left the server running last night. It was working fine when I went to bed, but when I woke up this morning, I saw this in the logs, and the server is no longer responsive:
Code:
discarding tx id 3984266
discarding tx id 3984266
discarding tx id 4031277
discarding tx id 4031277
discarding tx id 4152198
discarding tx id 4320304
[12/10/2012-07:11:59] TCP 7 1.0
[12/10/2012-07:13:13] TCP 7 1.0
block number: 202952
block number: 202953
block number: 202954
[12/10/2012-07:39:06] TCP 1 1.0
[12/10/2012-07:39:31] TCP 1 1.01-e
discarding tx id 6769795
[12/10/2012-07:43:12] TCP 8 0.52
block number: 202955
[12/10/2012-08:01:32] TCP 7 0.61
block number: 202956
block number: 202957
[12/10/2012-08:04:07] TCP 1 1.01-e
[12/10/2012-08:16:16] TCP 1 1.01-e
[12/10/2012-08:19:01] TCP 7 1.01-e
[12/10/2012-08:21:51] TCP 7 1.01-e
[12/10/2012-08:25:39] TCP 1 1.01-e
block number: 202958
[12/10/2012-08:32:03] TCP 8 1.01-e
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/share/electrum-server/processor.py", line 246, in run
    self.update()
  File "/usr/share/electrum-server/processor.py", line 260, in update
    self.send_response(internal_id, response)
  File "/usr/share/electrum-server/processor.py", line 276, in send_response
    session.send_response(response)
  File "/usr/share/electrum-server/transports/stratum_tcp.py", line 30, in send_response
    data = json.dumps(response) + "\n"
  File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: is not JSON serializable

[12/10/2012-08:32:30] TCP 8 1.01-e
block number: 202959
[12/10/2012-08:40:05] TCP 10 1.0
block number: 202960
[12/10/2012-08:44:31] TCP 7 1.0
block number: 202961
discarding tx id 6478819
discarding tx id 6015062           
discarding tx id 5935605
discarding tx id 5935579
discarding tx id 5935292
discarding tx id 5933473
legendary
Activity: 1386
Merit: 1097
October 12, 2012, 12:49:36 PM
That "KeyboardInterrupt" traceback is just telling you that you interrupted the script by Ctrl+C, nothing more.

electrum-stop script is connecting to the server over RPC, so if server is loading block database or is busy with something else, it won't response. Please send "tail electrum.log" here. You can also check "top" command; if database is under load, then electrum is updating Abe db.
jr. member
Activity: 53
Merit: 2
October 12, 2012, 12:37:48 AM
I tried starting the server with iptables preventing incoming connections on port 50000

and by port 50000 I mean port 50001
jr. member
Activity: 53
Merit: 2
October 11, 2012, 11:26:28 PM
I would try to rebuild of the abe database from scratch. (I know, it is slow...)
See ya in 3 weeks duncant :/

Okay, so I rebuilt the database. The first time I fired up the server, it worked perfectly. I started it with "cache = no" and "irc = no". After testing it, I wanted to enable those, so I stopped the server, which worked fine. I edited the config file and restarted the server. As soon as it started up, I got the traceback that I posted above and it doesn't work again. About 1 in 10 times, the server starts properly, the rest of the time I get the traceback above.

Another thing to note, is that when the server wasn't working properly, and I went to shut it down, "electrum-server stop" hung, without printing the "ok" message. The server did shut itself down, but the "electrum-server stop" command never finished. When I Ctrl-C'd it it printed the following traceback:

Code:
Traceback (most recent call last):
  File "/usr/bin/electrum-server", line 101, in
    run_rpc_command(sys.argv[1], stratum_tcp_port)
  File "/usr/bin/electrum-server", line 75, in run_rpc_command
    o = s.recv(1024)
KeyboardInterrupt

=========== Frustration break occurred here ==========

As an experiment, I tried starting the server with iptables preventing incoming connections on port 50000. I waited until the "block number: XXXXXX" message was printed, then opened the firewall. I tried that a couple of times, and It appears to work fine when I do that. Perhaps there's a race condition between the stratum thread and the thread that interfaces with the database?
hero member
Activity: 560
Merit: 500
I am the one who knocks
October 11, 2012, 03:45:08 PM
I would try to rebuild of the abe database from scratch. (I know, it is slow...)
See ya in 3 weeks duncant :/
legendary
Activity: 1896
Merit: 1353
October 10, 2012, 02:18:31 PM
#99
Hi all!

I've been trying to move my server uncle-enzo.info to a new/better host uncle-enzo.mit.edu, but things have gone horribly wrong.

The initial abe import went just fine. I can start the server and it prints the correct number of blocks. When I fire up my client, the server prints a flurry of "discarding tx id ..." messages followed by the typical "[] TCP
" message. After that, everything just hangs. My client gets stuck on "Connecting..." and nothing more interesting happens on the server end.

Do you have any idea what could be going on? Thank you!

I would try to rebuild of the abe database from scratch. (I know, it is slow...)
jr. member
Activity: 53
Merit: 2
October 10, 2012, 12:36:27 PM
#98
During startup, the server prints the following error message. Perhaps this has something to do with the problem I'm having?
Code:
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/share/electrum-server/processor.py", line 246, in run
    self.update()
  File "/usr/share/electrum-server/processor.py", line 260, in update
    self.send_response(internal_id, response)
  File "/usr/share/electrum-server/processor.py", line 276, in send_response
    session.send_response(response)
  File "/usr/share/electrum-server/transports/stratum_tcp.py", line 30, in send_response
    data = json.dumps(response) + "\n"
  File "/usr/lib/python2.7/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
  File "/usr/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: is not JSON serializable
jr. member
Activity: 53
Merit: 2
October 09, 2012, 10:41:12 AM
#97
Yes. Bitcoind responds to all its commands appropriately.
hero member
Activity: 938
Merit: 1000
October 09, 2012, 02:31:52 AM
#96
Can you reach Bitcoind normally? bitcoind getbalance etc. works?
jr. member
Activity: 53
Merit: 2
October 08, 2012, 08:59:54 PM
#95
Hi all!

I've been trying to move my server uncle-enzo.info to a new/better host uncle-enzo.mit.edu, but things have gone horribly wrong.

The initial abe import went just fine. I can start the server and it prints the correct number of blocks. When I fire up my client, the server prints a flurry of "discarding tx id ..." messages followed by the typical "[] TCP
" message. After that, everything just hangs. My client gets stuck on "Connecting..." and nothing more interesting happens on the server end.

Do you have any idea what could be going on? Thank you!
hero member
Activity: 938
Merit: 1000
legendary
Activity: 1386
Merit: 1097
Pages:
Jump to: