I have a contract and a set of mocha tests. I recently switched from using the ethereum client that comes with truffle (the one you get when you run truffle develop) to the ganache-cli. Somehow, in switching back and forth between them, I caused my tests to fail to run, and migrations don't seem to work either. The migrations work when I'm connected to ganache, but not the truffle development client. Here's the full error message.
$ truffle migrate --reset
Using network 'development'.
Running migration: 1_initial_migration.js
Replacing Migrations...
... 0x9391ac92dfbf86306e9ed896e7f9d5d45d9d88a072323ca1ef116f242ae0d2be
Migrations: 0x8cdaf0cd259887258bc13a92c0a6da92698644c0
Saving successful migration to network...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Attempting to run transaction which calls a contract function, but recipient address 0x8f0483125fcb9aaaefa9209d8e9d7b9c8b9fb90f is not a contract address
at Object.InvalidResponse (/home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
at /home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
at /home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/truffle-migrate/index.js:225:1
at /home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/truffle-provider/wrapper.js:134:1
at XMLHttpRequest.request.onreadystatechange (/home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
at XMLHttpRequestEventTarget.dispatchEvent (/home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
at XMLHttpRequest._setReadyState (/home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
at XMLHttpRequest._onHttpResponseEnd (/home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
at IncomingMessage.<anonymous> (/home/altair/.nvm/versions/node/v9.6.1/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
at IncomingMessage.emit (events.js:132:15)
at endReadableNT (_stream_readable.js:1101:12)
at process._tickCallback (internal/process/next_tick.js:152:19)
I can find plenty of issues and SE questions for "Error encountered, bailing. Network state unknown. Review successful transactions manually." But the line after that is always different than mine. I can't seem to find any google results for "Attempting to run transaction which calls a contract function, but recipient address" is not a contract address
The message makes sense to me, but how could that not be a contract address?
ETA: I also upgraded from truffle 4.0.5 to truffle 4.1.0, which is probably what caused the problem.
builddirectory and then reruntruffle migrate? – ivicaa Mar 02 '18 at 04:34