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

Importing an already existing account results in infinite loop #11130

Closed
chpiatt opened this issue Jul 28, 2022 · 6 comments
Closed

Importing an already existing account results in infinite loop #11130

chpiatt opened this issue Jul 28, 2022 · 6 comments
Assignees
Labels
Priority: Low Low priority item UX cosmetic / user experience related

Comments

@chpiatt
Copy link

chpiatt commented Jul 28, 2022

Description

When attempting to import a validator account via prysm validator accounts import, if the account already exists in the wallet directory prysm gets caught in an infinite loop.

Has this worked before in a previous version?

Not sure

🔬 Minimal Reproduction

I'm calling validator accounts import and setting the --wallet-dir to a directory that may or may not have already imported the given wallet. In the case where the given wallet has already been imported prysm prints an error and then retries importing the wallet ad infinitum.

🔥 Error


Importing accounts, this may take a while...

Importing accounts... 100% [�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m] [0s:0s]�[0m

time="2022-07-28 20:13:48" level=fatal msg="Could not import accounts: could not write accounts: file already exists without proper 0600 permissions" prefix=accounts

Importing accounts, this may take a while...

Importing accounts... 100% [�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m�[32m=�[0m] [0s:0s]�[0m

time="2022-07-28 20:13:48" level=fatal msg="Could not import accounts: could not write accounts: file already exists without proper 0600 permissions" prefix=accounts

🌍 Your Environment

I'm using prysm via Docker with tag = HEAD-f9b3cd.

Managed by Kubernetes, with this image running as an initContainer

@rauljordan
Copy link
Contributor

cc @james-prysm interesting bug here!

@james-prysm
Copy link
Contributor

Interesting I'll look into this asap, there seems to be an issue with permissions from the description in the logs but will try to reproduce locally.

@james-prysm james-prysm self-assigned this Jul 29, 2022
@james-prysm
Copy link
Contributor

Hi @chpiatt i tested locally ( Mac Os) on the latest version and believe that this is a permission issue as stated in the logs "file already exists without proper 0600 permissions" you will need rw access on the files when accessing which is what I believe is causing this error.

@chpiatt
Copy link
Author

chpiatt commented Jul 29, 2022

I think maybe it makes more sense to exit cleanly if the file permissions don't allow to overwrite the existing accounts instead of looping indefinitely, but I'll leave that up to you guys.

In the meantime, if anyone else is trying to import accounts via an initContainer on Kubernetes and running into a similar issue with the default file permissions, a simple workaround that is now working for me is just adding another initContainer before prysm runs that sets the permissions explicitly:

initContainers:
  - name: volume-permissions
    image: busybox
    command: ["sh", "-c", "chmod -Rv 600 /data/* || echo no files in /data, skipping permissions edit"]
    volumeMounts:
      - name: data
        mountPath: /data
  - name: validator-init
    image: validator-image
    imagePullPolicy: Always
    args:
    - accounts
    - import
    - --keys-dir=/keys/keys
    - --wallet-password-file=/walletpass/password
    - --account-password-file=/accountpass/password
    - --ropsten
    - --accept-terms-of-use
    - --wallet-dir=/data
    volumeMounts:
      - name: data
        mountPath: /data
      - name: walletpass
        mountPath: /walletpass
      - name: accountpass
        mountPath: /accountpass
      - name: validator-keys
        mountPath: /keys

@james-prysm
Copy link
Contributor

will add to my backlog for this case as an item to possibly improve ux. will close this issue for the time being and get it added to the docs as a possible common issue/solution.

@james-prysm
Copy link
Contributor

docs look to be added, tagging with a lower priority to address UX in the future

@james-prysm james-prysm added UX cosmetic / user experience related Priority: Low Low priority item labels Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Low priority item UX cosmetic / user experience related
Projects
None yet
Development

No branches or pull requests

3 participants