0

I am forking the Altcointipbot for reddit to make a tipbot for Litecoin. There has been a lot of problems that I've managed to solve, but this one I cannot seem to solve. When I try to start the script, it stops when trying to make a RPC request, giving me an error with code 500. This is the traceback:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "cointipbot.py", line 539, in __init__
    self.self_checks()
  File "cointipbot.py", line 144, in self_checks
    b.register()
  File "ctb/ctb_user.py", line 230, in register
    new_addrs[c] = self.ctb.coins[c].getnewaddr(_user=self.name.lower())
  File "ctb/ctb_coin.py", line 172, in getnewaddr
    self.conn.walletpassphrase(self.conf.walletpassphrase, 1)
  File "ctb/pifkoin/bitcoind.py", line 69, in __call__
    return server._rpc_call(self.method, *args)
  File "ctb/pifkoin/bitcoind.py", line 216, in _rpc_call
    raise BitcoindException('%d (%s) response from bitcoind' % (response.status, response.reason))
ctb.pifkoin.bitcoind.BitcoindException: 500 (Internal Server Error) response from bitcoind

My guess would be that the RPC request goes to bitcoind (litecoind), where as now you need to use bitcoin-cli for requests (at least that's how it is in the terminal). However, I cannot seem to find anything in the code that's specifying that the request goes to bitcoind and not bitcoin-cli, so maybe it takes care of that automatically? I am by no means very good at this, so I was hoping someone with more experience could help me figure it out.

The part in the code where all the RPC requests happens can be found here: https://github.com/dpifke/pifkoin/blob/master/python/bitcoind.py

The rest of the source is here, but it's probably not necessary: https://github.com/vindimy/altcointip

I've already edited the litecoin.conf to include rpcport, rpcuser, rpcpassword and server=1.

Thanks in advanced!

  • The HTTP 500 error code usually happens when bitcoind is still starting up. Can you post the full JSON response that bitcoind sends back to you when you get the 500 error? – Andrew Chow Jun 19 '17 at 15:40
  • @AndrewChow Well it's been many hours since I started it and the blockchain is already synced on bitcoin-qt. How can I confirm bitcoind is running? Here is the response body: {"result":true,"error":null,"id":1} and here is the headers: [('date', 'Mon, 19 Jun 2017 18:31:47 GMT'), ('content-length', '132'), ('content-type', 'application/json')] – user3600338 Jun 19 '17 at 18:31
  • Are you running bitcoin-qt and bitcoind at the same time? If so, it won't work as only one of bitcoind or bitcoin-qt (and only one instance of either one) can run at any given time. What do you get when you try using bitcoin-cli to interact with it? – Andrew Chow Jun 19 '17 at 18:34
  • @AndrewChow No, only bitcoind is running. All the commands is working fine with bitcoin-cli in terminal. Does that mean that bitcoind is working, or can bitcoin-cli function without it? – user3600338 Jun 19 '17 at 18:37
  • If bitcoin-cli is working, then that means that bitcoind is working. bitcoin-cli is only an interface for bitcoind and cannot work without a running bitcoind (or bitcoin-qt -server). – Andrew Chow Jun 19 '17 at 18:45
1

I found the problem. Turns out the it was actually running as it should. The reason for the error message was that the program tried to decrypt the wallet, but I never encrypted it in the first place. After encrypting it, it works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.