entropyxyz / cli

CLI utility to ease interactions with an Entropy network.
GNU Affero General Public License v3.0
5 stars 0 forks source link

CLI times out and errors after ~1 minute. #49

Closed johnnymatthews closed 3 months ago

johnnymatthews commented 3 months ago

This issue is based off the main branch.

This is a bit of a weird one. If I open up the CLI, mess and around do some stuff, and then leave it for about a minute, the CLI errors out:

? name: Aragorn
? Would you like to password protect this key? No
New account:
{
        name: Aragorn
        address: 5GEUUkWzCFwBMSJDSj5KqanU5RegyQpcGQmZ3MU4W1xCx5YH
}
? Return to main menu? Yes

? Select Action Balance
(node:46508) [UNDICI-WS] Warning: WebSockets are experimental, expect them to change at any time.
(Use `node --trace-warnings ...` to show where the warning was created)
2024-05-27 15:11:35        REGISTRY: Unknown signed extensions ValidateConfirmRegistered found, treating them as no-effect
2024-05-27 15:11:35        API/INIT: RPC methods not decorated: chainSpec_v1_chainName, chainSpec_v1_genesisHash, chainSpec_v1_properties
Address 5GEUUkWzCFwBMSJDSj5KqanU5RegyQpcGQmZ3MU4W1xCx5YH has a balance of: 0 bits
? Return to main menu? Yes

? Select Action (Use arrow keys)
❯ Manage Accounts
  Balance
  Register
  Sign
  Transfer
  Deploy Program
  User Programs
  Exit
/home/johnny/Code/entropy/cli/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:397
        const bytesRecv = message.data.length;
                                       ^
TypeError: Cannot read properties of null (reading 'length')
    at WebSocket.__internal__onSocketMessage (/home/johnny/Code/entropy/cli/node_modules/@polkadot/rpc-provider/cjs/ws/index.js:397:40)
    at WebSocket.[nodejs.internal.kHybridDispatch] (node:internal/event_target:816:20)
    at WebSocket.dispatchEvent (node:internal/event_target:751:26)
    at fireEvent (node:internal/deps/undici/undici:10966:14)
    at websocketMessageReceived (node:internal/deps/undici/undici:10988:7)
    at ByteParser.run (node:internal/deps/undici/undici:11439:17)
    at ByteParser._write (node:internal/deps/undici/undici:11315:14)
    at writeOrBuffer (node:internal/streams/writable:564:12)
    at _write (node:internal/streams/writable:493:10)
    at ByteParser.Writable.write (node:internal/streams/writable:502:10)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here you can see that I created a new account, and then checked the balance of that account. I then returned to the main menu and did nothing. The CLI threw out that Cannot read properties of null (reading 'length') error after about a minute.

I've been able to duplicate this issue three times. I've also deleted my ~/.entropy-cli.config file a few times; still see this error.

rh0delta commented 3 months ago

no longer an issue for the cli