1

After uncompressing web2py latest source on Linux Redhat 64bit (Python 2.7.3), I start the server and the first call generates this stack trace:

test@test:~/web2py> python web2py.py --ip xxx.xxx.xxx.xxx
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2012
Version 2.2.1 (2012-10-21 16:57:04) stable
Database drivers available: MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib)
WARNING:web2py:GUI not available because Tk library is not installed

choose a password:
please visit:
        http://xxx.xxx.xxx.xxx:8000
use "kill -SIGTERM 4341" to shutdown the web2py server
DEBUG: connect attempt 0, connection error:
Traceback (most recent call last):
  File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
    self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
    if do_connect: self.find_driver(adapter_args)
  File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
    raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
DEBUG: connect attempt 1, connection error:
Traceback (most recent call last):
  File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
    self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
    if do_connect: self.find_driver(adapter_args)
  File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
    raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
DEBUG: connect attempt 2, connection error:
Traceback (most recent call last):
  File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
    self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
    if do_connect: self.find_driver(adapter_args)
  File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
    raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
DEBUG: connect attempt 3, connection error:
Traceback (most recent call last):
  File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
    self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
    if do_connect: self.find_driver(adapter_args)
  File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
    raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting
DEBUG: connect attempt 4, connection error:
Traceback (most recent call last):
  File "/home/aomoper/web2py/gluon/dal.py", line 6755, in __init__
    self._adapter = ADAPTERS[self._dbname](**kwargs)
  File "/home/aomoper/web2py/gluon/dal.py", line 2079, in __init__
    if do_connect: self.find_driver(adapter_args)
  File "/home/aomoper/web2py/gluon/dal.py", line 695, in find_driver
    raise RuntimeError, "no driver available %s" % self.drivers
TypeError: not all arguments converted during string formatting

Anyone can help please?
Thanks
Marcin
  • 48,559
  • 18
  • 128
  • 201
friol
  • 6,996
  • 4
  • 44
  • 81
  • Learn to format your code on here (format the exception as code). We'll likely need to some code too. – Marcin Nov 13 '12 at 19:10
  • Yep, did that on the third try :) I have no code to show, this is web2py out-of-the-box. – friol Nov 13 '12 at 19:11
  • Possible duplicate of: [Why does web2py crash for me upon startup?](http://stackoverflow.com/questions/8857953/why-does-web2py-crash-for-me-upon-startup). I seems to be that it can't find any database driver package installed. Which database backend do you plan to use? SQLite at least should be available though (that comes with the Python standard library). See also: [web2py manual: The database abstraction layer](https://web2py.com/books/default/chapter/29/06). – Pedro Romano Nov 13 '12 at 20:01
  • I'm aware of that question, but it didn't answer mine... Now I'm investigating because in my installation of python (I didn't do it), sqlite3 seems to be missing (import sqlite3 gives an exception). – friol Nov 13 '12 at 20:24
  • The fact that your Python installation doesn't have the `sqlite3` package is indeed abnormal, and that would explain the error. In my Ubuntu installation it is definitely part of the base `python-2.7` package. – Pedro Romano Nov 13 '12 at 20:37
  • Seems that the sysadmins recompiled python from source in order to install it, but didn't include the sqlite3 library... I still have to get an official feedback. – friol Nov 14 '12 at 19:05

1 Answers1

0

This issue was related to sqlite3 missing from Python's installation.

Recompiling Python with that library fixed the problem.

friol
  • 6,996
  • 4
  • 44
  • 81