Bitcoin Forum

Bitcoin => Electrum => Topic started by: digitalgrow on April 30, 2015, 03:21:30 PM



Title: error loading electrum on ubuntu
Post by: digitalgrow on April 30, 2015, 03:21:30 PM
hi guys, can anyone help

Im using electrum on ubuntu and it wont load for some reason

checked the terminal and get this:

Traceback (most recent call last):
  File "/usr/local/bin/electrum", line 204, in <module>
    gui.main(url)
  File "/usr/local/lib/python2.7/dist-packages/electrum_gui/qt/__init__.py", line 84, in main
    storage = WalletStorage(self.config)
  File "/usr/local/lib/python2.7/dist-packages/electrum/wallet.py", line 82, in __init__
    self.read(self.path)
  File "/usr/local/lib/python2.7/dist-packages/electrum/wallet.py", line 123, in read
    raise IOError("Cannot read wallet file.")
IOError: Cannot read wallet file.


Any ideas on what to do to fix it?

Many thanks


Title: Re: error loading electrum on ubuntu
Post by: ThomasV on April 30, 2015, 04:09:15 PM
can you check the content of your wallet file?
also, which version are you using?


Title: Re: error loading electrum on ubuntu
Post by: btchris on April 30, 2015, 04:15:30 PM
This should give a more specific error message:

Code:
python -c 'import ast;import sys;ast.literal_eval(open(sys.argv[1]).read().replace(", '",",\n'"))' ~/.electrum/wallets/default_wallet

(FYI I'm assuming 1.9.x based on OP's initial traceback.)

Also, do you have your seed?


Title: Re: error loading electrum on ubuntu
Post by: digitalgrow on April 30, 2015, 04:18:37 PM
can you check the content of your wallet file?
also, which version are you using?

Hi and thanks for the speedy reply, I was using version 1.9.7-1 and couldnt check the content of the wallet file

I have the seed and just about try uninstalling and using newest version, but will try to figure error before doing so, will try the thing you mentioned btchris

Thanks again for your help :)


Title: Re: error loading electrum on ubuntu
Post by: digitalgrow on April 30, 2015, 04:20:13 PM
This should give a more specific error message:

Code:
python -c 'import ast;import sys;ast.literal_eval(open(sys.argv[1]).read().replace(", '",",\n'"))' ~/.electrum/wallets/default_wallet

(FYI I'm assuming 1.9.x based on OP's initial traceback.)

Also, do you have your seed?

thanks mate, just tried this and got

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: replace() takes at least 2 arguments (1 given)


Title: Re: error loading electrum on ubuntu
Post by: btchris on April 30, 2015, 04:37:22 PM
thanks mate, just tried this and got

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: replace() takes at least 2 arguments (1 given)

That's cause I messed it up (and didn't even bother testing it) ::)

Can you give this a try?
Code:
python -c "import ast;import sys;ast.literal_eval(open(sys.argv[1]).read().replace(\", '\",\",\n'\"))" ~/.electrum/wallets/default_wallet


Title: Re: error loading electrum on ubuntu
Post by: digitalgrow on April 30, 2015, 04:47:15 PM
lol nw, thanks mate tried that and got this

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
TypeError: compile() expected string without null bytes


Title: Re: error loading electrum on ubuntu
Post by: btchris on April 30, 2015, 04:51:20 PM
TypeError: compile() expected string without null bytes

That's not good. Do these return anything? (don't post anything sensitive / anything that might be a key!)

Code:
ls -l ~/.electrum/wallets/
strings ~/.electrum/wallets/default_wallet

Also, you didn't answer if you have your seed written down, do you?


Title: Re: error loading electrum on ubuntu
Post by: allgoodthings1 on April 30, 2015, 08:01:49 PM
A little late to the game here.. but my first question would be whether you downloaded Electrum from the Ubuntu repository [always safe], or tried doing something different.


Title: Re: error loading electrum on ubuntu
Post by: digitalgrow on April 30, 2015, 10:03:14 PM
TypeError: compile() expected string without null bytes

That's not good. Do these return anything? (don't post anything sensitive / anything that might be a key!)

Code:
ls -l ~/.electrum/wallets/
strings ~/.electrum/wallets/default_wallet

Also, you didn't answer if you have your seed written down, do you?

Hey buddy, sorry for late reply

tried that and got a list of characters and numbers

Luckily I had the seed and after deleting and creating a new wallet it worked, phew!

Thanks for all your help, as Im a linux noob will probably just keep it on my windows comp from now


Title: Re: error loading electrum on ubuntu
Post by: digitalgrow on April 30, 2015, 10:07:24 PM
A little late to the game here.. but my first question would be whether you downloaded Electrum from the Ubuntu repository [always safe], or tried doing something different.

Yeah mate downloaded from repository following steps on electrums website

Lucikly had the seed and managed to restore from seed after installing again, didnt know how I broke it but thank f... for the seed :D

Lesson learnt and advice to anyone else, ALWAYS write down the seed, chances are 100% that you will need it sometime in the future


Title: Re: error loading electrum on ubuntu
Post by: ThomasV on May 02, 2015, 07:06:59 AM
Thanks for all your help, as Im a linux noob will probably just keep it on my windows comp from now

I would rather not do that.

As of version 2.1, we added atomic writes to save the wallet; it should prevent wallet file corruption.
https://github.com/spesmilo/electrum/blob/master/lib/wallet.py#L142
Unfortunately, atomic writes are only supported by posix sysytems, so that will not work on Windows.

In addition, Linux is a much more secure environment.


Title: Re: error loading electrum on ubuntu
Post by: Abdussamad on May 02, 2015, 01:03:43 PM
As of version 2.1, we added atomic writes to save the wallet; it should prevent wallet file corruption.
https://github.com/spesmilo/electrum/blob/master/lib/wallet.py#L142
Unfortunately, atomic writes are only supported by posix sysytems, so that will not work on Windows.

Have you considered using sqlite? I just looked it up and it is ACID compliant.


Title: Re: error loading electrum on ubuntu
Post by: ThomasV on May 02, 2015, 04:37:27 PM
Have you considered using sqlite? I just looked it up and it is ACID compliant.
yes, but I am also trying to keep the number of dependencies reasonable


Title: Re: error loading electrum on ubuntu
Post by: digitalgrow on May 09, 2015, 02:53:10 PM
Thanks for all your help, as Im a linux noob will probably just keep it on my windows comp from now

I would rather not do that.

As of version 2.1, we added atomic writes to save the wallet; it should prevent wallet file corruption.
https://github.com/spesmilo/electrum/blob/master/lib/wallet.py#L142
Unfortunately, atomic writes are only supported by posix sysytems, so that will not work on Windows.

In addition, Linux is a much more secure environment.

Cheers Thomas, I am going to reinstall it on my linux computer with the 2.1 version and see how it goes :)