openedx / xblock-sdk

Workbench and example xblocks
Apache License 2.0
67 stars 102 forks source link

SQLITE issue when using docker #191

Open Manuelbaun opened 4 years ago

Manuelbaun commented 4 years ago

Hi Guys,

I followed the example to set up the docker image and when the image starts I get this error in the browser when I open up localhost:8000.

It seems, that it cannot find a table in the SQLite file. Any Idea, how I can fix it?

Request Method: | GET
-- | --
http://localhost:8000/
2.2.14
OperationalError
no such table: workbench_xblockstate
/usr/local/lib/python3.5/dist-packages/django/db/backends/sqlite3/base.py in execute, line 383
/usr/bin/python3
3.5.2
['/usr/local/src/xblock-sdk',  '/usr/lib/python35.zip',  '/usr/lib/python3.5',  '/usr/lib/python3.5/plat-x86_64-linux-gnu',  '/usr/lib/python3.5/lib-dynload',  '/usr/local/lib/python3.5/dist-packages',  '/usr/local/src/xblock-sdk/src/acid-xblock',  '/usr/local/src/xblock-sdk',  '/usr/lib/python3/dist-packages']
Tue, 15 Sep 2020 05:13:07 -0400

here is the link to the share issue site

https://dpaste.com/B5E8EH76M

taniwallach commented 3 years ago

https://openedx.atlassian.net/browse/OSPR-1843

taniwallach commented 3 years ago

After starting the docker container using docker container exec -it xblock-sdk bash run the following:

docker container exec -it xblock-sdk bash 
python3.8 manage.py migrate

after this http://localhost:8000/ had what should be there.

Note: I am using a modified Dockerfile and have python3.8. The standard one has python3.5 which is deprecated.

Some comments which helped were found in:

taniwallach commented 3 years ago

Note: This does not get persisted after a restart. Solution: Provide persistant storage for /usr/local/src/xblock-sdk/var See the approach using a docker-compose.yml file in https://github.com/edx/xblock-sdk/pull/194