deployer.exec command produces error during migration
See original GitHub issueIssue
Running truffle migrate
produces error
Steps to reproduce
- Create a script according to https://truffle.readthedocs.io/en/latest/getting_started/scripts/
- Add
deployer.exec
command to migration jobs
module.exports = function(deployer) {
deployer.exec('path/to/script');
}
- 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:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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)
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 thedeployer
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!