-
Notifications
You must be signed in to change notification settings - Fork 5k
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
web3.js v1.0.0-beta.30 send() - Error: Failed to check for transaction receipt: #1423
Comments
I have the same error while deploying a contract, using the same version of web3.
This returns:
Checking in a block explorer, I can see the contract was successfully deployed. Unfortunately I can't receive the address of the contract since the promise gets interrupt due to the (wrong?) error. Does anyone know a solution or a workaround to receive the contract address? |
👍 |
@CodingJonas not sure if you're using ropsten as well (I am using a private net on geth), but the contract address should be showing in your geth console. There needs to be a way to grab this value on the front end, as I am successfully getting the transaction hash. Not sure why receipt or receipt.contractAddress isn't working. it looks like you are missing the .on('confirmation') check, but it is not working for me. I have this: Re: comment in your code: This is how I get gas price using promises: |
Hi, I have the same error and I fix it by #1735 |
Is this fixed? I am not getting a confirmation callback when deploying my contract. |
I updated to beta 37 and it seems to work now 👯♀️ |
I'm seeing this in 1.2.1.
The second command was issues a few seconds after the first one. I'd guess that web3.js makes an assumption (e.g. that the receipt is available once the tx hash is known?) which doesn't always hold. Unfortunately I didn't find a way to make it reproducible. |
A bit more detail, maybe it helps...
So, here the receipt was unavailable because ... ancient block sync is still in progress. This didn't eliminate the issue, but changed the error message:
... which leads to openethereum/parity-ethereum#10550 So, the Parity folks seem to be believe that the current behaviour is correct. What I found interesting was that in both cases web3.js seemed to retry the Then I discovered and tried another cmdline option of parity:
The difference here seems to be that with that return value, web3.js keeps retrying until there's a receipt. I don't know what should be done here. |
@d10r That's the best..thanks so much for figuring all that out.
Agree this is not ideal. In Parity 10550, their engineer says:
@d10r Is your understanding of the above that this primarily affects people running full Parity mining nodes, e.g it's not something that impacts someone connecting to Kovan over Infura for example? |
That's a good question. Depends if that's specific to the "node signs transaction" use case (which is becoming less relevant and already flagged as being phased out in Parity) or not. I didn't try that yet. |
@d10r I will test and fix it on our side asap. It can happen that a transaction is already mined but the receipt is not stored in the DB of the connected node. web3.js should poll for the receipt until it is existing. web3.js will exceed the timeout after 750s over an HTTP connection and over a WebSocket connection after 50 blocks. These two values are configurable in the coming release of web3.js (1.2.2). |
@nivida how do you intend to fix it? Hopefully over at Parity somebody will comment. |
I have the same problem as @d10r. It happens only with parity, works with geth. |
my version is 1.0.0-beta.30
my program is the follow code.
`
fs = require('fs');
var net = require('net');
var Web3 = require('web3');
var web3 = new Web3('/Users/neo/Library/Ethereum/geth.ipc', net); // to connect roosten network
console.log(web3.version)
const abi = fs.readFileSync('output/TokenERC20.abi', 'utf-8');
const contractAddress = "0x70682386d0dE84B1e549DC3c4305CCB2D261b2a8";
const coinbase = "0xB94054c174995AE2A9E7fcf6c7924635FBa8ECF7";
const toAddress = "0xf56b81a2bcb964D2806071e9Be4289A5559BB0fA";
balanceWei = web3.eth.getBalance(coinbase);
console.log(balanceWei);
const contract = new web3.eth.Contract(JSON.parse(abi), contractAddress, { from: coinbase , gas: 100000});
web3.eth.personal.unlockAccount(coinbase, "netkiller").then(function(result){
console.log(result)
contract.methods.balanceOf(coinbase).call().then(console.log).catch(console.error);
contract.methods.balanceOf(toAddress).call().then(console.log).catch(console.error);
});
contract.methods.transfer(toAddress, 10000).send().then(function(receipt){
console.log(receipt);
}).catch(console.error);
contract.methods.balanceOf(coinbase).call().then(console.log).catch(console.error);
contract.methods.balanceOf(toAddress).call().then(console.log).catch(console.error);
`
when I execute send() " Error: Failed to check for transaction receipt: "
`
The text was updated successfully, but these errors were encountered: