Electrum: Electrum GUI: Crashes trying to create a wallet in non-existing dir

Created on 4 Dec 2017  路  3Comments  路  Source: spesmilo/electrum

With Electrum 3.0.2 the app crashes when I try to create a new wallet, but specify a path with a directory that doesn't exist. It doesn't matter whether it is relative or absolute (I tried using '~' in the path, but that is interpreted relatively).

I'm using the NixOS Linux distribution, so the installation paths are a bit wacky, but that shouldn't affect the bug.

Traceback (most recent call last):
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 81, in func_wrapper
    out = func(*args, **kwargs)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 450, in choice_dialog
    self.exec_layout(vbox, title)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 316, in exec_layout
    raise GoBack
electrum_gui.qt.installwizard.GoBack

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 81, in func_wrapper
    out = func(*args, **kwargs)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 450, in choice_dialog
    self.exec_layout(vbox, title)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 316, in exec_layout
    raise GoBack
electrum_gui.qt.installwizard.GoBack

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 81, in func_wrapper
    out = func(*args, **kwargs)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 450, in choice_dialog
    self.exec_layout(vbox, title)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 316, in exec_layout
    raise GoBack
electrum_gui.qt.installwizard.GoBack

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/main_window.py", line 439, in new_wallet
    self.gui_object.start_new_window(full_path, None)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/__init__.py", line 199, in start_new_window
    wallet = wizard.run_and_get_wallet()
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 272, in run_and_get_wallet
    self.run(action)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 60, in run
    f(*args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 87, in new
    self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 91, in func_wrapper
    run_next(*out)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 105, in on_wallet_type
    self.run(action)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 60, in run
    f(*args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 137, in choose_keystore
    self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 83, in func_wrapper
    wizard.go_back() if wizard.can_go_back() else wizard.close()
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 72, in go_back
    self.run(action, *args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 60, in run
    f(*args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 87, in new
    self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 91, in func_wrapper
    run_next(*out)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 105, in on_wallet_type
    self.run(action)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 60, in run
    f(*args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 137, in choose_keystore
    self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 91, in func_wrapper
    run_next(*out)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 60, in run
    f(*args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 391, in choose_seed_type
    self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 83, in func_wrapper
    wizard.go_back() if wizard.can_go_back() else wizard.close()
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 72, in go_back
    self.run(action, *args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 60, in run
    f(*args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 137, in choose_keystore
    self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 83, in func_wrapper
    wizard.go_back() if wizard.can_go_back() else wizard.close()
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 72, in go_back
    self.run(action, *args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 60, in run
    f(*args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 87, in new
    self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 91, in func_wrapper
    run_next(*out)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 105, in on_wallet_type
    self.run(action)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 60, in run
    f(*args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 143, in import_addresses_or_keys
    self.add_xpub_dialog(title=title, message=message, run_next=self.on_import, is_valid=v)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum_gui/qt/installwizard.py", line 91, in func_wrapper
    run_next(*out)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/base_wizard.py", line 149, in on_import
    self.wallet.import_address(x)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/wallet.py", line 1466, in import_address
    self.storage.write()
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/util.py", line 208, in <lambda>
    return lambda *args, **kw_args: do_profile(func, args, kw_args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/util.py", line 204, in do_profile
    o = func(*args, **kw_args)
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/storage.py", line 166, in write
    self._write()
  File "/nix/store/wmk2cgha4yx4m33sp1cxarbfqm4h0i2q-electrum-3.0.2/lib/python3.6/site-packages/electrum/storage.py", line 182, in _write
    with open(temp_path, "w") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/Wallets/foo/wallet_1.tmp.1836'

In this cases '/home/user/Wallets' exists, but 'foo' does not. I've tested it with the 'Import Bitcoin addresses or private keys' option, not sure whether it happens when creating another wallet type.

The crash caused loss of labels I was editing. :/

bug 馃悶 topic-walletstorage 馃捑

Most helpful comment

Started electrum and in the gui installation/wallet creation wizard I typed a non-existent absolute path in the wallet field (/mnt/doesnotexist/somewallet).

  • I was able to create a standard wallet however electrum complains in the terminal that the file does not exist. It does not crash but neither does it write the wallet file to disk (not even in ~/.electrum/wallets like I thought it might do instead). So if you didn't save the wallet seed and sent money to this wallet your money would be lost.
  • Using the import bitcoin addresses or private keys option crashes the wizard like the @moredread said. Same goes for 2fa wallet and multisig wallet.

All 3 comments

Started electrum and in the gui installation/wallet creation wizard I typed a non-existent absolute path in the wallet field (/mnt/doesnotexist/somewallet).

  • I was able to create a standard wallet however electrum complains in the terminal that the file does not exist. It does not crash but neither does it write the wallet file to disk (not even in ~/.electrum/wallets like I thought it might do instead). So if you didn't save the wallet seed and sent money to this wallet your money would be lost.
  • Using the import bitcoin addresses or private keys option crashes the wizard like the @moredread said. Same goes for 2fa wallet and multisig wallet.

related: #5627

Was this page helpful?
0 / 5 - 0 ratings