question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

deployer.exec command produces error during migration

See original GitHub issue

Issue

Running truffle migrate produces error

Steps to reproduce

  1. Create a script according to https://truffle.readthedocs.io/en/latest/getting_started/scripts/
  2. Add deployer.exec command to migration jobs
module.exports = function(deployer) {
  deployer.exec('path/to/script');
}
  1. Run truffle migrate

Expected behavior

Script runs and exits successfully

Actual behavior

Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Expected parameter 'contracts_build_directory' not passed to function.
    at /Users/teddy/Projects/btl/truffle-webpack-demo-clone/node_modules/truffle/lib/expect.js:5:15
    at Array.forEach (native)
    at Object.options (/Users/teddy/Projects/btl/truffle-webpack-demo-clone/node_modules/truffle/lib/expect.js:3:19)
    at Object.exec (/Users/teddy/Projects/btl/truffle-webpack-demo-clone/node_modules/truffle/lib/require.js:89:12)
    at /Users/teddy/Projects/btl/truffle-webpack-demo-clone/node_modules/truffle/lib/deployer.js:101:17
    at /Users/teddy/Projects/btl/truffle-webpack-demo-clone/node_modules/truffle/lib/deployer.js:100:14
    at /Users/teddy/Projects/btl/truffle-webpack-demo-clone/node_modules/truffle/lib/deferredchain.js:20:15

Environment

  • Truffle 2.1.1
  • Node 7.0.0
  • TestRPC 3.0.0
  • macOS Sierra
  • npm 3.10.8

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
KeepMovingNo1commented, Apr 3, 2017

Error: Invalid JSON RPC response: “” at Object.InvalidResponse (/usr/local/node/lib/node_modules/truffle/node_modules/web3/lib/web3/errors.js:35:16) at XMLHttpRequest.request.onreadystatechange (/usr/local/node/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:115:32) at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/node/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18) at XMLHttpRequest._setReadyState (/usr/local/node/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12) at XMLHttpRequest._onHttpRequestError (/usr/local/node/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:544:12) at ClientRequest.<anonymous> (/usr/local/node/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:414:24) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at Socket.socketErrorListener (_http_client.js:309:9) at emitOne (events.js:96:13)

0reactions
tcoultercommented, Sep 18, 2017

The deployer.exec() command is no longer available in Truffle 4.0 due to complexities in implementation. You can get around this by writing a module that accepts the deployer and associated contract abstractions as input to a function, and then importing that module into your migrations.

Closing this ticket for housekeeping. Please open a ticket if you run into any more issues. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entity Framework Code First Migration during deploy to ...
When I deploy the ASP.Net MVC app with the Execute Code First Migrations checkbox marked the app throws a 500 error on the...
Read more >
Migration troubleshooting in production - Prisma
The following guide describes issues relating to Prisma Migrate that can occur in production, and how to resolve them. This guide does not...
Read more >
Troubleshooting Common Problems with Web Deploy
This walkthrough shows how to diagnose and fix common problems with Web Deploy, including common errors seen while publishing from Visual ...
Read more >
Deploy Ubuntu 18.04 Bionic Beaver Discussion - GoRails
Having trouble getting past the following error on 'cap production deploy'... please help! 00:05 deploy:migrating 01 $HOME/.rbenv/bin/rbenv exec ...
Read more >
Release Phase | Heroku Dev Center
To specify the tasks to run during the release phase, define a ... v52 v53 Deploy ad7c527 release command failed jbyrum@heroku.com v52 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found