DatabaseError: no such table: workbench_xblockstate

513 views
Skip to first unread message

Bob Light

unread,
May 21, 2014, 12:47:29 PM5/21/14
to edx-...@googlegroups.com

When running workbench inside of devstack via pycharm, I'm getting a DatabaseError


any ideas?

Is there a sqlite database that needs to be created for workbench?  I don't recall creating one.

  -Bob Light


DatabaseError at /

no such table: workbench_xblockstate
Request Method:GET
Request URL:http://0.0.0.0:8000/
Django Version:1.4.12
Exception Type:DatabaseError
Exception Value:
no such table: workbench_xblockstate
Exception Location:/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 344
Python Executable:/edx/app/edxapp/venvs/edxapp/bin/python
Python Version:2.7.3
Python Path:
['/edx/app/edxapp/edx-platform/xblock-sdk',
 '/edx/app/edxapp/edx-platform/.pycharm_helpers/pydev',
 '/edx/app/edxapp/venvs/edxapp/src/django-staticfiles',
 '/edx/app/edxapp/venvs/edxapp/src/django-pipeline',
 '/edx/app/edxapp/venvs/edxapp/src/django-wiki',
 '/edx/app/edxapp/venvs/edxapp/src/lettuce',
 '/edx/app/edxapp/venvs/edxapp/src/pystache-custom',
 '/edx/app/edxapp/venvs/edxapp/src/zendesk',
 '/edx/app/edxapp/venvs/edxapp/src/django-ipware',
 '/edx/app/edxapp/venvs/edxapp/src/pygeoip',
 '/edx/app/edxapp/venvs/edxapp/src/codejail',
 '/edx/app/edxapp/venvs/edxapp/src/diff-cover',
 '/edx/app/edxapp/venvs/edxapp/src/js-test-tool',
 '/edx/app/edxapp/venvs/edxapp/src/django-waffle',
 '/edx/app/edxapp/venvs/edxapp/src/event-tracking',
 '/edx/app/edxapp/venvs/edxapp/src/bok-choy',
 '/edx/app/edxapp/venvs/edxapp/src/django-splash',
 '/edx/app/edxapp/venvs/edxapp/src/acid-xblock',
 '/edx/app/edxapp/venvs/edxapp/src/concept-xblock',
 '/edx/app/edxapp/edx-platform',
 '/edx/app/edxapp/edx-platform/common/lib/calc',
 '/edx/app/edxapp/edx-platform/common/lib/capa',
 '/edx/app/edxapp/edx-platform/common/lib/chem',
 '/edx/app/edxapp/edx-platform/common/lib/sandbox-packages',
 '/edx/app/edxapp/edx-platform/common/lib/symmath',
 '/edx/app/edxapp/edx-platform/common/lib/xmodule',
 '/edx/app/edxapp/edx-platform/edxwork/myxblock',
 '/edx/app/edxapp/venvs/edxapp/src/xblock',
 '/edx/app/edxapp/venvs/edxapp/lib/python2.7',
 '/edx/app/edxapp/venvs/edxapp/lib/python2.7/plat-linux2',
 '/edx/app/edxapp/venvs/edxapp/lib/python2.7/lib-tk',
 '/edx/app/edxapp/venvs/edxapp/lib/python2.7/lib-old',
 '/edx/app/edxapp/venvs/edxapp/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages',
 '/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/newrelic-2.18.1.15',
 '/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info',
 '/edx/app/edxapp/venvs/edxapp/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
Server time:Wed, 21 May 2014 12:43:18 -0400

Bob Light

unread,
May 21, 2014, 1:26:51 PM5/21/14
to edx-...@googlegroups.com
I took a look at:

I tried to the following:
$ edx-platform/xblock-sdk $ python manage.py syncdb
       Creating tables ...
       Installing custom SQL ...
       Installing indexes ...
       Installed 0 object(s) from 0 fixture(s)

but alas... it didn't work.

David Ormsbee

unread,
May 21, 2014, 2:17:34 PM5/21/14
to edx-...@googlegroups.com
Was a workbench.db file created in your xblock-sdk dir? If so, could you please open it with sqlite3 and list what tables are present?

Also, are you running this from the same virtualenv that you're using to run edx-platform? If so, can you try using a new virtualenv specifically for xblock-sdk?

Thank you.

Dave

Bob Light

unread,
May 22, 2014, 10:35:40 AM5/22/14
to edx-...@googlegroups.com
It appears that there are no tables in workbench.db:

  - Bob

David Ormsbee

unread,
May 22, 2014, 10:37:33 AM5/22/14
to edx-...@googlegroups.com
I wonder if it's somehow picking up a different settings file when you're running syncdb (and therefore isn't including the apps to create tables for). Did you try running xblock-sdk under its own virtualenv in a separate dir?

Thank you.

Dave

Bob Light

unread,
May 22, 2014, 11:04:21 AM5/22/14
to edx-...@googlegroups.com
I think I misspoke - I was running the database browser from outside the vagrant (not sure why that would matter...but it appears to).

From inside the running vagrant.

edxapp@precise64:~/edx-platform/xblock-sdk$ sqlite3 workbench.db 
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> SELECT name FROM sqlite_master
   ...>             WHERE type='table' AND NOT name='sqlite_sequence'
   ...>             ORDER BY name;
auth_group
auth_group_permissions
auth_permission
auth_user
auth_user_groups
auth_user_user_permissions
django_admin_log
django_content_type
django_session
workbench_xblockstate
sqlite> 


  - Bob

Bob Light

unread,
May 22, 2014, 11:16:35 AM5/22/14
to edx-...@googlegroups.com
I think I've found the problem....

I made my working directory (in pycharm) to be ...devstack/edx-platform/xblock-sdk

it then found my database and the tables that were in it.

looks like I'm set database-wise... on to the next hurdle.

thank you.

  - Bob

Prabhanshu Pandit

unread,
Oct 18, 2017, 2:16:39 PM10/18/17
to General Open edX discussion
    Similar error comes up with latest version of Xblock-SDK. Hope this might help, steps to install Xblock-SDK
    • cd /edx/app/
    • sudo mkdir xblock_development
    • cd xblock_development/
    • sudo virtualenv venv
    • source venv/bin/activate
    • sudo git clone https://github.com/edx/xblock-sdk.git
    • cd xblock-sdk/
    • sudo pip install -r requirements/base.txt
    • cd ..
    • sudo xblock-sdk/bin/workbench-make-xblock
    • sudo pip install -e myxblock
    • sudo mkdir /edx/app/xblock_development/var/
    • sudo touch /edx/app/xblock_development/var/workbench.log
    • sudo python xblock-sdk/manage.py migrate
    • sudo mkdir xblock-sdk/workbench/migrations
    • sudo vi xblock-sdk/workbench/migrations/initial.py (Note: content of initial.py is attached)
    • sudo python xblock-sdk/manage.py makemigrations workbench
    • sudo python xblock-sdk/manage.py migrate
    • sudo python xblock-sdk/manage.py runserver
    Thanks
    Prabhanshu
    initial.py
    Reply all
    Reply to author
    Forward
    0 new messages