question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] --passphrase-file ignored for "chia start"

See original GitHub issue

Describe the bug There are three bugs here, filed as one issue as they are all interrelated:

Bug 1 - Cannot start chia with passphrase-file

When starting Chia, the new --passphrase-file CLI option has no effect; Chia queries the passphrase from the terminal, preventing unattended system start scripts from operating. Other Chia operations, such as keys show work as expected.

To Reproduce

(venv) ~$ echo -n "Super Secret" > /tmp/chia.pw
(venv) ~$ chia --passphrase-file /tmp/chia.pw keys show
Showing all public keys derived from your master seed and private key:
Fingerprint: 12345678
...
(venv) ~$ chia --passphrase-file /tmp/chia.pw start farmer
Daemon not started yet
Starting daemon
(Unlock Keyring) Passphrase: 
Aborted!
(venv) ~$

Bug 2 - Input sanitizing

The routine that reads the --passphrase-file preserves spaces within the passphrase (correct) but also includes line termination characters (CRLF) within the passphrase (incorrect).

To Reproduce

(venv) ~$ echo "Super Secret" > /tmp/chia.pw   # The correct password but with '\n' on the end.
(venv) ~$ chia --passphrase-file /tmp/chiia.pw keys show
(Unlock Keyring) Passphrase: 
Aborted!
(venv) ~$

Bug 3 - Lack of error/abort on incorrect passphrase

When providing the wrong password in the passphrase-file, chia does not abort with an “incorrect passphrase” error. See the “To Reproduce” for Bug 2.

Expected Behavior

Chia should honor --passphrase-file when starting, and provide useful error output when the passphrase is incorrect.

(venv) ~$ echo "There are no mistakes, just happy accidents" > /tmp/chia.pw
(venv) ~$ chia --passphrase-file /tmp/chia.pw keys show
Invalid passphrase from file /tmp/chia.pw
(venv) ~$ echo $?
1
(venv) ~$ echo $'Super Secret\n\n\r\n\r\n' > /tmp/chia.pw
(venv) ~$ chia --passphrase-file /tmp/chia.pw start farmer
Daemon not started yet
Starting daemon
Starting farmer
...
(venv) ~$

Desktop

  • OS: Slackware Linux
  • OS Version/Flavor: Current, a.k.a. 15.0
  • CPU: AMD Ryzen
  • Chia Version: 1.2.11.dev20 (git main HEAD) and/or 1.2.10 (git latest)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
stefan-langecommented, Nov 2, 2021

Offtopic: I am not a chia developer, but a normal one and this is -by far- one of the best bug descriptions I have ever seen, @moonlitbugs

1reaction
paninarocommented, Nov 9, 2021

Fixes have been merged into main.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Incorrect Passphrase Error on chia farm summary CLI ...
I have set passphrase to my Chia blockchain software. When I read finger prints by CLI using this command: **chia --passphrase-file ...
Read more >
T1928 regression --passphrase-file ignored in gnupg 2.1.2
file, gpg still asks for a passphrase via pinentry and refuses to accept the file. strace suggests that the file is actually read...
Read more >
1.1.6 is out : r/chia - Reddit
Or just copy/rename the chia daemon folder and plot using command line. That won't be closed by an update.
Read more >
Docker run reference
Do not pass a service x start command to a detached container. ... you can have Docker write the container ID out to...
Read more >
create react app not picking up .env files? - Stack Overflow
Note: You must create custom environment variables beginning with REACT_APP_ . Any other variables except NODE_ENV will be ignored to avoid ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found