HumanDynamics / openPDS-RegistryServer

openpds.media.mit.edu
MIT License
11 stars 15 forks source link

(solved) registery server Unable to open database file #24

Open deepsidhu1313 opened 8 years ago

deepsidhu1313 commented 8 years ago

Hi,

I am working on a project using OpenPDS but i think i am unable to set it up on my laptop for development. I am getting following error when i try to setup registry server on my machine.

nika@nika ~/Study/Projects/SnP/registryEnv/openPDS-RegistryServer/registryServer $ python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
    output = self.handle(*args, **options)
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
    return self.handle_noargs(**options)
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
    cursor = connection.cursor()
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 308, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 288, in _cursor
    self._sqlite_create_connection()
  File "/home/nika/Study/Projects/SnP/registryEnv/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 278, in _sqlite_create_connection
    self.connection = Database.connect(**kwargs)
sqlite3.OperationalError: unable to open database file

Any help ??

brian717 commented 8 years ago

Is your registryServer directory writable?

deepsidhu1313 commented 8 years ago

Yes, i followed the instructions given on repo.

apt-get install python-pip

apt-get install python-virtualenv

virtualenv registryEnv

cd registryEnv

source bin/activate

git clone git@github.com:HumanDynamics/openPDS-RegistryServer.git -b master

cd openPDS-RegistryServer

pip install -r conf/requirements.txt

cd registryServer

python manage.py syncdb

python manage.py runserver 0.0.0.0:8000 
deepsidhu1313 commented 8 years ago

Is there a sequence to setup OpenPDS on my laptop, like do i have to setup registery server and then OpenPDS or vice versa??

brian717 commented 8 years ago

In order to use openPDS, you will need to have both a registry server and a PDS server running. You'll also need to point your openPDS server at your registry sever domain.

What OS are you running all of this on?

deepsidhu1313 commented 8 years ago

Linux Mint 17.2 (64 bit),

What if i don't have registry server domain, do i need to get a domain name for that like "registry.example.com" ??

deepsidhu1313 commented 8 years ago

@brian717 Do you know where the problem can be ?? I have to show some progress in my project soon, but i am unable to setup the environment so far. So may i request you for help in setting up OpenPDS and all other requirements for my Local environment. I will use my android device to demonstrate working and features of OpenPDS. Thanks :smile:

brian717 commented 8 years ago

If you are not familiar with Django (the framework that both the registry server and the main openPDS server is built on), I would recommend you familiarize yourself with it. In particular, the settings.py file - it contains configuration for your server instance. In this case, I would guess that your directory structure doesn't match that configured in the settings.py file included in the registry server. Have you updated the database configuration to point to the directory where you'd like your db file located?

As for a domain name - you don't need one. You can use the IP address of the machine where you have the registry server hosted (if it's visible to the machine hosting the openPDS server), or you can host them on the same machine and have the openPDS server hit the registry server on the loopback interface.

deepsidhu1313 commented 8 years ago

i tried running the commands using super user permissions( sudo su ), but it is still giving the same error. Also in your instructions please edit package name python pip to python-pip.

deepsidhu1313 commented 8 years ago

Ok i think i fixed it. According to settings.py file it look for the db at location

/var/www/trustframework/registryEnv/openPDS-RegistryServer/test.db

So i moved the framework to the directory. Which worked. Thanks.

Please provide step by step instructions to setup whole system for academia purpose (presentations).

deepsidhu1313 commented 8 years ago

@brian717 Please sir close this issue, as i think problem has been solved and related to location of DB in settings file.