Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Contract transaction couldn't be found after 50 blocks #926

Closed
Warrantoken opened this issue Apr 30, 2018 · 2 comments
Closed

Contract transaction couldn't be found after 50 blocks #926

Warrantoken opened this issue Apr 30, 2018 · 2 comments

Comments

@Warrantoken
Copy link

  • [Yes ] I've asked for help in the Truffle Gitter before filing this issue.

Issue

What the issue is, in broad strokes.

We are developing an ICO based on openzeppelin contracts with little modifications.

Our ICO contract is easily deployed on Rinkeby testnet, however, when we deploy on main net we get the error:

Saving artifacts...
(node:11685) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Contract transaction couldn't be found after 50 blocks
(node:11685) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Which occurs during the deployment stage.

We tried modifying the web3.js dependency to increase the number from 50 to 5000 to see if that would work, and we got a different error:

Saving artifacts...
/.nvm/versions/node/v8.8.1/lib/node_modules/truffle/build/cli.bundled.js:128716
var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&"function"==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORK
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/node_modules/xhr2/lib/xhr2.js:414:24)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at TLSSocket.socketErrorListener (_http_client.js:385:9)
    at emitOne (events.js:115:13)

Steps to Reproduce

truffle migrate --network live --reset

Expected Behavior

Contract deployed.

Actual Results

Saving artifacts...
(node:11685) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Contract transaction couldn't be found after 50 blocks
(node:11685) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Which occurs during the deployment stage.

We tried modifying the web3.js dependency to increase the number from 50 to 5000 to see if that would work, and we got a different error:

Saving artifacts...
/.nvm/versions/node/v8.8.1/lib/node_modules/truffle/build/cli.bundled.js:128716
var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&"function"==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORK
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/node_modules/xhr2/lib/xhr2.js:414:24)
    at emitOne (events.js:115:13)
    at ClientRequest.emit (events.js:210:7)
    at TLSSocket.socketErrorListener (_http_client.js:385:9)
    at emitOne (events.js:115:13)

Environment

  • Operating System: OSX 10.12
  • Ethereum client: Infura
  • Truffle version (truffle version): v4.0.5
  • node version (node --version): 8.8.1
  • npm version (npm --version): 5.4.2
@cgewecke
Copy link
Contributor

@Warrantoken This looks like the same problem that's being reported in #852 and is Infura specific. We're trying to get more information about why this happens:

  • How many blocks over 50 is it taking before the migrations proceed to the Saving artifacts step?
  • In using infura in truffle and get Error: Invalid JSON RPC response: "" #852, peoples' contracts are actually getting deployed and the problem is truffle crashing at the very end. Is this the case for you? If you see the migrations output a contract address you should be able to locate it on etherscan.

Possibly related to truffle-migrate 15. One difference in your two deployments is that the successful case runs on an exclusively geth client network, whereas mainnet could be anything.

Could you run the following at the command line (you'll need to substitute your infura token for <INFURA_TOKEN>) and report which client infura is running when handling your requests?

curl -X POST --data '{"jsonrpc":"2.0", "method":"web3_clientVersion", "params": [], "id": 1}' https://mainnet.infura.io/<INFURA_TOKEN>

@cgewecke
Copy link
Contributor

cgewecke commented May 2, 2018

@Warrantoken Going to close this as a duplicate #852 - now believe this may be caused by Infura closing the connection while truffle-hdwallet-provider continues to try to poll them.

@cgewecke cgewecke closed this as completed May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants