trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.32k forks source link

truffle migrate outputs source code to screen #4121

Closed ErrorEater closed 3 years ago

ErrorEater commented 3 years ago

Issue

ropsten: {
  provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${infuraKey}`),
  network_id: 3,       // Ropsten's id
  gas: 5500000,        // Ropsten has a lower block limit than mainnet
  confirmations: 2,    // # of confs to wait between deployments. (default: 0)
  timeoutBlocks: 200,  // # of blocks before a deployment times out  (minimum/default: 50)
  skipDryRun: true     // Skip dry run before migrations? (default: false for public nets )
}

The command: truffle migrate --network ropsten doesn't deploy to the blockchain but prints all byte code and some JavaScript code to the screen with the following error message at the end.

I don't have this error when I deploy locally or locally fork ropsten. This is deployment related error, the contract compilation phase completes without errors.

RuntimeError: abort([object Object]). Build with -s ASSERTIONS=1 for more info.
    at process.abort (C:\Users\Developer\.config\truffle\compilers\node_modules\soljson-v0.8.4+commit.c7e474f2.js:1:12950)
    at process.emit (events.js:315:20)
    at process.emit (C:\Users\Developer\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\source-map-support
\source-map-support.js:495:1)
    at process.emit (C:\Users\Developer\AppData\Roaming\npm\node_modules\truffle\build\webpack:\node_modules\source-map-support
\source-map-support.js:495:1)
    at processPromiseRejections (internal/process/promises.js:245:33)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
    at runNextTicks (internal/process/task_queues.js:62:3)
    at listOnTimeout (internal/timers.js:523:9)
    at processTimers (internal/timers.js:497:7)

What could be the problem and how can I compile with "-s ASSERTIONS=1" to get more information?

Sample screen output.

AOQ8EgBplQAAapUAAGuVAAAMQAAAbJUAAA5AAAAPQAAAbZUAAG6VAAASQAAAE0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gskACwtJlwAASJcAABBlEgBB5ILJAAsBAgBB84LJAAsF////
//8AQbiDyQALAQkAQcSDyQALAkuXAEHYg8kACxJKlwAAAAAAAEiXAABIZRIAAAQAQYSEyQALBP////8AQciEyQALF4BtEADQbRAAtHAQAF2aAABa1xAAgHdi
";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBin
aryFile&&wasmBinary){return new Uint8Array(wasmBinary)}var binary=tryParseAsDataURI(file);if(binary){return binary}if(re
adBinary){return readBinary(file)}else{throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'
] manually, or emcc.py will do that for you when generating HTML (but not JS)"}}catch(err){abort(err)}}function instanti
ateSync(file,info){var instance;var module;var binary;try{binary=getBinary(file);module=new WebAssembly.Module(binary);i
nstance=new WebAssembly.Instance(module,info)}catch(e){var str=e.toString();err("failed to compile wasm module: "+str);i
f(str.indexOf("imported Memory")>=0||str.indexOf("memory import")>=0){err("Memory size incompatibility issues may be due
 to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and als
o make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time).")}throw e}return[ins
tance,module]}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=i
nstance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["qb"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmT
able=Module["asm"]["rb"];removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instant
iateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instanti
ateWasm callback failed with error: "+e);return false}}var result=instantiateSync(wasmBinaryFile,info);receiveInstance(r
cds-amal commented 3 years ago

@aliveli186 what version of truffle are you using? This should have been resolved in v5.3.10 😅 . If you're on a previous version you can upgrade with the following command npm uninstall -g truffle && npm install -g truffle

What could be the problem and how can I compile with "-s ASSERTIONS=1" to get more information?

That output shouldn't be displayed but you can examine the end of the dump, which may have information on the rejected promise or error that caused the issue.

ErrorEater commented 3 years ago

@cds-amal I upgraded, still errors but shows more details. I added networkCheckTimeout: 1000000 but has no effect.

F:\Projects\Blockchain\node_modules\request\request.js:848
          var e = new Error('ETIMEDOUT')
                  ^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: ETIMEDOUT
    at Timeout.<anonymous> (F:\Projects\Blockchain\node_modules\request\request.js:848:19)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
    at PollingBlockTracker._performSync (F:\Projects\Blockchain\node_modules\eth-block-tracker\src\polling.js:51:24)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at runNextTicks (internal/process/task_queues.js:62:3)
    at listOnTimeout (internal/timers.js:523:9)
    at processTimers (internal/timers.js:497:7)
UnhandledRejections detected
Promise {
  <rejected> {
    code: -32603,
    message: 'ETIMEDOUT',
    data: { originalError: [Object] },
    stack: 'Error: ETIMEDOUT\n' +
      '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
      '    at listOnTimeout (internal/timers.js:554:17)\n' +
      '    at processTimers (internal/timers.js:497:7)'
  }
} {
  code: -32603,
  message: 'ETIMEDOUT',
  data: { originalError: { code: 'ETIMEDOUT', connect: true } },
  stack: 'Error: ETIMEDOUT\n' +
    '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
    '    at listOnTimeout (internal/timers.js:554:17)\n' +
    '    at processTimers (internal/timers.js:497:7)'
}
Promise {
  <rejected> {
    code: -32603,
    message: 'ETIMEDOUT',
    data: { originalError: [Object] },
    stack: 'Error: ETIMEDOUT\n' +
      '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
      '    at listOnTimeout (internal/timers.js:554:17)\n' +
      '    at processTimers (internal/timers.js:497:7)'
  }
} {
  code: -32603,
  message: 'ETIMEDOUT',
  data: { originalError: { code: 'ETIMEDOUT', connect: true } },
  stack: 'Error: ETIMEDOUT\n' +
    '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
    '    at listOnTimeout (internal/timers.js:554:17)\n' +
    '    at processTimers (internal/timers.js:497:7)'
}
Promise {
  <rejected> {
    code: -32603,
    message: 'ETIMEDOUT',
    data: { originalError: [Object] },
    stack: 'Error: ETIMEDOUT\n' +
      '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
      '    at listOnTimeout (internal/timers.js:554:17)\n' +
      '    at processTimers (internal/timers.js:497:7)'
  }
} {
  code: -32603,
  message: 'ETIMEDOUT',
  data: { originalError: { code: 'ETIMEDOUT', connect: true } },
  stack: 'Error: ETIMEDOUT\n' +
    '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
    '    at listOnTimeout (internal/timers.js:554:17)\n' +
    '    at processTimers (internal/timers.js:497:7)'
}
Promise {
  <rejected> {
    code: -32603,
    message: 'ETIMEDOUT',
    data: { originalError: [Object] },
    stack: 'Error: ETIMEDOUT\n' +
      '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
      '    at listOnTimeout (internal/timers.js:554:17)\n' +
      '    at processTimers (internal/timers.js:497:7)'
  }
} {
  code: -32603,
  message: 'ETIMEDOUT',
  data: { originalError: { code: 'ETIMEDOUT', connect: true } },
  stack: 'Error: ETIMEDOUT\n' +
    '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
    '    at listOnTimeout (internal/timers.js:554:17)\n' +
    '    at processTimers (internal/timers.js:497:7)'
}
Promise {
  <rejected> {
    code: -32603,
    message: 'ETIMEDOUT',
    data: { originalError: [Object] },
    stack: 'Error: ETIMEDOUT\n' +
      '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
      '    at listOnTimeout (internal/timers.js:554:17)\n' +
      '    at processTimers (internal/timers.js:497:7)'
  }
} {
  code: -32603,
  message: 'ETIMEDOUT',
  data: { originalError: { code: 'ETIMEDOUT', connect: true } },
  stack: 'Error: ETIMEDOUT\n' +
    '    at Timeout.<anonymous> (F:\\Projects\\Blockchain\\node_modules\\request\\request.js:848:19)\n' +
    '    at listOnTimeout (internal/timers.js:554:17)\n' +
    '    at processTimers (internal/timers.js:497:7)'
}
ErrorEater commented 3 years ago

Changing the provider configuration to use web sockets solved the problem.

provider: () => new HDWalletProvider(mnemonic, `wss://ropsten.infura.io/ws/v3/${infuraKey}`),
websockets: true