1

We're using Microsoft Azure, and NodeJS on the server. When we address Microsoft Azure via NodeJS, sometimes we get the 'Password or Unlock' error. But when we use Truffle and address the same setter, everything works fine. What could be the possible problem and what does this error mean as I've unlocked my account.

This is my code:

this.web3.eth.getCoinbase()
        .then(coinbase => {
            console.log("Setter method started!");
            return this.contract.methods
                .setCopyright(
                    queryParams.certificateNumber,
                    queryParams.typeString,
                    queryParams.nameOfObject,
                    queryParams.firstName,
                    queryParams.secondName,
                    queryParams.lastName
                )
                .send({
                    from: coinbase,
                    gas: 4600000,
                    gasPrice: '22000'
                });
        })
        .then(resolve)
        .catch(err => {
            reject(err);
        });

3 Answers3

1

When sending a transaction, you don't "unlock personal", you unlock the account that sends the transaction.

In this case, you could do:

return web3.personal.unlockAccount(ADDRESS, PASSWORD, TIME (if needed) );
.then(do whatever you want after that)
Itération 122442
  • 2,052
  • 1
  • 12
  • 33
  • Sorry, but i know about it. I does it, and my problem it is not problem "unlock accounted" , when i ask my setter function sometimes i have error "authentication needed: password or unlock". But my account is unlocked. That error only on my nodejs project, but my setter function on truffle call correctly. Why? – Zhanbolat Nurutdin Nov 23 '17 at 03:03
  • Abvouisly, if your node says that your account is not unlocked, it is not. I don't know why. – Itération 122442 Nov 23 '17 at 03:06
1

i recommend this solution

personal.unlockAccount(Address, Password, 0)

0 is unlock no time limit

0

I found solution.If someone needs it in the future: First i created multi-member(Ethereum Leader and Ethereum Member) in Azure and it did not work. Then I removed all groups multi-member and create one group "Blockchain". And is correctly worked.