Bitcoin Core RPC "importaddress" for a P2SH watch-only I am trying to import a p2sh address as watch-only:

bitcoin-cli importaddress &lt;P2SH ADDRESS&gt; true true


for which the command seems to execute, pause, then after a few minutes give me the error message:


  error: couldn't connect to server: unknown (code -1)
      (make sure server is running and you are connecting to the correct RPC port)


Why is this not working for me?
I believe the issue is that you forgot the label parameter. According to the RPC help documentation, the parameters for importaddress should be:

 importaddress "address" "label" rescan p2sh


You have used "address", rescan and p2sh but not label, so the error is likely due to an issue converting the parameters you provided into the ones it expected. 

But the fact that the error message is so hard to understand / unrelated to the actual error is a bug, please open an issue on github here: https://github.com/bitcoin/bitcoin/issues