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.

Error: Returned error: Method personal_sign not supported.

See original GitHub issue

Expected Behavior

When using web3.eth.personal.sign, the client should return a signature based off of the message and address.

When running in a web browser using the same version of Web3 as Truffle (v1.0.0-beta.37) I use Metamask to sign the message and am returned a valid signature.

Current Behavior

When trying to use web3.eth.personal.sign I receive the error message “Error: Returned error: Method personal_sign not supported.”

Ganache’s logs report:

[02:16:45]  <         "stack": "Error: Method personal_sign not supported.
    at GethApiDouble.handleRequest (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/lib/subproviders/geth_api_double.js:67:16)
    at next (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/index.js:116:18)
    at GethDefaults.handleRequest (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/lib/subproviders/gethdefaults.js:15:12)
    at next (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/index.js:116:18)
    at SubscriptionSubprovider.FilterSubprovider.handleRequest (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/subproviders/filters.js:89:7)
    at SubscriptionSubprovider.handleRequest (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/subproviders/subscriptions.js:136:49)
    at next (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/index.js:116:18)
    at DelayedBlockFilter.handleRequest (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/lib/subproviders/delayedblockfilter.js:31:3)
    at next (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/index.js:116:18)
    at RequestFunnel.handleRequest (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/lib/subproviders/requestfunnel.js:32:12)
    at next (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/index.js:116:18)
    at Web3ProviderEngine._handleAsync (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/index.js:103:3)
    at Timeout._onTimeout (/tmp/.mount_Ganachsr17Gc/resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/index.js:87:12)
    at ontimeout (timers.js:469:11)
    at tryOnTimeout (timers.js:304:5)
    at Timer.listOnTimeout (timers.js:264:5)",

Possible Solution

I guess personal_sign needs to be implemented? I’m assuming it is Ganache which needs to provide the RPC endpoint for personal_sign when web3 calls it?

Steps to Reproduce (for bugs)

  1. Launch a truffle console connected to Ganache: > truffle console
  2. From within truffle console, set up a message and attempt to sign it:
truffle(ganache)> var message = "Hello, World!"
truffle(ganache)> var accounts = await web3.eth.getAccounts()
truffle(ganache)> var sig = await web3.eth.personal.sign(message, accounts)

web3.eth.personal.sign will throw an error:

Thrown:
Error: Returned error: Method personal_sign not supported.
    at XMLHttpRequest._onHttpResponseEnd (/home/myhome/.npm_modules/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:318:1)
    at XMLHttpRequest._setReadyState (/home/myhome/.npm_modules/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:208:1)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/myhome/.npm_modules/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)
    at XMLHttpRequest.request.onreadystatechange (/home/myhome/.npm_modules/lib/node_modules/truffle/build/webpack:/~/web3-providers-http/src/index.js:96:1)
    at /home/myhome/.npm_modules/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:112:1
    at /home/myhome/.npm_modules/lib/node_modules/truffle/build/webpack:/~/web3-core-requestmanager/src/index.js:140:1
    at Object.ErrorResponse (/home/myhome/.npm_modules/lib/node_modules/truffle/build/webpack:/~/web3-core-requestmanager/~/web3-core-helpers/src/errors.js:29:1)

Context

Am unable to run unit/functional tests using truffle test against anything requiring web3.eth.personal.sign. Currently, all testing for anything requiring personal.sign needs to be run from a web browser.

Your Environment

Ubuntu Linux 18.04 Ganache 2.1.0

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
nicholasjpaternocommented, Jan 21, 2020

Thanks @haydenyoung for opening this issue! I apologize that we haven’t had a chance to triage this yet and a big thanks to @NicolasKritter for keeping this issue alive! I think I’ll have a chance to address this sometime within the next few days.

0reactions
davidmurdochcommented, Jan 5, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Returned error: Method personal_sign not supported. ...
When trying to use web3.eth.personal.sign I receive the error message "Error: Returned error: Method personal_sign not supported.".
Read more >
Method personal_sign not supported [duplicate]
I'm trying to use personal_sign and getting not supported error. I'm using web3 v 0.20.1. I first tried using infura and was not...
Read more >
ConsenSys/truffle - Gitter
The error message being "Error: Returned error: Method personal_sign not supported." rather than something like "call to undefined" or something similar ...
Read more >
Problem with "Personal_Sign" in ethereum.request - ...
The error message is: code: -32602 message: "Invalid parameters: must provide an Ethereum address." Has something changed? I could not find any ...
Read more >
[SOLVED] Verifying a signedMessage
Hey ivan, has there been progress on this matter? I tried using web3.eth.personal.ecRecover on cloud functions and it doesn't seem to work
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