-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Error: Failed to subscribe to new newBlockHeaders to confirm the transaction receipts. #951
Comments
Thank you for trying to help, but issues like this are pretty difficult. if you tell me exactly what you call, and the exact error you get, ideally with some digging yourself will help me fix these issues faster. |
Basically, I call a payable function on my contract and the error shows in the browser. Using the callback examples for call and send: http://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#id12 |
This sounds like the same problem I'm seeing. Normal method.XXX(...).send works, but when the method is payable the transaction fails to be seen as having been mined. The actual transaction does go through, somehow Web3 just misses it. Error: Transaction was not mined within 50 blocks, please make sure your transaction was properly send. Be aware that it might still be mined! |
Hi, I'm seeing this as well in a test environment. Let me see if I can add more useful context and make it reproducible for you. My quick and nasty demo code is here. It sets up a cpp-ethereum instance with a new genesis block and accounts, and then just tries to send a transaction (Eth transfer). I'm also extending the web3.js api using the web3.extend() method to add a couple of test methods provided by
When running against
When running against
I've used this web3.js version extensively with |
We use this before sending th tx: if (_.isBoolean(this._method.payable) && !this._method.payable && args.options.value && args.options.value > 0) {
return utils._fireError(new Error('Can not send value to non-payable contract method or constructor'), defer.eventEmitter, defer.reject, args.callback);
} might be that you don't send any values? |
Can you please re-test with beta.16 (or higher)? |
Error still happens on beta.20. |
Just for reproduceing purpose: I am getting almost the same error:
When i use the TestRPC everything work's fine. But if i switch to |
infura doesn't allow |
I get the " Failed to subscribe to new newBlockHeaders to confirm the transaction receipts" on a send transaction method on |
Are you connecting to infura using websockets? Http doesn’t support subscriptions |
My app try to create a contract, but also failed with error "Error: Transaction was not mined within 50 blocks, please make sure your transaction was properly send. Be aware that it might still be mined!", I use private network.
|
Looks like this problem is pretty fresh. I join the community. let transaction = {
to: caddress,
gasPrice: gasPriceHex,
gasLimit: gasLimitHex,
data: '0x',
from: web3.eth.defaultAccount,
nonce: nonce,
value: '0x0'
}
let tx = new Tx(transaction);
tx.sign(hexedPrivateKey);
let stx = tx.serialize().toString('hex');
web3.eth.sendSignedTransaction('0x' + stx)
.on('reciept', (rec) => {
console.log(rec);
}); As @adonley mentioned, and others voted up, here is a quick fix: |
After poking around, I finally did first transaction like this. I am still unsure, if it is fixed, but I will investigate further to find our how to make it stable, until we get a better solution. |
is this have any result? |
add |
You mean In any case, |
@frozeman when you say "Are you connecting to infura using websockets? Http doesn’t support subscriptions", are you referring strictly to third party services that use load balancers? Http subscriptions are working with my personal eth clients. |
It does look like a problem of the node configuration and not a problem of web3. Please drop a comment if I should reopen this issue. |
Seeing this issue intermittedly on both metamask and portis when calling payable and non payable methods and using
Responds immediately with:
I am using Kovan network for testnet. I cannot reproduce on local blockchain. |
@klivin we've added support to promiEvents on Portis, so it should work fine now. Update your SDK to 1.2.14 to see it in action 😃 |
This issue happens when invoking methods.myMethod.send types. Happens using the callback and event emitter. Runnin web3-1.0.0.11
The text was updated successfully, but these errors were encountered: