-
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
Transaction was not mined within 50 blocks, please make sure your transaction was properly send. Be aware that it might still be mined! #1102
Comments
yes, seams to be a horrible bug. |
Can this be related to Infura? I see this a lot on testnet too. |
I think I found the error. When I call a contract function and "await" the send, Found this running a private chain testing some code. Let me know if I can provide additional info. |
I have found the same problem in the main chain. Everything seems OK, but this errors just jump out. How to fix it? |
I needed to quick fix so I commented out the code in the catch for now. If I have time I will try to pull request it but this one is interesting because two different timeout ideas are clashing. From the directory where node_modules is located you can run: |
Is there anything I can do to increase the likelihood of successful subscribe? I am seeing this issue across multiple projects intermittently. |
I can take a look at it in the next few days and see about a pull request. I'm not actively using web3 on a project at the moment so it's going to take me a bit. If anyone else starts this lmk. |
Any updates on this? |
Same problem |
same problem. |
I turn to use "truffle-contract" module, it run smoothly now. Original code use web3 to deploy contract get error "ransaction was not mined within 50 blocks":
Turn to use truffle-contract runs well, I don't know why.
|
I can confirm the same issue when using version 1.0.0-beta.27 , metamask and the following code: const contract = new web3.eth.Contract(abi);
const p = contract.deploy({
data:bytecode,
arguments: params,
})
.send({
gas: gasEstimate,
gasLimit: 4000000,
from: fromAddress,
})
.catch(e=> {
console.error('deployContract error', e);
dispatch(deployError(contractName, e));
throw e;
})
.then(function(newContractInstance){
if(newContractInstance){
console.log(`${contractName} Adress`, newContractInstance.options.address);
dispatch(deployComplete(contractName, newContractInstance.options.address));
}
return newContractInstance;
}); This fails on both rinkeby and my private chain, and the failures seem random, e.g. sometimes the contract is deployed and sometimes it fails with this error. |
Yep, this is extremely annoying especially in this time of network congestion while using Infura that is taking on average 5 mins to even broadcast the transaction. @adonley have you been able to patch it locally? |
We have the same problem here on a private chain and a contract deployment with a signedTransaction and web3js. If any stable solution (not changing library code would be great :D ), please share :) |
It is my understanding that the then and confirmation PromiEvent are the components effected by this error. This for example is an implementation that may be effected:
This alternative should execute properly but is much more verbose:
|
Thank you for that. Will try it as soon as possible! |
Hi, get the same error (). I use infura and set up a raw transaction and basically try to send it with:
gives me the TxHash but
And transaction is not mined. Edit.: |
@kn1g Can you say what was your gas limit? I'm a 4 millions for now, which seems way enough for that :S |
I raised the gas limit to 160000 for a simple transaction. It seemed to work - but the error is still annoying... |
Blick limit is 4.7 millions. With more investigation, it seems like my transaction is not correct, I cannot estimate the gas cost of it. |
I also had trouble estimating it. It actually seems to work for plain transactions. But if you estimate it for a contract call it may take a LONG time or just times out. I'm using infura.io. In the end I just removed the estimate gas function and replaced it with hardcoded default values for different scenarios... :/ |
Same here, I'm able to deploy my Greeter Tutorial contract but not more. With other contract for a real token, I get different errors like that mentioned. Not sure whats the cause. |
Same here |
idem just to see the receipt it's possible to comment the code inside the catch that raise the error t/node_modules/web3-core-method/src/index.js |
Using 1.0.0-beta.27. This happens consistently but the transactions are mined normally. This error is interfering with my error handling for actual errors. Is there no update or more info on this issue? |
same here |
+1 on this. Running 1.0.0-beta.26 getting this error while using infura on Ropsten. Contracts will deploy fine, but error is thrown in promise catch. |
This issue is woven into the |
Even though this isn't broken on beta.31, I'm seeing an issue where I deploy a contract and -- even though the contract successfully deployed -- I'll get an error saying "The contract code couldn't be stored, please check your gas limit" |
Try looking at trufflesuite/truffle#476 . |
+1 Join to same issue. Why you guys don't make up it configurable? |
Same on bate.34, ropsten test net. |
Web3 is mostly not configurable beyond the provider. @CQBinh why not use a higher gasprice to be included in a block within 750 seconds on ropsten? |
@adonley I have increased the gas limit to
And the
|
Finally found out my issue, the |
The same issue here with web3@1.0.0-beta.34
I tried many options to remove but it's still there:
|
@thinhlvv when connecting to the testnet, you maybe provide the exact
|
@CQBinh Yes, I noted the chainID. I got this problem in mainnet. I ran for days, then this error appeared. |
@thinhlvv Is there the problem in the GAS limit, did you tried to increase it? |
I encountered the error While using a private chain with geth/poa/5second blocks and trying to call a smart contract function. I was using the lastest block's gasLimit as the gasLimit for the tx I was creating. The issue stems from the block's decreasing gasLimit as the block tries to approach the targetGasLimit that was used to create the chain. In my case (and mainnet), the targetGasLimit was 4,712,388 but the genesis block's gas limit was extremely higher, causing blocks to have a decreasing gas limit until it reached close to the targetGasLimit. So by using the latest Block's gasLimit, by the time my tx was sent, the new block gasLimit had decreased. For some reason this never threw a "Exceed's block gas limit" error, so the tx just sat, perpetually waiting. This was in a blockchain 101 application, very small and local app. So I would be the only one sending tx's, i didn't know how much gas would be used (estimate=infinite), so I set it to the 4.7million targetGasBlock and this seems to have fixed for now. I'm curious as to why no other error was thrown, like "Exceeds block gas limit" using 1.0.0-beta.34 |
This bug is still present in 1.0.0-beta.36, but NOT in 1.0.0-beta.34. |
@NicolaOrritos: Thanks for the tip, downgrading to 1.0.0-beta.34 worked for me (also with private chain with PoA and other contracts could be deployed though). |
@cosander glad it helped. |
@NicolaOrritos I've planned to create more specific error messages. I had a look on the winston logger but I think I will implement a simple logger class by my self and improve the messages. If it makes you wonder what I'm working on right now then check out this PR #2000 |
I encountered the same error |
Is this really resolved? I'm still getting the same error on 1.2.2 I get the error when I used Kovan testnet just now. But for local development with instant mining, the await function never returns so the page just shows the transaction as still processing. |
Guys, the problem is still happening in 1.3.5:
Only the callback 'transactionHash' is fired and the transaction, that is showed on console, is no visible on Etherscan. The weird thing is the account 0x64... has this problem, but my other account (0x58...) hasn't using the same code and also the same settings for transaction! Information:
If you need more details, please tell me. Thanks in advance! |
@oivlisnet I have the same exact issue. I was not aware it only happens on a specific account, so thanks for pointing that out. It is very strange indeed, I'm curious to know what's causing this. It only happens with web3 as I tried with ethers.js and the issue doesn't happen there. Must be some local issue maybe? |
@rellfy Hi! No, I am not using MetaMask, I am using privateKey directly in the transaction: privateKey = stripHexPrefix(privateKey) I forgot to put the contract address, but this error happens in any smart contract address for the account 0x64... if I mint something. I can't use this account since block 8408011. Thanks for the tip, I'll try the ethers.js and I'll put here if it worked or not. |
@rellfy Thanks for the tip about ethers, it worked! The code:
Now I can deploy and mint with other account. |
I still got error on sending transaction with web3 though I didn't use 'await'. Could you help me with this? My skype id is: live:.cid.41555bb2f81e56cb. Hope you can directly teach me a lesson. Best regards |
Hi, There ✋ This is already closed, but I think I found a solution in official docs. Increase (++ Also, maybe I guess we should increase |
I got this error on metamask when I was trying to solve some Ethernaut challenges. My simple fix was to cancel all the pending transactions and retry your transaction. |
web3@1.0.0-beta.22
Contract deployment with MetaMask 3.10.9: https://etherscan.io/tx/0xccec451b8a66dc3a44318cd45924893715564e7758245031ef9700acbb21d127
Transaction mining duration was approximately 2 mins and only 3 - 5 blocks were generated before it was mined.
Why does web3 think, that it was 50 blocks and it catches an error here? is this a bug?
The text was updated successfully, but these errors were encountered: