authentication needed: password or unlock - ScnuWang/MessageBoard GitHub Wiki
jason@jason-VirtualBox:~/message-board$ truffle migrate Using network 'development'.
Running migration: 1_initial_migration.js
Deploying Migrations...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: authentication needed: password or unlock
at Object.InvalidResponse (/home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack://web3/lib/web3/errors.js:38:1)
at /home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack://web3/lib/web3/requestmanager.js:86:1
at /home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack://truffle-migrate/index.js:225:1
at /home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack://truffle-provider/wrapper.js:134:1
at XMLHttpRequest.request.onreadystatechange (/home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack://web3/lib/web3/httpprovider.js:128:1)
at XMLHttpRequestEventTarget.dispatchEvent (/home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack://xhr2/lib/xhr2.js:64:1)
at XMLHttpRequest._setReadyState (/home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack://xhr2/lib/xhr2.js:354:1)
at XMLHttpRequest._onHttpResponseEnd (/home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack://xhr2/lib/xhr2.js:509:1)
at IncomingMessage. (/home/jason/.nvm/versions/node/v8.11.1/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
解决办法:解锁账户:personal.unlockAccount(web3.eth.coinbase, "password", 15000)
其中password部分为之前创建账户的密码,15000对应的是解锁的时间。