Forgetting to include the redeemscript when invoking signrawtransactionwithkey used to give a useful error:
$ bitcoin-cli -regtest signrawtransactionwithkey "02000000018a24833c36be23272080d6be8a53e36586b81e0ac447e1298ee58e18cc96bdee0100000000ffffffff0118246bee0000000017a914e139e3904e9e69ecbce87b0fcfb73b1b0e3b9e818700000000" '["cUJ7bUweEgENv4ixezsSyZa2uBJxR37iFLtCt18gSvkjpkj7CmMr"]' '[{"txid":"eebd96cc188ee58e29e147c40a1eb88665e3538abed680202723be363c83248a","vout":1,"scriptPubKey":"0020f89f2138a58a2042310f297259ca8050bcaecd3a0f3c936edffb7e38e31d775a","amount":"40.00000000"}]'
With 0.17:
error code: -3
error message:
Missing redeemScript
With master/0.18:
{
"hex": "02000000018a24833c36be23272080d6be8a53e36586b81e0ac447e1298ee58e18cc96bdee0100000000ffffffff0118246bee0000000017a914e139e3904e9e69ecbce87b0fcfb73b1b0e3b9e818700000000",
"complete": false,
"errors": [
{
"txid": "eebd96cc188ee58e29e147c40a1eb88665e3538abed680202723be363c83248a",
"vout": 1,
"witness": [
],
"scriptSig": "",
"sequence": 4294967295,
"error": "Witness program was passed an empty witness"
}
]
}