Closed nonsenseless closed 5 years ago
2_deploy_contracts.js
is the same as 1_initial_migration.js
4.0.1
8.9.1 LTS
or 9.1.0 Current
Aside from these we have experienced the same error message when trying to deploy to Rinkeby last week through a local geth
node.
I suspect that the issue is the connectivity of that local node.
It usually only had 2-3 peers available, in which case the transaction won't be mined any time soon because it can't spread far enough into the network.
We had successful deployments with the same setup if there were 5-6 peers present, which we had to wait for 20-40 minutes to happen after starting the geth
process.
To mitigate connectivity issues, we also tried to go through Infura. It's a great option at the cost of a little extra complexity: You have to provide some key management logic yourself, since Infura won't take on that responsibility.
You can find some older stackoverflow articles on how to do this, but they are slightly incomplete. For a working example, have a look at the current official Truffle documentation: http://truffleframework.com/docs/advanced/configuration#accessing-only-one-of-multiple-network-providers and make sure you wrap your HDWalletProvider construction into a function!
(You might also need to sign up to Infura and append the Access Token you get to their base URL; although it seems to work without it too, but I guess only for a limited time) (You need a mnemonic too, which you can easily get just by starting TestRPC or creating a MetaMask "Den")
We also noticed that the timeout error about the 50 blocks is thrown a lot earlier than the time required to mine 50 blocks, so this issue might be a combination of multiple bugs.
@onetom
I'm going to have to work through the rest of the comments and see how they impact things, but at the outset they definitely seem to offer some insight into what might be going on and how to address it, so thank you!
In one test late last night I modified the config file to reduce the gas limit by an order of magnitude and, for the first time, both of my conracts deployed to the chain and I was able to trigger a successful test of the contract...though the transactions appeared to time out on the CLI and only showed up on the chain a few hours later which suggests it's related to the issues you noted.
I'll update this thread with more information as I test these suggestions in case that proves helpful for others.
@nonsenseless @onetom Thanks for reporting. Truffle had a bug that accidentally limited the wait time to 4 minutes. It's fixed in the latest release.
Unfortunately, while looking into this issue, it's been discovered that that web3
has it's own hardcoded wait limit: 50 blocks. (Code here).
For the moment anyway, to be mined via web3
(which Truffle uses), you'll have to set your deployment gas price high enough to get picked up within 50 blocks.
Leaving this open until it's possible to configure deployments waits somehow.
NB: Possible workaround to this in an issue comment here at web3
. Author is using web3 1.0
and intercepts the 50 block error via the once
event emitter, then continues to poll for the transaction receipt themselves. (This suggests the problem persists in latest web3
.)
If truffle took this approach it would need to replicate web3's behavior following resolution of the contract address here before returning the instance.
Having the same issue in Kovan while Kovan through parity is synched properly with 15 peers:
Running migration: 1_initial_migration.js
Deploying Migrations...
... 0x262146f9cb1468ce1de28773d32e7779a6ef27eb9af5c2feff1e38740c5cb210
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Contract transaction couldn't be found after 50 blocks
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:328377:30
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:64331:21
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:64330:32
at Array.forEach (<anonymous>)
at Object.onMessage [as callback] (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:64328:22)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:330526:20
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:330525:12
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:176198:11
Even the Migration
contract is not able to be deployed. Using:
Truffle v4.0.5 (core: 4.0.5)
Solidity v0.4.18 (solc-js)
EDIT:
Resolved by adding --jsonrpc-apis web3,eth,net,personal,parity,parity_set,traces,rpc,parity_accounts
to the parity call.
@propercoil i added the --jsonrpc-apis as you've said but it still doesn't work. i still get the "contract transaction couldn't be found after 50 blocks" error. is there anything else i could do to get it working properly?
@DeepakSuryaS
Add whole string --jsonrpc-apis web3,eth,net,personal,parity,parity_set,traces,rpc,parity_accounts to the parity call .
Thanks @propercoil - worked ! :)
I deployed to kovan about 5 days ago. Today I resynced my network - compared to the Kovan Blockexplorer and it showed I was synced.
I had no problem deploying with parity using
alias parity="~/parity/target/release/parity --chain=kovan"
parity version Parity/v1.10.0-unstable-bc8216a82-20180128/x86_64-macos/rustc1.23.0
I'm on
~/truffle version
Truffle v4.0.4 (core: 4.0.4)
Solidity v0.4.18 (solc-js)
truffle migrate --network=kovan
Using network 'kovan'.
Running migration: 2_deploy_contracts.js
Deploying Story...
... 0xd88cc3655cae77efbabc804733051d62424e1338a315b7dfbf52690aa4fe76e0
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Contract transaction couldn't be found after 50 blocks
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:327560:30
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:64332:21
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:64331:32
at Array.forEach (<anonymous>)
at Object.onMessage [as callback] (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:64329:22)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:329703:20
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:329702:12
at /usr/local/lib/node_modules/truffle/build/cli.bundled.js:176186:11
I just upgraded to 4.0.6
truffle and tried running parity with
parity --chain=kovan --jsonrpc-apis web3,eth,net,personal,parity,parity_set,traces,rpc,parity_accounts
and it went through.
Hi @quantumproducer,
try to run command for migration --> truffle migrate --network=kovan reset
I am having this issue now on the main network.
Here's my truffle migrate --network=live --verbose-rpc
log:
> "jsonrpc": "2.0",
> "id": 5,
> "method": "eth_sendTransaction",
> "params": [
> {
> "from": "0xa281cd2ba15dc43f8110ddaee837274800931f7e",
> "gas": "0x3d0900",
> "gasPrice": "0x218711a00",
> "data": "0x6060604052341561000f57600080fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506102db8061005e6000396000f300606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630900f01014610067578063445df0ac146100a05780638da5cb5b146100c9578063fdacd5761461011e575b600080fd5b341561007257600080fd5b61009e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610141565b005b34156100ab57600080fd5b6100b3610224565b6040518082815260200191505060405180910390f35b34156100d457600080fd5b6100dc61022a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561012957600080fd5b61013f600480803590602001909190505061024f565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610220578190508073ffffffffffffffffffffffffffffffffffffffff1663fdacd5766001546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561020b57600080fd5b6102c65a03f1151561021c57600080fd5b5050505b5050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102ac57806001819055505b505600a165627a7a72305820d665cc9568c7a7748b83ea660894eb49b5ca37bea613615823cc9fdd35ac51260029"
> }
> ]
> }
< {
< "jsonrpc": "2.0",
< "id": 5,
< "result": "0x4afc5333a0c12c03b5d0866e819a909ed5fa37f94d583824f14d4d97f8ec0272"
< }
... 0x4afc5333a0c12c03b5d0866e819a909ed5fa37f94d583824f14d4d97f8ec0272
> {
module.exports = {
solc: {
optimizer: {
enabled: true,
runs: 2000
}
},
// See <http://truffleframework.com/docs/advanced/configuration>
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*", // Match any network id
from: "0xa281cd2ba15dc43f8110ddaee837274800931f7e",
gas: 5000
},
live: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
from: "0xa281cd2ba15dc43f8110ddaee837274800931f7e",
gasPrice: 9000000000,
gas: 4000000
},
kovan: {
network_id: 42,
host: "127.0.0.1",
port: 8545,
from: "0x33dbe8478805cf734184aeD8737607656252D804",
gas: 5000000
}
}
};
"Contract couldn't be found after 50 blocks"
Why? I'm offering 9 GWEI for gas. Why does this happen?
I've tried without the optimizer, too. geth
is 1.8.2
Truffle v4.0.6 (core: 4.0.6)
Solidity v0.4.19 (solc-js)
I'm unable to deploy my smart contract while this is happening.
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Contract transaction couldn't be found after 50 blocks
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/contract.js:112:1
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:128:1
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:127:1
at Array.forEach (<anonymous>)
at Object.onMessage [as callback] (/usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:125:1)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:259:1
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:258:10
at /usr/local/lib/node_modules/truffle/build/webpack:/~/truffle-migrate/index.js:225:1
Hi, Has anyone able to solve this yet. I tried all above mentioned comments but I'm still facing the same issue.
I'm running below mentioned command to run the ethereum node
geth --rinkeby --syncmode "fast" --rpc --rpcapi db,eth,net,web3,personal --cache=1024 --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "*"
My environment is
Geth Version: 1.8.11-stable Truffle v4.1.13 (core: 4.1.13) Solidity v0.4.24 (solc-js) node version: v7.8.0 npm version: v4.2.0
truffle.js
module.exports = {
networks: {
development: {
host: '127.0.0.1',
port: 8545,
network_id: '*', // Match any network id
gas: 4712388
},
ropsten: {
host: 'localhost',
port: 8545,
gas: 6700000,
network_id: '3' // Match any network id
},
kovan: {
host: 'localhost',
port: 8545,
gas: 6700000,
network_id: '5' // Match any network id
},
mocha: {
enableTimeouts: false
}
}
}
When I run truffle migrate --reset
it shows below error
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Contract transaction couldn't be found after 50 blocks
See the full error message below
Running migration: 1_initial_migration.js
Deploying Migrations...
... 0x4bad5e37538025f35e48eb95d7448a910c2c9b5e7c822e9c5fd310446219f62a
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Contract transaction couldn't be found after 50 blocks
at /home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/contract.js:112:1
at /home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:128:1
at Array.forEach (native)
at /home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:127:1
at Array.forEach (native)
at Object.onMessage [as callback] (/home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/filter.js:125:1)
at /home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:259:1
at Array.forEach (native)
at /home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:258:10
at /home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/packages/truffle-migrate/index.js:225:1
at /home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
at XMLHttpRequest.request.onreadystatechange (/home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
at XMLHttpRequestEventTarget.dispatchEvent (/home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
at XMLHttpRequest._setReadyState (/home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
at XMLHttpRequest._onHttpResponseEnd (/home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
at IncomingMessage.<anonymous> (/home/faizan/.nvm/versions/node/v7.8.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:188:7)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickDomainCallback (internal/process/next_tick.js:128:9)
@faizanahmad055 This is a chronic problem everyone is facing using web3
given current network conditions. The only known solution is to increase the gasPrice
of the transaction to make it more attractive for miners to pick up, or to wait for periods of low network congestion to deploy.
The error is a hard-coded limit in web3 whose intent is to stop transactions from hanging indefinitely.
Also important to note is that while web3 and truffle crash here - your transaction has still been transmitted and may actually be mined at some point. You can grab the transaction hash from the output and check its status on Etherscan to see what it's actual status is
We're quite close to publishing a re-write of the migrations command that will end-run this error and allow you to set an arbitrary number of blocks to wait for a transaction. Will ping this issue when that work is available in beta form. . .
@faizanahmad055 Hi I faced same issue. And the solution is to replace 'Migrations.sol' with solidity 0.4.23 version
pragma solidity ^0.4.23;
contract Migrations {
address public owner;
uint public last_completed_migration;
constructor() public {
owner = msg.sender;
}
modifier restricted() {
if (msg.sender == owner) _;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
Thank you for raising this issue! It has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you would like to keep this issue open, please respond with information about the current state of this problem.
There has been no new activity on this issue since it was marked as stale 7 days ago, so it is being automatically closed. If you'd like help with this or a different problem, please open a new issue. Thanks!
I don't think so. There is activity and the issue still appears
now I fixed the issue by omitting gasPrice
and keeping gas
but with higher value
rinkeby: {
provider: () => {
return new HDWalletProvider(process.env.MNEMONIC, process.env.RINKEBY_ENDPOINT)
},
network_id: 4,
gas: 5000000,
//gasPrice: 1000
}
@abdnennour did you see in the logs what gas price was used in the transaction? What solidity version are you using?
@gnidan It looks like this shouldn't have been closed.
Thanks for your response! This issue is no longer considered stale and someone from the Truffle team will try to respond as soon as they can.
Thanks for your response! This issue is no longer considered stale and someone from the Truffle team will try to respond as soon as they can.
@joshma91 has ran into this issue and messaged me personally. @joshma91, can you elaborate more here?
Whoops, closed again by accident.
Using Truffle and Infura to deploy my contracts to Ropsten, my deployment hangs with the same error in the initial post. @abdennour's solution of omitting gasPrice is what made deployment work for me:
ropsten: {
provider: () => new HDWalletProvider(process.env.MNEMONIC, "https://ropsten.infura.io/v3/" + process.env.INFURA_API_KEY),
network_id: 3,
gas: 3000000,
}
i am using Truffle v4.1.14 trying to deploy to kovan and mainnet. I have deployed the same contract before the kovan and mainnet 2 months ago. Now when i deploy with 5000000 gas, parity --chain=kovan/mainnet --jsonrpc-apis web3,eth,net,personal,parity,parity_set,traces,rpc,parity_accounts as mentioned above, i still get:
Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: Contract transaction couldn't be found after 50 blocks
Anyone manage to deploy smart contract successful recently?
@joshma91 @brent-capx I've been informed that this has been fixed in Truffle v5 since beta.0. If you're still having issues, we can re-open. But the solution for this is to either do the work around above or upgrade to v5 (which is what I'd recommend).
Hi Guys, i confirmed this is due to problem in the ethereum network, it's not picking up any transactions for the past 4 days, i have been monitoring my account every day and it's empty. Today, i suddenly see 20 over contract creations transactions in the chain. This is totally screwed up, it has nothing to do with truffle or parity or any tools, it seems the chain has different workers picking up contract creation versus miners picking up other transactions type. It's there any way to cancel any transactions?
@brent-capx nope you can't cancel transactions once they're out in the wild. sounds like your transaction gas limits are probably approaching block limits and the result is that it takes awhile for there to be guaranteed space in a block. you can increase your gas price in hopes they get picked up faster.
Usually you will see the transaction in blockchain and status pending. I have even tried with 50 Gwei 5 mil gas and it just show transactions cannot be found after 50 blocks. It's not there, and no status in chain. it just appear after 4 days in etherscan.io. I don't think approaching block limits is the case, since i tried everyday.
hard to say about what the network's been like the past few days, but 5,000,000 is a pretty hefty tx gas limit (it's >60% of a block). might want to check https://ethgasstation.info/calculatorTxV.php before running a tx that large.
for anyone trying to cancel transactions, you can use this: curl --data '{"method":"eth_sendTransaction","params":[{"from":"0xd03a11eb810c8da2b31e420cbadffd9b9ffbee3e","gas":"0x588040","gasPrice":"0xba43b7400","data":"0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675","nonce":"0x1d"}],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
Send in invalid data into the transaction and it will execute wrongly, but you still have to pay for the gas.
What exactly can it be? Address ..... is not whitelisted?? I am assuming that .... is the rinkeby.etherscan.io address of my would-be ERC 721 contract?
$ yarn truffle deploy --network rinkeby
Compiling .\contracts\ApprovedSpenderContract.sol Compiling .\contracts\ERC721Tradable.sol Compiling .\contracts\Migrations.sol Compiling .\contracts\Migrations.sol Compiling .\contracts\Villa_Rode_AL_OS721_Rinkeby.sol Compiling .\contracts\common\meta-transactions\ContentMixin.sol Compiling .\contracts\common\meta-transactions\EIP712Base.sol Compiling .\contracts\common\meta-transactions\Initializable.sol Compiling .\contracts\common\meta-transactions\NativeMetaTransaction.sol Artifacts written to C:\Users\User\OS721_Rinkeby\build\contracts Compiled successfully using:
- solc: 0.8.10+commit.fc410830.Emscripten.clang
Network name: 'rinkeby-fork' Network id: 4 Block gas limit: 30000000 (0x1c9c380)
Error: Deployment Failed
"Migrations" -- Unknown Error: {"jsonrpc": "2.0", "id": 28, "error": {"code": -32600, "message": "Address 0xb5d9837ae53020706e0e7a0b5b586499d1f3a5ad is not whitelisted"}} { "originalError": {} }.
at C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\deployer\src\deployment.js:365:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Migration._deploy (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:70:1)
at Migration._load (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:56:1)
at Migration.run (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:217:1)
at Object.runMigrations (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)
at Object.run (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\migrate\index.js:87:1)
at runMigrations (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:258:1)
at setupDryRunEnvironmentThenRunMigrations (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:246:1)
at Object.run (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\core\lib\commands\migrate.js:215:1)
at Command.run (C:\Users\User\OS721_Rinkeby\node_modules\truffle\build\webpack:\packages\core\lib\command.js:183:1)
Truffle v5.4.19 (core: 5.4.19) Node v17.1.0
Issue
I've successfully deployed my test contract to TestRpc as well as a private blockchain, but I'm having immense difficulty actually deploying to the live network. I asked for advice on gittr but nobody on at the time had any advice.
What makes it more peculiar is that there were a few instances where the deploy process did seem to create the Migrations contract (as visible here https://etherscan.io/address/0x0f045791e6a0b1135eff7c3a7fb8092858846d4f) and in a few cases it looks like it deployed the Migrations contract multiple times without deploying the subsequent contract.
The contract compiles without complaint but when I try to deploy to the live network, it hangs and eventually returns Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: Contract transaction couldn't be found after 50 blocks.
I've since pared the contract down to the simplest possible function and still have the same issue.
Any help would be greatly appreciated.
Steps to Reproduce
Migrations.sol
1_initial_migration.js
2_deploy_contracts.js
truffle.js
Expected Behavior
I would expect the contract to deploy.
Actual Results