830: rb-site generates files with incorrect paths on Windows

domin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Feb. 3, 2009
I tried to create my first review-board site on a local windows machine with
rb-site install c:\temp\review-board-site1

But after I made my selection in the gui (I used sqlite and file caching) I
got the following exception

Traceback (most recent call last):
  File
"c:\tools\python25\lib\site-packages\reviewboard-1.0alpha2.dev_20090122-py2.5.egg\EGG-INFO\scripts\rb-site",
line
 589, in next_page
    func()
  File
"c:\tools\python25\lib\site-packages\reviewboard-1.0alpha2.dev_20090122-py2.5.egg\EGG-INFO\scripts\rb-site",
line
 733, in call_func
    func()
  File
"c:\tools\python25\lib\site-packages\reviewboard-1.0alpha2.dev_20090122-py2.5.egg\EGG-INFO\scripts\rb-site",
line
 181, in sync_database
    self.run_manage_command("syncdb", ["--noinput"])
  File
"c:\tools\python25\lib\site-packages\reviewboard-1.0alpha2.dev_20090122-py2.5.egg\EGG-INFO\scripts\rb-site",
line
 219, in run_manage_command
    execute_manager(reviewboard.settings, [__file__, cmd] + params)
  File
"c:\tools\python25\lib\site-packages\django-1.0.2_final-py2.5.egg\django\core\management\__init__.py",
line 340,
in execute_manager
    utility.execute()
  File
"c:\tools\python25\lib\site-packages\django-1.0.2_final-py2.5.egg\django\core\management\__init__.py",
line 295,
in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"c:\tools\python25\lib\site-packages\django-1.0.2_final-py2.5.egg\django\core\management\base.py",
line 192, in r
un_from_argv
    self.execute(*args, **options.__dict__)
  File
"c:\tools\python25\lib\site-packages\django-1.0.2_final-py2.5.egg\django\core\management\base.py",
line 219, in e
xecute
    output = self.handle(*args, **options)
  File
"c:\tools\python25\lib\site-packages\django-1.0.2_final-py2.5.egg\django\core\management\base.py",
line 348, in h
andle
    return self.handle_noargs(**options)
  File
"c:\tools\python25\lib\site-packages\django-1.0.2_final-py2.5.egg\django\core\management\commands\syncdb.py",
lin
e 51, in handle_noargs
    cursor = connection.cursor()
  File
"c:\tools\python25\lib\site-packages\django-1.0.2_final-py2.5.egg\django\db\backends\__init__.py",
line 56, in cu
rsor
    cursor = self._cursor(settings)
  File
"c:\tools\python25\lib\site-packages\django-1.0.2_final-py2.5.egg\django\db\backends\sqlite3\base.py",
line 145,
in _cursor
    self.connection = Database.connect(**kwargs)
sqlite3.OperationalError: unable to open database file

BTW I installed review-board with easy_install
chipx86
#1 chipx86
Sounds like it's probably just a configuration issue. Can you provide the database
info from your settings_local.py?
  • +NeedInfo
#2 domin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
sure here it is

# Site-specific configuration settings for Review Board
# Definitions of these settings can be found at
# http://docs.djangoproject.com/en/dev/ref/settings/

# Database configuration
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'C:\TEMP\review-board-site1\db\reviewboard.db'

# Unique secret key. Don't share this with anybody.
SECRET_KEY = '+s517xjn#syslaqox631lrwjkl(fm5iz1spxkdxlqfo(mgsy^s'

# Cache backend settings.
CACHE_BACKEND = 'file:///tmp/reviewboard_cache'

# Extra site information.
SITE_ID = 1
SITE_ROOT = '/'

The directory C:\TEMP\review-board-site1\db\ has been created by rb-site install but
it is empty.
chipx86
#3 chipx86
I think our script isn't generating paths on Windows correctly...

Try modifying the DATABASE_NAME field to use "\\" instead of "\". So:

DATABASE_NAME = "C:\\TEMP\\review-board-site1\\db\\reviewboard.db"
#4 domin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Your are right that was the problem
I changed
fp.write("DATABASE_NAME = '%s'\n" % self.db_name)
to
fp.write("DATABASE_NAME = '%s'\n" % self.db_name.replace("\\", "\\\\"))

and now it works

BTW first I tried fp.write("DATABASE_NAME = '%s'\n" % repr(self.db_name))
but that led to
''C:\\TEMP\\review-board-site2\\db\\reviewboard.db''

Anyway it works now thanks for your really quick help

cheers
Dominik
#5 domin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
One more thing:
I had to change
PythonPath "['C:\TEMP\review-board-site3/conf'] + sys.path"
to
PythonPath "['C:/TEMP/review-board-site3/conf'] + sys.path"

and add a Directory block

    <Directory C:\TEMP\review-board-site3/htdocs>
        Order allow,deny
        Allow from all
    </Directory>

in the apache configuration.
chipx86
#6 chipx86
Should now be fixed in r1739.
  • -NeedInfo
    +Fixed
  • +Component-Deployment
    +Component-Scripts
  • +rb-site generates files with incorrect paths on Windows
  • +chipx86