<p>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.</p>

CC BY-SA 3.0
2017-06-20T16:42:11.443Z
2017-06-20T16:42:11.443Z
user3600338
<p>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:</p>

<pre><code>Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
  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
</code></pre>

<p>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.</p>

<p>The part in the code where all the RPC requests happens can be found here: <a href="https://github.com/dpifke/pifkoin/blob/master/python/bitcoind.py" rel="nofollow noreferrer">https://github.com/dpifke/pifkoin/blob/master/python/bitcoind.py</a></p>

<p>The rest of the source is here, but it's probably not necessary: <a href="https://github.com/vindimy/altcointip" rel="nofollow noreferrer">https://github.com/vindimy/altcointip</a></p>

<p>I've already edited the <code>litecoin.conf</code> to include <code>rpcport</code>, <code>rpcuser</code>, <code>rpcpassword</code> and <code>server=1</code>.</p>

<p>Thanks in advanced!</p>

CC BY-SA 3.0
2017-06-19T15:40:35.477Z
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?
Ava Chow
CC BY-SA 3.0
2017-06-19T18:31:03.377Z
@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
CC BY-SA 3.0
2017-06-19T18:34:23.453Z
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?
Ava Chow
CC BY-SA 3.0
2017-06-19T18:37:55.410Z
@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
CC BY-SA 3.0
2017-06-19T18:45:10.237Z
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).
Ava Chow
<bitcoind><client><json-rpc>
Run RPC request against
user3600338
# Run RPC request against

(Asked by: username_0 on 2017-06-19)

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!

**Tags:** bitcoind, client, json-rpc

> **Comments:**
> **username_1**: 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?  
> **username_0**: @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')]  
> **username_1**: 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?  
> **username_0**: @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?  
> **username_1**: 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).  

---

## 1 answers

### Answer by username_0 on 2017-06-20. Score: 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.


---

