Skip to content

RPC sendTransaction: Known transaction #662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jorisbontje opened this issue Apr 8, 2015 · 31 comments
Closed

RPC sendTransaction: Known transaction #662

jorisbontje opened this issue Apr 8, 2015 · 31 comments

Comments

@jorisbontje
Copy link

Occasionally I am getting the error message Known transaction (hex) when calling the RPC method sendTransaction. Hard to reproduce, but easiest to make this happen is when I am playing sleth on autoplay.

My geth node (develop version 7c0a18e) is running as:

geth -mine -rpc -rpcport=8080 -unlock=primary -password=/Users/mids/.ethereum/bla --rpccorsdomain=http://localhost:8000

JSON RPC request:

{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0x468b0d4d93b7814ecc63195b1d20f96629972e16","gas":"0x30d40","value":"0x4563918244f40000","to":"0xa78cbedf8b6a932a323599a31979d95e20c5a6ba","data":"0x26638a380000000000000000000000000000000000000000000000000000000000000005"}],"id":608}

Response:

{
    "id": 608,
    "jsonrpc": "2.0",
    "error": {
        "code": -32603,
        "message": "Known transaction (3b7baba5)"
    }
}

There are no obvious warnings/errors in the geth log.

@tcoulter
Copy link

Hi Joris. I'm getting this too. An easy workaround I've found is to alter the amount of gas you want to purchase (i.e., the gas param). I'm using web3 in coffeescript, so it'd look something like this:

#!/usr/bin/env ./node_modules/.bin/coffee
web3 = require "web3"
provider = new web3.providers.HttpProvider("http://#{host}:#{port}")
provider.sendAsync
  jsonrpc: "2.0"
  method: "eth_sendTransaction"
  params: [{
    from: coinbase
    gas: web3.toHex(100000)
    gasPrice: web3.toHex(10000),
    data: "#{code}"
  }]
  id: 1
, (err, result) ->
  console.log err, result
  callback(err, result)

If I increment the gas purchase amount by 1, say web3.toHex(100001), the transaction will go through. Note I need to keep incrementing the purchase amount to continue making a successful transaction.

If you put the above in a script and alter your geth host/port, as well as adding your code to the data param, it should be easily reproducible. That said, I wouldn't be surprised if it had something to do with duplicate transactions being executed in rapid succession before they can be processed by your client (<-- a guess).

@obscuren
Copy link
Contributor

Thanks. I'm guessing the managed nonce isn't properly incremented. I'll have a look tonight

@ethers
Copy link
Member

ethers commented Apr 14, 2015

may be related to #694 (I also see I0413 13:53:46.671828 1583 transaction_pool.go:168] Known transaction (c172bcaa) )

@obscuren
Copy link
Contributor

This should be fixed in 8310bcd

@ethers
Copy link
Member

ethers commented Apr 14, 2015

On develop 8db7b23 still seeing Known transaction (hex) when calling the RPC method sendTransaction:
https://gist.github.com/ethers/458ce2d9978b55407a6e

@zelig
Copy link
Contributor

zelig commented Apr 20, 2015

@ethers can you confirm if this is still an issue

@jorisbontje
Copy link
Author

@zelig still seeing this as of 2f4cc72

@obscuren
Copy link
Contributor

Yes still an issue => #769

@ethers ethers mentioned this issue Apr 26, 2015
2 tasks
@ethers
Copy link
Member

ethers commented Apr 26, 2015

I am still seeing this issue on develop 8d09f95

@jorisbontje
Copy link
Author

@obscuren please reopen; still getting this occasionally.

@obscuren obscuren reopened this Apr 29, 2015
@arhuaco
Copy link

arhuaco commented May 15, 2015

I am still seeing this. I am testing with a simple contract that holds a counter.

mine = function() { thetest.step.sendTransaction("", {from: eth.coinbase}) }    
many = function(N) {for(var i = 0; i < N; i++) { mine(); }}
while(1) {
    var before = thetest.step();
    many(100);
    while(thetest.step() < before + 100);
}

Error response: Known transaction (b13097f5)
Invalid JSON RPC response
    at InvalidResponse (<anonymous>:-49900:-89)
    at send (<anonymous>:-94858:-89)
    at sendTransaction (<anonymous>:-87064:-89)
    at sendTransaction (<anonymous>:-76490:-89)
    at mine (<anonymous>:1:21)
    at many (<anonymous>:1:50)
    at <anonymous>:1:41

@arhuaco
Copy link

arhuaco commented May 17, 2015

Something I noticed is that the (partial) hash that I get in the error message matches a transaction that was already sent (by grepping the log file).

@fjl
Copy link
Contributor

fjl commented Jul 6, 2015

This should be resolved with #1409. If anyone has the time, please re-test.

@ethers
Copy link
Member

ethers commented Jul 9, 2015

still see this / #1238 on RC2

I0709 11:47:44.362565    4261 mergedapi.go:61] eth_sendTransaction [{"value":"0x25bf6196bd10000","gas":"0x7a120","to":"0x39dfd4315e8b90488ab57e58e4d8b4597a1511e6","data":"0x66f7e56c000000000000000000000000a0dc485fc3ade71be5e1b68397abded386c0adb7000000000000000000000000000000000000000000000000025bf6196bd10000000000000000000000000000000000000000000000000000000000e8d4a51000","from":"0xcd2a3d9f938e13cd947ec05abc7fe734df8dd826"}]
I0709 11:47:44.364493    4261 transaction_pool.go:241] (t) 6364326133643966 => 39dfd431 (0x5185a0) 571318488d169d46c84b3ba0764e905b21ce45d17a7082bc7428911c15c42bb6
I0709 11:47:44.365406    4261 types.go:105] Generated response: *shared.SuccessResponse &{%!s(float64=153) 2.0 0x571318488d169d46c84b3ba0764e905b21ce45d17a7082bc7428911c15c42bb6}
I0709 11:47:44.365463    4261 http_net.go:123] Sending payload: {
    "id": 153,
    "jsonrpc": "2.0",
    "result": "0x571318488d169d46c84b3ba0764e905b21ce45d17a7082bc7428911c15c42bb6"
}

I0709 11:47:44.697887    4261 transaction_pool.go:292] tx error: Known transaction (57131848)
I0709 11:47:44.742878    4261 transaction_pool.go:292] tx error: Known transaction (57131848)

to repro: just eth_sendTransaction with logging for transaction_pool

@jorisbontje
Copy link
Author

Haven't seen this for ages. Closing

@fastandscalable
Copy link

Just happened to me with web3 and geth v1.5.5-stable.

@himanshuoodles
Copy link

Known transaction: 9e2a172c error coming in geth v1.5.7

@squarfed
Copy link

squarfed commented Mar 2, 2017

Same here, using geth version 1.5.9. I have a small nodejs program which sends rpc transactions, specifically using the call sendTransaction, to a private geth node which runs on my machine. The program iterates many times the operation of moving ether from one account to another. Around 1% of the transactions produces the error message:

[Error: Known transaction: 09fd57d9]

@jtakalai
Copy link
Contributor

Same error, geth 1.5.9-stable-a07539fb

@asiron
Copy link

asiron commented May 2, 2017

Same error happening on 1.6.0-stable-facc47cb

roo2 added a commit to aletheia-foundation/nodejs-testnet-faucet that referenced this issue Sep 10, 2017
@fnaticwang
Copy link

fnaticwang commented Oct 19, 2017

I build a private chain, and there is still this problem:
---------------------------------------Test----------------------------------------------
this is test:
fnatic@vmnode3:~/testcontract$ curl --data '{"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0x667deaf964ee2520ac701d649bd27a013bdd7831","to":"0xa30665086f13a561dd33703e82ef4c5b8dbf91a1","data":"0x867904b4000000000000000000000000667deaf964ee2520ac701d649bd27a013bdd7831000000000000000000000000000000000000000000000000000000000000002a"}],"id":2}' 192.168.10.239:8545

{"jsonrpc":"2.0","id":2,"error":{"code":-32000,"message":"known transaction: f8236a44585005362db80b7a5f041f9fa53e6051e4b5f978a06886d4fff9d452"}}

---------------------------------------Version information----------------------------------------------
fnatic@vmnode3:~/testcontract$ geth version
Geth
Version: 1.6.7-stable
Git Commit: ab5646c
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.8.1
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.8

---------------------------------------Moreinformation----------------------------------------------
If you modify the parameters of the call function or gas number,Returns will be normal

@davux
Copy link

davux commented Feb 19, 2018

@jorisbontje Can you please reopen? The bug is still there, according to all these people.
I'm seeing it too on geth 1.7.3.

@bijlar
Copy link

bijlar commented Feb 27, 2018

I'm seeing it as well on version v1.7.3-stable-4bb3c89d.

Some more version information:

Geth
Version: 1.7.3-stable
Git Commit: 4bb3c89d44e372e6a9ab85a8be0c9345265c763a
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.9.2
Operating System: linux
GOPATH=
GOROOT=/usr/local/gov

UPDATE: It appears I was using incorrect gas values after all, changing that fixed the known transaction bug I was running into.

@flexsingit
Copy link

flexsingit commented Mar 22, 2018

Hello Everyone,

I am also seeing the same issue can anyone please help.

I am creating 4 diffrent transactions with different amounts and i am facing the issue.

Help Please.
Regards,
Himanshu

@aleczadikian
Copy link

aleczadikian commented May 26, 2018

Same thing happening to me trying to send an xact interacting with a contract. Can't find a pattern. I retry the same thing until it works.

Edit: Issue is incorrect nonce due to a pending transaction. It's most likely not a bug but part of how Ethereum works, though features could be added to help with it. See #2880

jpeletier pushed a commit to epiclabs-io/go-ethereum that referenced this issue Jun 8, 2018
…ctor

swarm/pss: Rename "self" receivers to reflect better their identity
@folex
Copy link

folex commented Jun 15, 2018

Still happening on Geth/v1.8.7 with web3j 3.4.0

@holitn-spec
Copy link

Still happening on Geth/v1.8.12-stable with jsonrpc {"code":-32000,"message":"known transaction: *******"}}

@EBGToo
Copy link

EBGToo commented Sep 6, 2018

Still happening on Geth/v1.8.14

@halink0803
Copy link

I just got this error on Geth/v1.8.27. Does anyone know how to fix this?

@rite2bala
Copy link

I got this error .. any fixes?

@fnaticwang
Copy link

I got this error .. any fixes?

Maybe you set the same nonce value,this results in a duplicate hash being generateds, and you need to set the incremental nonce

ngtuna added a commit to ngtuna/tomochain that referenced this issue Sep 3, 2019
…for-canonical-chain-only

Applying TxMatches for canonical chain only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests