user21183: I am trying to send a bitcoin raw transaction, but always got such an error. what's the possible explaination?
bitcoind --testnet sendrawtransaction 0100000002e37a176c220cf64898c312b779809b99c9b07434cf042dabfcdf453c74aaad09000000006a4730440220599b5552dd9303be0debe11f412f5b5a5b52ca020f8faaaa92817271bf18171a022002005cbe58bfbf8dd4a29eb1f0b308712b6802e836e9de6cfcd01c32e9834179012102cadce66cbb9e122f8db373abfc423982441e88d47dbb8f14fc8b5710fdf22d75ffffffff49befc70e138e058f439169b09de1b348679ed9ef8f55edf8723cda796aa3550030000006a47304402202887361ad10fae365906a2649f9616e1e7145ca4232c39b089d342c88008eb3e02203bae3545b790da8b32ffb329a694021f7874e0da43a626341a9150dc3929e2a2012102920452c1e0c6ff79c130256f7055f3481a573f79492aad5908179063c64be413ffffffff0410270000000000001976a91437a2ad56240efac4f5950b37aaac61e017d7cbf688ac0000000000000000276a2542435001033bbddf5860f3a0f9364c0066fde591bea3ecea952e73fea619e360df80afa24d10270000000000001976a914c24296a228aaa9470908cee737bed9db5ddb193388acb9e2b001000000001976a914355cae450b5e899dded1c01df10693cdb3ad86d688ac00000000
error: {"code":-25,"message":""}

The transaction looks like this when decoded:
{
    "txid" : "c6a8bb034ca48abe2618b6fb0f9f2c518370ee34bf88a5287be0de40a262e1b2",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "71a063c7b0b6d0bae367043a6ce25205f9d5571f1f97b245515e7b25c7ee9bef",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "3045022100e3c9147c6f801436a1880abd4b2c864fff9b405b3225ee7e274acf036515246a02207d3c816b1938954bb23b8d27a884777f871164f250f85e4fe67b3bc59d4903c101 029e324730c89a254f0d8b2b0d716325d6e7e35a045a30d602d576212453e92090",
                "hex" : "483045022100e3c9147c6f801436a1880abd4b2c864fff9b405b3225ee7e274acf036515246a02207d3c816b1938954bb23b8d27a884777f871164f250f85e4fe67b3bc59d4903c10121029e324730c89a254f0d8b2b0d716325d6e7e35a045a30d602d576212453e92090"
            },
            "sequence" : 4294967295
        },
        {
            "txid" : "4274f297a12c1e58ae7f878224e31b733fd817559cb3bf0f9ddbaf1aa1a15101",
            "vout" : 3,
            "scriptSig" : {
                "asm" : "3044022031dd44df55f376581cc7c51c9dad5784cabf799bc384cc895e48708332e7f15402204f4a23afed393409af596034cc78dc92fe7bc887ced4df70758c99e3def9bdc101 03bfefa3db6c30063e6df10262909e8841e72631e506bc4e674a1d5fd7ad9458b4",
                "hex" : "473044022031dd44df55f376581cc7c51c9dad5784cabf799bc384cc895e48708332e7f15402204f4a23afed393409af596034cc78dc92fe7bc887ced4df70758c99e3def9bdc1012103bfefa3db6c30063e6df10262909e8841e72631e506bc4e674a1d5fd7ad9458b4"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.00010000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 7d9c76fdb9889d0316ecea5fb6a49efd5bfb91a4 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9147d9c76fdb9889d0316ecea5fb6a49efd5bfb91a488ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mry8CQ4H8xnYEafH2awKhh6sXogu3DHoL1"
                ]
            }
        },
        {
            "value" : 0.00000000,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_RETURN 4243500102dbee2551bb9f567934a35dfd12cc8a16cfe25476a366b14b26147bb17eaebe82",
                "hex" : "6a254243500102dbee2551bb9f567934a35dfd12cc8a16cfe25476a366b14b26147bb17eaebe82",
                "type" : "nulldata"
            }
        },
        {
            "value" : 0.00010000,
            "n" : 2,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 a7373b9c82d4490450ae5fb18ef6e68b5f1ba414 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914a7373b9c82d4490450ae5fb18ef6e68b5f1ba41488ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mvm7JjdkMAqYt2b8VrJifnveHo3XWfLRBR"
                ]
            }
        },
        {
            "value" : 0.27969593,
            "n" : 3,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 ccc6d502c38ec401a4203d0205adb49ea13e0794 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914ccc6d502c38ec401a4203d0205adb49ea13e079488ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mzBiLHKBSLNfJ1YHemSnBL2hf8MmuuV5Am"
                ]
            }
        }
    ]
}

Here is my debug.log:
2014-12-28 15:58:21 UpdateTip: new best=0000000000000000105ce47aa2a182737da73cdc61f180bdbb2c8b7268ed2170  height=336335  log2_work=81.862093  tx=55205709  date=2014-12-28 15:55:21 progress=0.999995
2014-12-28 15:58:21 ProcessBlock: ACCEPTED
2014-12-28 15:58:35 connect() to 162.210.198.184:8333 failed after select(): Connection refused (61)
2014-12-28 15:58:42 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 15:58:48 ERROR: AcceptToMemoryPool : nonstandard transaction: dust
2014-12-28 15:58:48 ERROR: AcceptToMemoryPool : nonstandard transaction: dust
2014-12-28 15:58:48 ERROR: AcceptToMemoryPool : nonstandard transaction: dust
2014-12-28 15:58:48 connect() to 212.197.133.191:8333 failed after select(): Connection refused (61)
2014-12-28 15:59:25 connect() to 60.240.240.47:8333 failed after select(): Connection refused (61)
2014-12-28 15:59:35 receive version message: /Satoshi:0.9.3/: version 70002, blocks=216962, us=129.31.191.110:64893, them=82.9.60.209:8333, peer=82.9.60.209:8333
2014-12-28 15:59:35 Added time data, samples 20, offset -4 (+0 minutes)
2014-12-28 16:10:17 UpdateTip: new best=000000000000000011d9558507a7782247af10b62ebec6b56f27560b0f4b7a61  height=336336  log2_work=81.862149  tx=55206550  date=2014-12-28 16:10:18 progress=1.000000
2014-12-28 16:10:17 ProcessBlock: ACCEPTED
2014-12-28 16:10:28 ResendWalletTransactions()
2014-12-28 16:10:41 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 16:10:41 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 16:12:43 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 16:13:41 UpdateTip: new best=00000000000000001515448348af74726a44d0ab972ecc543444f506bd48dea0  height=336337  log2_work=81.862205  tx=55206582  date=2014-12-28 16:25:03 progress=1.000018
2014-12-28 16:13:41 ProcessBlock: ACCEPTED
2014-12-28 16:14:45 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 16:16:50 Requesting shutdown

I am using bitcoind on a Mac, working on the testnet, so I am not sure if $HOME/Library/Application\ Support/Bitcoin/debug.log is appropriate to my situation.

user23158: You get that obscure RPC error when your tx is using outputs that bitcoind never heard of.
For txs coming from the p2p network, there is an "orphan" mechanism, where bitcoind will wait for those missing outputs.
RPC txs are apparently expected to come in the right order.
As @GK pointed, a pull request is availbale at https://github.com/bitcoin/bitcoin/pull/5418 

21183: <p>I am trying to send a bitcoin raw transaction, but always got such an error. what's the possible explaination?</p>

<pre><code>bitcoind --testnet sendrawtransaction 0100000002e37a176c220cf64898c312b779809b99c9b07434cf042dabfcdf453c74aaad09000000006a4730440220599b5552dd9303be0debe11f412f5b5a5b52ca020f8faaaa92817271bf18171a022002005cbe58bfbf8dd4a29eb1f0b308712b6802e836e9de6cfcd01c32e9834179012102cadce66cbb9e122f8db373abfc423982441e88d47dbb8f14fc8b5710fdf22d75ffffffff49befc70e138e058f439169b09de1b348679ed9ef8f55edf8723cda796aa3550030000006a47304402202887361ad10fae365906a2649f9616e1e7145ca4232c39b089d342c88008eb3e02203bae3545b790da8b32ffb329a694021f7874e0da43a626341a9150dc3929e2a2012102920452c1e0c6ff79c130256f7055f3481a573f79492aad5908179063c64be413ffffffff0410270000000000001976a91437a2ad56240efac4f5950b37aaac61e017d7cbf688ac0000000000000000276a2542435001033bbddf5860f3a0f9364c0066fde591bea3ecea952e73fea619e360df80afa24d10270000000000001976a914c24296a228aaa9470908cee737bed9db5ddb193388acb9e2b001000000001976a914355cae450b5e899dded1c01df10693cdb3ad86d688ac00000000
error: {"code":-25,"message":""}
</code></pre>

<p>The transaction looks like this when decoded:</p>

<pre><code>{
    "txid" : "c6a8bb034ca48abe2618b6fb0f9f2c518370ee34bf88a5287be0de40a262e1b2",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "71a063c7b0b6d0bae367043a6ce25205f9d5571f1f97b245515e7b25c7ee9bef",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "3045022100e3c9147c6f801436a1880abd4b2c864fff9b405b3225ee7e274acf036515246a02207d3c816b1938954bb23b8d27a884777f871164f250f85e4fe67b3bc59d4903c101 029e324730c89a254f0d8b2b0d716325d6e7e35a045a30d602d576212453e92090",
                "hex" : "483045022100e3c9147c6f801436a1880abd4b2c864fff9b405b3225ee7e274acf036515246a02207d3c816b1938954bb23b8d27a884777f871164f250f85e4fe67b3bc59d4903c10121029e324730c89a254f0d8b2b0d716325d6e7e35a045a30d602d576212453e92090"
            },
            "sequence" : 4294967295
        },
        {
            "txid" : "4274f297a12c1e58ae7f878224e31b733fd817559cb3bf0f9ddbaf1aa1a15101",
            "vout" : 3,
            "scriptSig" : {
                "asm" : "3044022031dd44df55f376581cc7c51c9dad5784cabf799bc384cc895e48708332e7f15402204f4a23afed393409af596034cc78dc92fe7bc887ced4df70758c99e3def9bdc101 03bfefa3db6c30063e6df10262909e8841e72631e506bc4e674a1d5fd7ad9458b4",
                "hex" : "473044022031dd44df55f376581cc7c51c9dad5784cabf799bc384cc895e48708332e7f15402204f4a23afed393409af596034cc78dc92fe7bc887ced4df70758c99e3def9bdc1012103bfefa3db6c30063e6df10262909e8841e72631e506bc4e674a1d5fd7ad9458b4"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.00010000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 7d9c76fdb9889d0316ecea5fb6a49efd5bfb91a4 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9147d9c76fdb9889d0316ecea5fb6a49efd5bfb91a488ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mry8CQ4H8xnYEafH2awKhh6sXogu3DHoL1"
                ]
            }
        },
        {
            "value" : 0.00000000,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_RETURN 4243500102dbee2551bb9f567934a35dfd12cc8a16cfe25476a366b14b26147bb17eaebe82",
                "hex" : "6a254243500102dbee2551bb9f567934a35dfd12cc8a16cfe25476a366b14b26147bb17eaebe82",
                "type" : "nulldata"
            }
        },
        {
            "value" : 0.00010000,
            "n" : 2,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 a7373b9c82d4490450ae5fb18ef6e68b5f1ba414 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914a7373b9c82d4490450ae5fb18ef6e68b5f1ba41488ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mvm7JjdkMAqYt2b8VrJifnveHo3XWfLRBR"
                ]
            }
        },
        {
            "value" : 0.27969593,
            "n" : 3,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 ccc6d502c38ec401a4203d0205adb49ea13e0794 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914ccc6d502c38ec401a4203d0205adb49ea13e079488ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mzBiLHKBSLNfJ1YHemSnBL2hf8MmuuV5Am"
                ]
            }
        }
    ]
}
</code></pre>

<p>Here is my debug.log:</p>

<pre><code>2014-12-28 15:58:21 UpdateTip: new best=0000000000000000105ce47aa2a182737da73cdc61f180bdbb2c8b7268ed2170  height=336335  log2_work=81.862093  tx=55205709  date=2014-12-28 15:55:21 progress=0.999995
2014-12-28 15:58:21 ProcessBlock: ACCEPTED
2014-12-28 15:58:35 connect() to 162.210.198.184:8333 failed after select(): Connection refused (61)
2014-12-28 15:58:42 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 15:58:48 ERROR: AcceptToMemoryPool : nonstandard transaction: dust
2014-12-28 15:58:48 ERROR: AcceptToMemoryPool : nonstandard transaction: dust
2014-12-28 15:58:48 ERROR: AcceptToMemoryPool : nonstandard transaction: dust
2014-12-28 15:58:48 connect() to 212.197.133.191:8333 failed after select(): Connection refused (61)
2014-12-28 15:59:25 connect() to 60.240.240.47:8333 failed after select(): Connection refused (61)
2014-12-28 15:59:35 receive version message: /Satoshi:0.9.3/: version 70002, blocks=216962, us=129.31.191.110:64893, them=82.9.60.209:8333, peer=82.9.60.209:8333
2014-12-28 15:59:35 Added time data, samples 20, offset -4 (+0 minutes)
2014-12-28 16:10:17 UpdateTip: new best=000000000000000011d9558507a7782247af10b62ebec6b56f27560b0f4b7a61  height=336336  log2_work=81.862149  tx=55206550  date=2014-12-28 16:10:18 progress=1.000000
2014-12-28 16:10:17 ProcessBlock: ACCEPTED
2014-12-28 16:10:28 ResendWalletTransactions()
2014-12-28 16:10:41 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 16:10:41 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 16:12:43 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 16:13:41 UpdateTip: new best=00000000000000001515448348af74726a44d0ab972ecc543444f506bd48dea0  height=336337  log2_work=81.862205  tx=55206582  date=2014-12-28 16:25:03 progress=1.000018
2014-12-28 16:13:41 ProcessBlock: ACCEPTED
2014-12-28 16:14:45 ERROR: AcceptToMemoryPool : inputs already spent
2014-12-28 16:16:50 Requesting shutdown
</code></pre>

<p>I am using bitcoind on a Mac, working on the testnet, so I am not sure if $HOME/Library/Application\ Support/Bitcoin/debug.log is appropriate to my situation.</p>
 23158: <p>You get that obscure RPC error when your tx is using outputs that <code>bitcoind</code> never heard of.</p>

<p>For txs coming from the p2p network, there is an "orphan" mechanism, where <code>bitcoind</code> will wait for those missing outputs.</p>

<p>RPC txs are apparently expected to come in the right order.</p>

<p>As @GK pointed, a pull request is availbale at <a href="https://github.com/bitcoin/bitcoin/pull/5418" rel="nofollow">https://github.com/bitcoin/bitcoin/pull/5418</a> </p>
