Azure / azure-quickstart-templates

Azure Quickstart Templates
https://aka.ms/azqst
MIT License
14k stars 16.09k forks source link

Unable to unlock coinbase account #3783

Open salmanprk opened 7 years ago

salmanprk commented 7 years ago

Issue Details

After deploying the Ethereum consortium Leader Blockchain, I am trying to SSH in the first TX node. After successfully accessing the the VM of the TX node, I try to unlock the account using

"personal.unlockAccount(eth.coinbase)"

However, I get this error "Error: could not decrypt key with given passphrase".

I used the same passphrase/password, that I entered before deploying the Ethereum Consortium

amiturgman commented 7 years ago

I had the same issue, it turned out that somehow the password I used was messed-up. I discovered that buy ssh-ing the tx machine and running ps -ef to see that actual command that runs geth. In that command you'll be able to see the actual password that was used. It was mostly similar, but a few of the characters were messed-up.

amiturgman commented 7 years ago

BTW- I have a different issue when I try to deploy a smart contract from my code (node.js) using web3. In order to deplopy it, I need to unlock the account, but since they don't expose private APIs (--rpcapi=private) this is not possible. So, unless I'm missing something, this is useless since you can't really do anything without being able to unlock accounts... :-|

salmanprk commented 7 years ago

Hi,

Could you outline what's the proposed solution?

Sent from my iPhone

On Aug 16, 2017, at 4:34 AM, Ami Turgman notifications@github.com<mailto:notifications@github.com> wrote:

I had the same issue, it turned out that somehow the password I used was messed-up. I discovered that buy ssh-ing the tx machine and running ps -ef to see that actual command that runs geth. In that command you'll be able to see the actual password that was used. It was mostly similar, but a few of the characters were messed-up.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-quickstart-templates/issues/3783#issuecomment-322742571, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEjQyCZ_05-KJcPHOBHrQLjaZpQQd8Z2ks5sYtOUgaJpZM4O4MCK.

amiturgman commented 7 years ago

You need to SSH into your tx VM, You'll be able to see the SSH endpoint after the deployment is done, by clicking on the "5 succeeded" link on the right side of the upper side screen of the resouce group. then, choose the "microsoft-azure-blockchain.azure-blockc..." link where you'll find the SSH to TX node details. After you ssh to the tx node, run "ps -ef" and look for the geth command. Then, look at the arguments that were provided as part of this command. One of them should be the actual password that was used. You might see that it is close to what you typed, but few of the characters were changed to something else. good luck.

gazambuja commented 7 years ago

Create your blockchain resources with some password without spaces or special char. (this is important). Access via SSH. Run:

> gethadmin@vmev3o67k-tx0:~$ ps -ef|grep nodejs

gethadm+  9523     1  0 15:56 ?        00:00:00 nodejs app.js 3000 /home/gethadmin/.ethereum/geth.ipc ad17c05379a4bd03ed5f0076d58da4a03285148c lsogjgER0kd1344br vmev3o67k-mn 2 vmev3o67k-tx 1 2

you password will be the second argument in this command... in this example: lsogjgER0kd1344br now you can do:


Welcome to the Geth JavaScript console!

instance: Geth/vmev3o37a-tx0/v1.6.0-stable-facc47cb/linux-amd64/go1.8.1
coinbase: 0xad17c02329a4bd03ed5a0376d58da4a01285148c
at block: 0 (Thu, 01 Jan 1970 00:00:00 UTC)
 datadir: /home/gethadmin/.ethereum
 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

> personal.unlockAccount(eth.coinbase)
Unlock account 0xad17c02329a4bd03ed5a0376d58da4a01285148c
Passphrase:
true```
tirthb commented 6 years ago

Thank you all. Worked for me after I got rid of special characters like dollar sign in password. Also, it was not using the passphrase, it was using ethereum password specified while setting up the ethereum consortium leader in azure.

therightstuff commented 6 years ago

I found the answer to https://stackoverflow.com/questions/48271310/geth-error-could-not-decrypt-key-with-given-passphrase helped me - for some reason unlocking using personal.unlockAccount(eth.accounts[0]) worked just fine when entering a blank passphrase (or personal.unlockAccount(eth.accounts[0], "", 15000) ) - I suspect there's an issue with the passphrase setting for the coinbase account