NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 442 forks source link

Wallet Autounlock failed when I start siad via systemd #3116

Closed jensamberg closed 5 years ago

jensamberg commented 6 years ago

BUG REPORT

Wallet autounlock does not work when I start siad via systemd

Stack Trace or error message

Jun 25 19:06:51 siacontainer systemd[1]: Started Sia Daemon. Jun 25 19:06:51 siacontainer siad[378]: Sia Daemon v1.3.3 Jun 25 19:06:51 siacontainer siad[378]: Git Revision 94ea84e Jun 25 19:06:51 siacontainer siad[378]: Loading... Jun 25 19:06:51 siacontainer siad[378]: (0/5) Loading siad... Jun 25 19:06:51 siacontainer siad[378]: (1/5) Loading gateway... Jun 25 19:06:51 siacontainer siad[378]: (2/5) Loading consensus... Jun 25 19:06:52 siacontainer siad[378]: (3/5) Loading transaction pool... Jun 25 19:06:52 siacontainer siad[378]: (4/5) Loading wallet... Jun 25 19:06:52 siacontainer siad[378]: (5/5) Loading host... Jun 25 19:06:52 siacontainer siad[378]: Sia Wallet Password found, attempting to auto-unlock wallet Jun 25 19:06:52 siacontainer siad[378]: Auto-unlock failed. Jun 25 19:06:52 siacontainer siad[378]: Finished loading in 0.336557167 seconds

Expected Behavior

Auto unlock the wallet when systemd start siad

How to reproduce it (as minimally and precisely as possible)

Create this siad.service

[Unit] Description=Sia Daemon After=network.target

[Service] ExecStop=/siadata/Sia-v1.3.3-linux-amd64/siac stop WorkingDirectory=/siadata/Sia-v1.3.3-linux-amd64 Restart=always RestartSec=5 Environment=SIA_WALLET_PASSWORD="secretpassword" ExecStart=/siadata/Sia-v1.3.3-linux-amd64/siad -M gctwh

[Install] WantedBy=multi-user.target

Autounlock does fail.

Environment

tbenz9 commented 6 years ago

This looks like Sia is getting the wrong seed. I'm not sure if you're supposed to have the quotes, and double check your seed is correct.

jensamberg commented 6 years ago

I double checked the password. I put it in a Textfile in the systemd script an it is correct. It does not work.

I have I custom password when i export it direct in the Environment I works. But not via systemd can you check it?

jensamberg commented 6 years ago

There is no bug. However the sia auto wallet unlock works only if in systemd the environment is set like this

Correct: Environment="SIA_WALLET_PASSWORD=secretpassword"

False Environment=SIA_WALLET_PASSWORD="secretpassword"

The difference are the quotes.

ChrisSchinnerl commented 5 years ago

I'll close this for now since it seems like the problem got resolved.