Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to access wallet using ethereum/client-go and --keystore *if* the wallet is a symbolic link #16793

Closed
DazWilkin opened this issue May 24, 2018 · 6 comments

Comments

@DazWilkin
Copy link

System information

Geth version: instance=Geth/v1.8.9-unstable-415969f5/linux-amd64/go1.10.2

OS & Version: Linux

Summary

It appears (!) that symbolic links to wallets are treated differently (incorrectly). The reason this is an issue is that, when trying to run Ethereum on Kubernetes, it would be useful to represent wallet file(s) using Kubernetes Secrets|ConfigMaps. Secrets|ConfigMaps present encapsulated files as symbolic links. This is how I uncovered this issue. The repro works without Kubernetes, using Docker and flipping between underlying and symbolic links to a wallet.

Expected behaviour

Using Console, I expect personal to list my wallet

Actual behaviour

If the file in /keystore is a symbolic link to a wallet, it does not work:

personal
{
  listAccounts: [],
  listWallets: [],
...
}

if the single file in /keystore is the original file (backing the symbolic link), it works:

personal
{
  listAccounts: ["0x3df6..."],
  listWallets: [{
      accounts: [{...}],
      status: "Locked",
      url: "keystore:///keystore/UTC--2018-00-00T00-00-00.000000000Z--3df6..."
  }],

Steps to reproduce the behaviour

ls $PWD/keystore
UTC--2018-00-00T00-00-00.000000000Z--3df6...

mkdir $PWD/lnkeystore
ln -s $PWD/keystore/UTC--2018-00-00T00-00-00.000000000Z--3df6... $PWD/lnkeystore

ls $PWD/lnkeystore
UTC--2018-00-00T00-00-00.000000000Z--3df6...

Node-1: Works with $PWD/keystore

docker run \
--rm \
--interactive \
--net=host \
--tty \
--volume=$PWD/keystore:/keystore \
ethereum/client-go \
  --rinkeby \
  --keystore=/keystore  \
  --rpc \
  --rpcaddr=0.0.0.0 \
  --rpcapi="db,eth,net,personal,web3"

Node-1: Doesn't work with $PWD/lnkeystore

docker run \
--rm \
--interactive \
--net=host \
--tty \
--volume=$PWD/lnkeystore:/keystore \
ethereum/client-go \
  --rinkeby \
  --keystore=/keystore  \
  --rpc \
  --rpcaddr=0.0.0.0 \
  --rpcapi="db,eth,net,personal,web3"

Node-2: Console

docker run \
--rm \
--interactive \
--tty \
ethereum/client-go \
  attach http://localhost:8545 \
  console

Backtrace

[backtrace]
@karalabe
Copy link
Member

Ping @fjl @holiman

@DazWilkin
Copy link
Author

I have a workaround while this issue is repro'd/resolved:

I am able to use a Kubernetes init containers to copy the wallet file(s) out of the Secret|ConfigMap (/keystore) into an emptyDir volume (/cache) before the Ethereum node starts.

Then, when the Ethereum node starts, it is configured with --keystore to the copy and it works :-(

It would be preferable to access the wallet(s) directly (through symbolic links) but this hack permits me to continue working. Medium post "Ethereum on Google Cloud Platform" (feedback always welcome)

@rawfalafel
Copy link

hey @DazWilkin, can you try the fix in #17256 if you're still using the above workaround?

@DazWilkin
Copy link
Author

I will try this today!

@DazWilkin
Copy link
Author

Yes, this appears to work for me. Thank you!

@stale
Copy link

stale bot commented Jul 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot closed this as completed Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants