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

Account alias already exist error when there is no account #1245

Closed
2 tasks done
SuharH opened this issue Jul 1, 2022 · 1 comment
Closed
2 tasks done

Account alias already exist error when there is no account #1245

SuharH opened this issue Jul 1, 2022 · 1 comment
Assignees
Labels
b-nodejs Bindings - Nodejs bug Bug
Milestone

Comments

@SuharH
Copy link

SuharH commented Jul 1, 2022

Issue description

I am trying to create a new wallet for a user that already has one. In order to do that, first, I delete everything related to that wallet (stronghold file and DB) and after that, I proceed to create the new wallet. The first time it creates the wallet correctly. But if I repeat the process, i.e., delete the wallet and create a new one, the deletion is done successfully but in the creation, the following error appears: Error: can't create account: account alias already exists.
I found the following pull regarding the keeping of the accounts on the memory: #174
I am not sure if it has something to do with this issue.

Version

@iota/wallet: 1.0.17

Expected behaviour

The expected behaviour should be that the wallet is created correctly the second time as well, similarly to what happens with the first time the wallet is restored.

Actual behaviour

The second time the wallet is restored, the following error appears:

~/walletService/node_modules/@iota/wallet/lib/binding/accountManager.js:106
        let acc = createAccount.apply(this.accountManager, [
                                ^

Error: can't create account: account alias already exists
    at AccountManager.createAccount (~/iota-for-iiot/walletService/node_modules/@iota/wallet/lib/binding/accountManager.js:106:33)
    at createWallet (~/iota-for-iiot/walletService/walletRestoration.js:43:21)
    at restoreWallet (~/iota-for-iiot/walletService/walletRestoration.js:11:32)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Can the issue reliably be reproduced?

Yes

Steps to reproduce the issue

walletRestoration.txt
PD: This should be a .js file but since GitHub doesn't support it, I uploaded it as a .txt file

Errors

~/iota-for-iiot/walletService/node_modules/@iota/wallet/lib/binding/accountManager.js:106
        let acc = createAccount.apply(this.accountManager, [
                                ^

Error: can't create account: account alias already exists
    at AccountManager.createAccount (~/iota-for-iiot/walletService/node_modules/@iota/wallet/lib/binding/accountManager.js:106:33)
    at createWallet (~/iota-for-iiot/walletService/walletRestoration.js:43:21)
    at restoreWallet (~/iota-for-iiot/walletService/walletRestoration.js:11:32)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Duplicate declaration

  • I have searched the issues tracker this issue and there is none

Code of Conduct

  • I agree to follow this project's Code of Conduct
@thibault-martinez thibault-martinez added this to the v1.0.0 milestone Jul 4, 2022
@Thoralf-M Thoralf-M removed this from the v1.0.0 milestone Jul 4, 2022
@thibault-martinez thibault-martinez added this to the v0.0.0 milestone Aug 15, 2022
@thibault-martinez thibault-martinez removed this from the v0.0.0 milestone Mar 5, 2023
@thibault-martinez thibault-martinez changed the title [Bug]: Account alias already exist error when there is no account Account alias already exist error when there is no account Mar 6, 2023
@thibault-martinez thibault-martinez added the bug Bug label Mar 6, 2023
@thibault-martinez thibault-martinez added this to the v0.2.0 milestone Mar 6, 2023
@thibault-martinez thibault-martinez added the b-nodejs Bindings - Nodejs label Mar 9, 2023
@Thoralf-M
Copy link
Member

Hello, finally got time to do it
The accounts where still in memory, you can now import and call await dropAccountsAndStorages() to clean it up
Tested it with your example by adding it in removeDir()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b-nodejs Bindings - Nodejs bug Bug
Projects
None yet
Development

No branches or pull requests

3 participants