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);
        });
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)
  • 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 3:03
  • Abvouisly, if your node says that your account is not unlocked, it is not. I don't know why. – Florian Castelain Nov 23 '17 at 3:06
0

i recommend this solution

personal.unlockAccount(Address, Password, 0)

0 is unlock no time limit

  • invalid argument 1: json: cannot unmarshal hex string without 0x prefix into Go value of type hexutil.Bytes – porton Apr 5 '18 at 0:00
  • Address is 0x~~~ you should make account first – Sanghyun Sim Apr 10 '18 at 4:17
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.