Bitcoin Forum
November 10, 2024, 12:50:35 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: error loading electrum on ubuntu  (Read 1818 times)
digitalgrow (OP)
Hero Member
*****
Offline Offline

Activity: 704
Merit: 500


View Profile
April 30, 2015, 03:21:30 PM
 #1

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
ThomasV
Moderator
Legendary
*
Offline Offline

Activity: 1896
Merit: 1353



View Profile WWW
April 30, 2015, 04:09:15 PM
 #2

can you check the content of your wallet file?
also, which version are you using?

Electrum: the convenience of a web wallet, without the risks
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
April 30, 2015, 04:15:30 PM
 #3

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?
digitalgrow (OP)
Hero Member
*****
Offline Offline

Activity: 704
Merit: 500


View Profile
April 30, 2015, 04:18:37 PM
 #4

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 Smiley
digitalgrow (OP)
Hero Member
*****
Offline Offline

Activity: 704
Merit: 500


View Profile
April 30, 2015, 04:20:13 PM
 #5

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)
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
April 30, 2015, 04:37:22 PM
 #6

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) Roll Eyes

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
digitalgrow (OP)
Hero Member
*****
Offline Offline

Activity: 704
Merit: 500


View Profile
April 30, 2015, 04:47:15 PM
 #7

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
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
April 30, 2015, 04:51:20 PM
Last edit: April 30, 2015, 08:25:16 PM by btchris
 #8

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?
allgoodthings1
Sr. Member
****
Offline Offline

Activity: 270
Merit: 250


View Profile
April 30, 2015, 08:01:49 PM
 #9

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.

IRS 501(c)(3) Public Charities That Accept Bitcoin https://bitcointalk.org/index.php?topic=758674.0
Avoid U.S. Taxes on Bitcoin. Give to Charity. https://bitcointalk.org/index.php?topic=627860.0
digitalgrow (OP)
Hero Member
*****
Offline Offline

Activity: 704
Merit: 500


View Profile
April 30, 2015, 10:03:14 PM
 #10

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
digitalgrow (OP)
Hero Member
*****
Offline Offline

Activity: 704
Merit: 500


View Profile
April 30, 2015, 10:07:24 PM
 #11

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 Cheesy

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

Activity: 1896
Merit: 1353



View Profile WWW
May 02, 2015, 07:06:59 AM
 #12

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.

Electrum: the convenience of a web wallet, without the risks
Abdussamad
Legendary
*
Offline Offline

Activity: 3682
Merit: 1580



View Profile
May 02, 2015, 01:03:43 PM
 #13

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.
ThomasV
Moderator
Legendary
*
Offline Offline

Activity: 1896
Merit: 1353



View Profile WWW
May 02, 2015, 04:37:27 PM
 #14

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

Electrum: the convenience of a web wallet, without the risks
digitalgrow (OP)
Hero Member
*****
Offline Offline

Activity: 704
Merit: 500


View Profile
May 09, 2015, 02:53:10 PM
 #15

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 Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!