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

CorruptedDatabaseError: Failed to load database version: SQLError: no such table: MyInfo #2608

Closed
slrslr opened this issue Nov 1, 2016 · 21 comments
Milestone

Comments

@slrslr
Copy link

slrslr commented Nov 1, 2016

Tribler version/branch+revision:

One that was available 1st November 2016 at https://github.com/Tribler/tribler.git

Operating system and version:

Linux kali 4.6.0-kali1-686-pae #1 SMP Debian 4.6.4-1kali1 (2016-07-21) i686 GNU/Linux

Steps to reproduce the behavior:

I tried to install Tribler via command line inside Virtualbox VM.

sudo apt-get install libav-tools libjs-excanvas libjs-mootools libsodium* libx11-6 python-apsw python-cherrypy3 python-crypto python-cryptography python-feedparser python-leveldb python-libtorrent python-m2crypto python-netifaces python-pil python-pyasn1 python-twisted python-wxgtk3.0 python2.7 vlc-data* python-pip python-chardet python-configobj

sudo pip install decorator libnacl

git clone --recursive https://github.com/Tribler/tribler.git

cd tribler

./tribler.sh

ImportError: No module named cherrypy.lib.httputil

pip install cherrypy

./tribler.sh

/root/tribler/Tribler/Core/TorrentDef.py:9: RuntimeWarning: to-Python converter for boost::shared_ptrlibtorrent::alert already registered; second conversion method ignored.
from libtorrent import bencode, bdecode
ERROR 1478037226.50 util:239 Exception raised on the reactor's thread CorruptedDatabaseError: "Failed to load database version: SQLError: no such table: MyInfo".
Traceback from this thread:
File "Tribler/Main/tribler.py", line 95, in
main()
File "Tribler/Main/tribler.py", line 85, in main
run()
File "Tribler/Main/tribler.py", line 68, in run
run_main()
File "/root/tribler/Tribler/Main/tribler_main.py", line 930, in run
use_torrent_search=use_torrent_search, use_channel_search=use_channel_search)
File "/root/tribler/Tribler/Main/tribler_main.py", line 111, in init
use_torrent_search=use_torrent_search, use_channel_search=use_channel_search)
File "/root/tribler/Tribler/Main/tribler_main.py", line 330, in InitStage1
self.upgrader = session.prestart()
File "/root/tribler/Tribler/dispersy/util.py", line 46, in helper
return blockingCallFromThread(reactor, func, *args, **kargs)
File "/root/tribler/Tribler/dispersy/util.py", line 236, in blockingCallFromThread
this_thread_tb = traceback.extract_stack()

Traceback from the reactor's thread:
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(*args, **kw)
File "/root/tribler/Tribler/Core/Session.py", line 192, in prestart
self.sqlite_db.initialize()
File "/root/tribler/Tribler/dispersy/util.py", line 46, in helper
return blockingCallFromThread(reactor, func, *args, **kargs)
File "/root/tribler/Tribler/dispersy/util.py", line 225, in blockingCallFromThread
return f(*args, **kwargs)
File "/root/tribler/Tribler/Core/CacheDB/sqlitecachedb.py", line 87, in initialize
self._open_connection()
File "/root/tribler/Tribler/Core/CacheDB/sqlitecachedb.py", line 187, in _open_connection
raise CorruptedDatabaseError(msg)

Traceback (most recent call last):
File "/root/tribler/Tribler/Main/tribler_main.py", line 930, in run
use_torrent_search=use_torrent_search, use_channel_search=use_channel_search)
File "/root/tribler/Tribler/Main/tribler_main.py", line 111, in init
use_torrent_search=use_torrent_search, use_channel_search=use_channel_search)
File "/root/tribler/Tribler/Main/tribler_main.py", line 330, in InitStage1
self.upgrader = session.prestart()
File "/root/tribler/Tribler/dispersy/util.py", line 46, in helper
return blockingCallFromThread(reactor, func, *args, **kargs)
File "/root/tribler/Tribler/dispersy/util.py", line 240, in blockingCallFromThread
result.raiseException()
File "", line 2, in raiseException
CorruptedDatabaseError: Failed to load database version: SQLError: no such table: MyInfo

@devos50
Copy link
Contributor

devos50 commented Nov 3, 2016

Thanks for your report!

@devos50 devos50 added this to the V7.0 milestone Nov 3, 2016
@devos50
Copy link
Contributor

devos50 commented Nov 6, 2016

@slrslr can you try to backup your .Tribler directory (in ~/.Tribler), remove the original .Tribler dir and try again?

@slrslr
Copy link
Author

slrslr commented Nov 6, 2016

@devos50 here are commands i did and its results. Please let me know if anything else i should try.

COMMAND:
mv ~/.Tribler ~/.Tribler0
cd ~/.Tribler
RESULT:
bash: cd: /root/.Tribler: No such file or directory
COMMAND:
./tribler.sh
RESULT:
/root/tribler/Tribler/Core/TorrentDef.py:9: RuntimeWarning: to-Python converter for boost::shared_ptrlibtorrent::alert already registered; second conversion method ignored.
from libtorrent import bencode, bdecode
ERROR 1478464447.40 util:239 Exception raised on the reactor's thread SQLError: "SQLError: no such module: fts4".
Traceback from this thread:
File "Tribler/Main/tribler.py", line 95, in
main()
File "Tribler/Main/tribler.py", line 85, in main
run()
File "Tribler/Main/tribler.py", line 68, in run
run_main()
File "/root/tribler/Tribler/Main/tribler_main.py", line 930, in run
use_torrent_search=use_torrent_search, use_channel_search=use_channel_search)
File "/root/tribler/Tribler/Main/tribler_main.py", line 111, in init
use_torrent_search=use_torrent_search, use_channel_search=use_channel_search)
File "/root/tribler/Tribler/Main/tribler_main.py", line 330, in InitStage1
self.upgrader = session.prestart()
File "/root/tribler/Tribler/dispersy/util.py", line 46, in helper
return blockingCallFromThread(reactor, func, _args, *_kargs)
File "/root/tribler/Tribler/dispersy/util.py", line 236, in blockingCallFromThread
this_thread_tb = traceback.extract_stack()

Traceback from the reactor's thread:
File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(_args, *_kw)
File "/root/tribler/Tribler/Core/Session.py", line 192, in prestart
self.sqlite_db.initialize()
File "/root/tribler/Tribler/dispersy/util.py", line 46, in helper
return blockingCallFromThread(reactor, func, _args, *_kargs)
File "/root/tribler/Tribler/dispersy/util.py", line 225, in blockingCallFromThread
return f(_args, *_kwargs)
File "/root/tribler/Tribler/Core/CacheDB/sqlitecachedb.py", line 87, in initialize
self._open_connection()
File "/root/tribler/Tribler/Core/CacheDB/sqlitecachedb.py", line 176, in _open_connection
cursor.execute(sql_script)
File "src/cursor.c", line 236, in resetcursor

Traceback (most recent call last):
File "/root/tribler/Tribler/Main/tribler_main.py", line 930, in run
use_torrent_search=use_torrent_search, use_channel_search=use_channel_search)
File "/root/tribler/Tribler/Main/tribler_main.py", line 111, in init
use_torrent_search=use_torrent_search, use_channel_search=use_channel_search)
File "/root/tribler/Tribler/Main/tribler_main.py", line 330, in InitStage1
self.upgrader = session.prestart()
File "/root/tribler/Tribler/dispersy/util.py", line 46, in helper
return blockingCallFromThread(reactor, func, _args, *_kargs)
File "/root/tribler/Tribler/dispersy/util.py", line 240, in blockingCallFromThread
result.raiseException()
File "", line 2, in raiseException
SQLError: SQLError: no such module: fts4

@devos50
Copy link
Contributor

devos50 commented Nov 6, 2016

@slrslr thanks! It appears that an error occurred during the creation of the database, in particular, you don't have FTS4 support in your sqlite version. Can you post your sqlite version by running the following command?

dpkg-query -l | grep sqlite

@slrslr
Copy link
Author

slrslr commented Nov 6, 2016

dpkg-query -l | grep sqlite
ii libaprutil1-dbd-sqlite3:i386 1.5.4-2 i386 Apache Portable Runtime Utility Library - SQLite3 Driver
ii libdbd-sqlite3-perl 1.50-1 i386 Perl DBI driver with a self-contained RDBMS
ii libqt5sql5-sqlite:i386 5.6.1+dfsg-3+b1 i386 Qt 5 SQLite 3 database driver
ii libsqlite3-0:i386 3.14.1-1 i386 SQLite 3 shared library
ii python-pysqlite2 2.7.0-1 i386 Python interface to SQLite 3
ii ruby-dataobjects-sqlite3 0.10.16-1+b3 i386 SQLite adapter for ruby-dataobjects
ii ruby-dm-sqlite-adapter 1.2.0-0kali2+build1 all Sqlite3 Adapter for DataMapper
ii ruby-sqlite3 1.3.11-2 i386 SQLite3 interface for Ruby
ii sqlite3 3.14.1-1 i386 Command line interface for SQLite 3
ii sqlitebrowser 3.8.0-1 i386 GUI editor for SQLite databases

Can i enable/install FTS4 anyhow?

@devos50
Copy link
Contributor

devos50 commented Nov 6, 2016

Hmm it appears that the libsqlite3 on your system has not been compiled with FTS support. Do you see an opportunity to compile the sqlite3 library yourself (with passing the -DSQLITE_ENABLE_FTS4 flag)?

@slrslr
Copy link
Author

slrslr commented Nov 6, 2016

I would like to do it, but i do not know how. I followed tutorial how to compile sqlite3, but i do not know how to pass that flag, mind giving me command/s please? thx

sqlite-autoconf-3150100# ls -lh
total 8.8M
-rw-r--r-- 1 1000 users 364K Nov 4 08:21 aclocal.m4
-rwxr-xr-x 1 1000 users 7.2K Nov 4 08:21 compile
-rwxr-xr-x 1 1000 users 42K Nov 4 08:21 config.guess
-rwxr-xr-x 1 1000 users 36K Nov 4 08:21 config.sub
-rwxr-xr-x 1 1000 users 461K Nov 4 08:21 configure
-rw-r--r-- 1 1000 users 6.1K Nov 4 08:21 configure.ac
-rwxr-xr-x 1 1000 users 24K Nov 4 08:21 depcomp
-rw-r--r-- 1 1000 users 16K Nov 4 08:21 INSTALL
-rwxr-xr-x 1 1000 users 15K Nov 4 08:21 install-sh
-rw-r--r-- 1 1000 users 317K Nov 4 08:21 ltmain.sh
-rw-r--r-- 1 1000 users 718 Nov 4 08:21 Makefile.am
-rw-r--r-- 1 1000 users 37K Nov 4 08:21 Makefile.in
-rw-r--r-- 1 1000 users 27K Nov 4 08:21 Makefile.msc
-rwxr-xr-x 1 1000 users 6.8K Nov 4 08:21 missing
-rw-r--r-- 1 1000 users 3.5K Nov 4 08:21 README.txt
-rw-r--r-- 1 1000 users 7.2K Nov 4 08:21 Replace.cs
-rw-r--r-- 1 1000 users 178K Nov 4 08:21 shell.c
-rw-r--r-- 1 1000 users 8.8K Nov 4 08:21 sqlite3.1
-rw-r--r-- 1 1000 users 6.7M Nov 4 08:21 sqlite3.c
-rw-r--r-- 1 1000 users 30K Nov 4 08:21 sqlite3ext.h
-rw-r--r-- 1 1000 users 480K Nov 4 08:21 sqlite3.h
-rw-r--r-- 1 1000 users 267 Nov 4 08:21 sqlite3.pc.in
-rw-r--r-- 1 1000 users 2.0K Nov 4 08:21 sqlite3.rc
drwxr-xr-x 6 1000 users 4.0K Nov 4 08:21 tea

@devos50
Copy link
Contributor

devos50 commented Nov 8, 2016

@slrslr try to following command when building:

make CFLAGS=-DSQLITE_ENABLE_FTS4=1

@slrslr
Copy link
Author

slrslr commented Nov 8, 2016

@devos50
so i did:

./configure
make CFLAGS=-DSQLITE_ENABLE_FTS4=1
make check
make install
make clean
./tribler.sh

The result:

...some code here...
CorruptedDatabaseError: Failed to load database version: SQLError: no such table: MyInfo

@devos50
Copy link
Contributor

devos50 commented Nov 8, 2016

@slrslr please remove the Tribler state dir (~/.Tribler) and try again 👍

@slrslr
Copy link
Author

slrslr commented Nov 8, 2016

@devos50
so i did:

mv ~/.Tribler ~/.Tribler0
./tribler.sh

now the error is:

...some code here...
SQLError: SQLError: no such module: fts4

dpkg-query -l | grep sqlite
returns: this

@loadletter
Copy link

loadletter commented Nov 9, 2016

I ran in the same issue some time ago.
It's not sqlite but apsw lacking FTS4 support, I solved it by manually downloading and building (will probably require libsqlite3-dev if not installed) apsw with:

python setup.py build --enable-all-extensions

More info @ https://rogerbinns.github.io/apsw/build.html

@devos50
Copy link
Contributor

devos50 commented Nov 10, 2016

@loadletter thank you for the info!

@slrslr please let me know whether this works for you 👍

@slrslr
Copy link
Author

slrslr commented Nov 10, 2016

Im a newbie in this so i am unsure how to install properly.
I did:

git clone https://github.com/rogerbinns/apsw.git
cd apsw
python setup.py build --enable-all-extensions
apt-get install libsqlite3-dev
rm -rf ~/.Tribler
/root/tribler/tribler.sh

but returns:

/root/tribler/Tribler/Core/TorrentDef.py:9: RuntimeWarning: to-Python converter for boost::shared_ptrlibtorrent::alert already registered; second conversion method ignored.
from libtorrent import bencode, bdecode
ERROR 1478799581.50 util:239 Exception raised on the reactor's thread SQLError: "SQLError: no such module: fts4".

@devos50
Copy link
Contributor

devos50 commented Nov 10, 2016

@slrslr you're not installing the newly built apsw. Please also run the following command after building apsw:

python setup.py install

so the library gets copied to the site-packages directory.

@slrslr
Copy link
Author

slrslr commented Nov 10, 2016

i did:

cd apsw
python setup.py install
rm -rf ~/.Tribler
/root/tribler/tribler.sh

error is the same (no such module fts4)

@loadletter
Copy link

loadletter commented Nov 11, 2016

Try running this:

apt-get purge python-apsw
cd apsw
python2 setup.py build --enable-all-extensions --sqlite install

The --sqlite flag should tell apsw to build it's own copy of sqlite

@slrslr
Copy link
Author

slrslr commented Nov 11, 2016

loadletter: that did not work. "error: option --sqlite not recognized"
so i did same command, only replace install by fetch. And also tried:
"python2 setup.py build --enable=fts4 install"
still tribler complains about missing fts4

@loadletter
Copy link

Try

cat /root/tribler/Tribler/schema_sdb_v29.sql | sqlite3 /tmp/test.db

If it still gives an error then it's caused by sqlite, otherwise there's something wrong with the python environment

@slrslr
Copy link
Author

slrslr commented Nov 15, 2016

Thx, seems something is wrong with python environment then.

@devos50
Copy link
Contributor

devos50 commented Jan 12, 2017

@slrslr did you manage to fix this? Since it's not an issue in Tribler itself, I will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants