Closed RohitGupta027 closed 4 years ago
@RohitGupta027 Can you post the log of yarn run:demo
command?
yarn run v1.22.0
$ lerna run start --scope @energyweb/migrations --stream
lerna notice cli v3.20.2
lerna info versioning independent
lerna notice filter including "@energyweb/migrations"
lerna info filter [ '@energyweb/migrations' ]
lerna info Executing command in 1 package: "yarn run start"
@energyweb/migrations: $ ts-node src/deploy
@energyweb/migrations: Connected to the WebSocket event server on: ws://localhost:3031
@energyweb/migrations: (node:54842) UnhandledPromiseRejectionWarning: Error: Request failed with status code 400
@energyweb/migrations: at createError (/Users/rohit.gupta/shell/blockchain/ewf/origin/node_modules/axios/lib/core/createError.js:16:15)
@energyweb/migrations: at settle (/Users/rohit.gupta/shell/blockchain/ewf/origin/node_modules/axios/lib/core/settle.js:17:12)
@energyweb/migrations: at IncomingMessage.handleStreamEnd (/Users/rohit.gupta/shell/blockchain/ewf/origin/node_modules/axios/lib/adapters/http.js:236:11)
@energyweb/migrations: at IncomingMessage.emit (events.js:323:22)
@energyweb/migrations: at IncomingMessage.EventEmitter.emit (domain.js:482:12)
@energyweb/migrations: at endReadableNT (_stream_readable.js:1204:12)
@energyweb/migrations: at processTicksAndRejections (internal/process/task_queues.js:84:21)
@energyweb/migrations: (node:54842) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
@energyweb/migrations: (node:54842) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The log indicates there was a problem - 400
code coming from backend service. Can you post log of yarn run:backend
?
Also, before deploying new demo, please remove the backend database first. For example, instead of running yarn run:backend
from root directory, run:
rm -rf db.sqlite && yarn start:dev
from inside packages/origin-backend
directory
Worked like charm by running rm -rf db.sqlite && yarn start:dev
from project directory. Earlier I started the backend from the root directory and it does start without any error but then yarn run:demo
was giving error 400
. Any idea what causes the issue before?
So, after you deploy demo once, then you need to clear database and restart origin-backend. The easiest way to do it is to find db.sqlite
and remove it.
Thanks @Kuzirashi for your quick responses and provide solution.
In continuation of the earlier issue #642 I am still facing the same issue
Please make sure you've chosen the correct blockchain network and the contract address is valid.
using local ganache network. I am using below setupyarn run:ganache
yarn run:ganache
yarn run:backend
yarn run:demo
yarn run:ui
After this I get this error message on console even after switching the network from localhost to mainnet many times.
Can you please suggest what's going wrong?