lisk-sdk icon indicating copy to clipboard operation
lisk-sdk copied to clipboard

Lisk SDK crashes when initiating a new project

Open reyraa opened this issue 1 year ago • 1 comments

Expected behavior

I should be able to initiate a project using Lisk SDK v6.0.0-alpha.0.

Actual behavior

When I run lisk init --registry our-private-registry and input app information, lisk commander manages to install the dependence, then it tries to create the genesis block, where it throws the following error:

Generating genesis block and config.
    TypeError: The "list[1]" argument must be an instance of Buffer or Uint8Array. Received an instance of Object
    Code: ERR_INVALID_ARG_TYPE
/Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/yeoman-generator/node_modules/execa/lib/error.js:59
		error = new Error(message);
		        ^

Error: Command failed with exit code 1: /Users/reyraa/Projects/lisk/lisk-sdk-examples/tutorials/postboard/bin/run genesis-block:create --output config/default --validators-passphrase-encryption-iterations 1 --validators-hash-onion-count 10000 --validators-hash-onion-distance 1000
    at makeError (/Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/yeoman-generator/node_modules/execa/lib/error.js:59:11)
    at Function.module.exports.sync (/Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/yeoman-generator/node_modules/execa/index.js:188:17)
    at InitGenerator.spawnCommand.spawnCommandSync (/Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/yeoman-generator/lib/actions/spawn-command.js:35:16)
    at InitGenerator.end (/Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/dist/bootstrapping/templates/lisk-template-ts/generators/init_generator.js:54:14)
    at Object.<anonymous> (/Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/yeoman-generator/lib/index.js:1009:25)
    at /Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/run-async/index.js:49:25
    at new Promise (<anonymous>)
    at /Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/run-async/index.js:26:19
    at runLoop.add.once.once (/Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/yeoman-generator/lib/index.js:1010:11)
    at Immediate.<anonymous> (/Users/reyraa/.nvm/versions/node/v16.14.2/lib/node_modules/lisk-commander/node_modules/grouped-queue/lib/subqueue.js:48:34) {
  shortMessage: 'Command failed with exit code 1: /Users/reyraa/Projects/lisk/lisk-sdk-examples/tutorials/postboard/bin/run genesis-block:create --output config/default --validators-passphrase-encryption-iterations 1 --validators-hash-onion-count 10000 --validators-hash-onion-distance 1000',
  command: '/Users/reyraa/Projects/lisk/lisk-sdk-examples/tutorials/postboard/bin/run genesis-block:create --output config/default --validators-passphrase-encryption-iterations 1 --validators-hash-onion-count 10000 --validators-hash-onion-distance 1000',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

Steps to reproduce

Run lisk init using the private registry

Which version(s) does this affect? (Environment, OS, etc...)

  • Node 14.16.2
  • npm 8.5.0
  • lisk-commander/6.0.0-alpha.0 darwin-arm64 node-v16.14.2

reyraa avatar Jul 25 '22 10:07 reyraa

After some investigation, I found that the error is coming when we generateAssets using utils in Commander and it passes those assets while generating the genesis block and it fails while encoding.

We need to update the util function generateGenesisBlockDefaultDPoSAssets

ishantiw avatar Jul 25 '22 16:07 ishantiw

This will be resolved by #7454

shuse2 avatar Aug 26 '22 08:08 shuse2