turboflakes / crunch

Crunch is a command-line interface (CLI) and Matrix Bot to claim staking rewards every Era for Substrate-based chains
https://turboflakes.io
Apache License 2.0
63 stars 22 forks source link

`Result::unwrap()` on an `Err` value: BadWordCount(1) #39

Closed MrLawrence closed 8 months ago

MrLawrence commented 8 months ago

Since version v0.11.1 I get the following error:

Feb 28 23:33:43 goethe crunch[1340050]: thread 'async-std/runtime' panicked at src/crunch.rs:173:42:
Feb 28 23:33:43 goethe crunch[1340050]: called `Result::unwrap()` on an `Err` value: BadWordCount(1)
Feb 28 23:33:43 goethe crunch[1340050]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Feb 28 23:33:43 goethe systemd[1]: crunch-bot.service: Main process exited, code=exited, status=101/n/a
Feb 28 23:33:43 goethe systemd[1]: crunch-bot.service: Failed with result 'exit-code'.

The expected behavior is that crunchbot pays out my nominators, which doesn't happen because of the error.

The error happens on an amd64 Ubuntu 22.04 cloud server. I can confirm the error happening on v0.11.1, v0.11.2 and v12.0. Currently I run v10.1 which doesn't have this problem.

paulormart commented 8 months ago

Hi thanks for raising this issue. Since version 0.11 the seed file must contain a mnemonic phrase, but from the error you are getting i'm assuming you are using a secret key, correct?

MrLawrence commented 8 months ago

Yes! That's correct. I actually didn't know a mnemonic phrase is possible. Is secret key support intentionally dropped and won't come back?

paulormart commented 8 months ago

I'm working on a fix, should be out soon.

MrLawrence commented 8 months ago

I started the new version v12.1 . I get a new error:

Feb 29 15:27:56 goethe crunch[1366400]: [2024-02-29T14:27:56Z INFO  crunch::runtimes::kusama] Inspect and `crunch` unclaimed payout rewards
Feb 29 15:27:56 goethe crunch[1366400]: [2024-02-29T14:27:56Z ERROR crunch::crunch] SecretError error: Invalid secret phrase format

The bot doesn't crash, but it says in the matrix chat the following:


🚨 An error was raised -> crunch on hold for 2 min while rescue is on the way 🚁 🚒 🚑 🚓

🚨 An error was raised -> crunch on hold for 4 min while rescue is on the way 🚁 🚒 🚑 🚓
miloskriz commented 8 months ago

I can confirm new version v0.12.1 results in the following error:

Feb 29 15:16:12 gb-utils01 crunch[49821]: [2024-02-29T15:16:12Z ERROR crunch::crunch] SecretError error: Invalid secret phrase format

Thanks @paulormart !

paulormart commented 8 months ago

Hey guys, latest release v0.12.2 should fix this issue. Please let me know if you have any problems.

MrLawrence commented 8 months ago

Thank you! It works.

miloskriz commented 8 months ago

It works on my side too!!!

Thanks @paulormart thanks @MrLawrence