Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Node.js, PHP and APIs

The Geth console no longer knows personal.newAccount or unlockAccount

Your error

ReferenceError: personal is not defined2 more lines it can show

Fix it fast

Most common cause, 1 of 2

Geth v1.14.12 and newer removed the personal namespace

Replace each call with its successor.

Fix
# create a key in the node's keystore (asks for a password)
geth account new --datadir ./node1

# run Geth with Clef as the signer
geth --datadir ./node1 --signer=./clef/clef.ipc

# in the console, list accounts (Clef asks you to approve)
eth.accounts
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

ReferenceError: personal is not defined appears in the Geth console because Geth v1.14.12 removed the personal namespace; from v1.11.0 to v1.14.11 it existed but was off unless started with --rpc.enabledeprecatedpersonal. Create accounts with geth account new, list them with eth.accounts, and sign through an external signer such as Clef. Applies to Geth 1.17.

  • Applies to Geth v1.17.10, Geth v1.11.0 to v1.14.11 for cause 2
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Print the Geth version. v1.14.12 or newer is cause 1, where no flag brings personal back; v1.11.0 to v1.14.11 is cause 2.

Run this first
geth version

Then find the line you see in this list and open its fix:

  1. 1Geth v1.14.12 and newer removed the personal namespacegeth version prints 1.14.12 or later, and every personal_* call fails, whatever flags you pass
  2. 2Geth v1.11 to v1.14.11 ships personal turned offgeth version prints a release from 1.11.0 to 1.14.11, and the node was started without --rpc.enabledeprecatedpersonal

What does the error look like?

  • ReferenceError: personal is not defined
  • the method personal_newAccount does not exist/is not available
  • the method personal_unlockAccount does not exist/is not available

Cause 1 of 2

Geth v1.14.12 and newer removed the personal namespace

You seegeth version prints 1.14.12 or later, and every personal_* call fails, whatever flags you pass

Check

The personal is not defined error comes from Geth's v1.14.12 release, which removed the personal RPC namespace after a long deprecation and also dropped the --unlock flag. Tutorials that start with personal.newAccount or personal.unlockAccount were written for older nodes.

Check
geth attach --exec "typeof personal" ./node1/geth.ipc

Fix

Replace each call with its successor. Accounts are created with geth account new or Clef's newaccount, listed with eth.accounts, and transactions are signed by an external signer that Geth reaches through --signer. Since v1.17.4, Clef is no longer part of Geth and lives in its own repository, github.com/ethereum/clef.

Fix
# create a key in the node's keystore (asks for a password)
geth account new --datadir ./node1

# run Geth with Clef as the signer
geth --datadir ./node1 --signer=./clef/clef.ipc

# in the console, list accounts (Clef asks you to approve)
eth.accounts

Verify

geth account new prints the new address, and eth.accounts in the console lists it after Clef approves the request.

Verify
geth attach --exec "eth.accounts" ./node1/geth.ipc

Confirmed by github.com

Did this fix it?

Cause 2 of 2

Geth v1.11 to v1.14.11 ships personal turned off

You seegeth version prints a release from 1.11.0 to 1.14.11, and the node was started without --rpc.enabledeprecatedpersonal

Check

From v1.11.0, the personal namespace was deprecated and only answered when Geth was started with the --rpc.enabledeprecatedpersonal flag. On those versions the code still exists, so the error means the flag is missing.

Check
ps aux | grep -o "rpc.enabledeprecatedpersonal"

Fix

As a stopgap on these versions, restart the node with the flag. Plan the move to geth account new and an external signer anyway, because upgrading past v1.14.11 removes the namespace for good.

Fix
geth --datadir ./node1 --rpc.enabledeprecatedpersonal

Verify

typeof personal in the console prints object instead of undefined.

Verify
geth attach --exec "typeof personal" ./node1/geth.ipc

Confirmed by github.com

Did this fix it?

How do I stop it coming back?

  • Pin the Geth version in your node setup scripts, and read its release notes before an upgrade on a private network.
  • Keep key creation in a script that calls geth account new with --datadir, instead of console commands copied from old tutorials.
  • Move transaction signing out of the node into an external signer, so a removed RPC namespace no longer breaks your app.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.