Studio Internal Error and LMS Error 500 with LTI Consumer XBlock on Local Tutor

Hi all,

I have a running local installation of Tutor and I want to use edX as an LTI consumer.
Because the default edX LTI module does not send several key pieces of information (such as “lis_person_name_full”) to the LTI Tool, I decided to install the following XBlocks: xblock-lti-consumer and tahoe-lti which easily allow to pass such information (I do not know if there is an other easy wa to achieve this goal). I followed the steps described in the Tutor documentation and everything went smoothly.

Before this installation, the default LTI module was working fine (except for the missing information) but after installation I obtain an Internal Error when launching the LTI Tool from Studio and a 500 Error when launching the LTI Tool from the LMS. Below are the logs that I obtain (both for the CMS and LMS), it seems there is an unknown parameter ‘lti_consumer_lticonfiguration.config_id’ that is requested at some point.

2021-03-04 22:16:13,759 INFO 9 [tracking] [user 3] [ip myip] logger.py:42 - {"name": "/preview/xblock/block-v1:+CINI01+2021T1+type@lti_consumer+block@6533e2f3e6de4ed682309994ff1640a1/handler/lti_launch_handler", "context": {"user_id": 3, "path": "/preview/xblock/block-v1:+CINI01+2021T1+type@lti_consumer+block@6533e2f3e6de4ed682309994ff1640a1/handler/lti_launch_handler", "course_id": "", "org_id": ""}, "username": "Scousix", "session": "9a85478154d9c1c38aa03f209b618792", "ip": "myip", "agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0", "host": "my.url", "referer": "https://my.url/container/block-v1:+CINI01+2021T1+type@vertical+block@80a74d2fd74e46f8841cc62be7df8873?action=new", "accept_language": "en-US,en;q=0.5", "event": "{\"GET\": {}, \"POST\": {}}", "time": "2021-03-04T22:16:13.758999+00:00", "event_type": "/preview/xblock/block-v1:+CINI01+2021T1+type@lti_consumer+block@6533e2f3e6de4ed682309994ff1640a1/handler/lti_launch_handler", "event_source": "server", "page": null}
cms_1            | 2021-03-04 22:16:13,783 ERROR 9 [cms.djangoapps.contentstore.views.preview] [user 3] [ip myip] preview.py:89 - error processing ajax call
cms_1            | Traceback (most recent call last):
cms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
cms_1            |     return self.cursor.execute(sql, params)
cms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 71, in execute
cms_1            |     return self.cursor.execute(query, args)
cms_1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
cms_1            |     res = self._query(query)
cms_1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
cms_1            |     db.query(q)
cms_1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/connections.py", line 259, in query
cms_1            |     _mysql.connection.query(self, query)
cms_1            | MySQLdb._exceptions.OperationalError: (1054, "Unknown column 'lti_consumer_lticonfiguration.config_id' in 'field list


[04/Mar/2021:22:29:25 +0000] http://my.url "GET /courses/course-v1:+CINI01+2021T1/xblock/block-v1:+CINI01+2021T1+type@lti_consumer+block@b1196804ffdc4fbf9cf5c085db88d203/handler/lti_launch_handler HTTP/1.1" 500 9705 "https://my.url/courses/course-v1:+CINI01+2021T1/courseware/717b003631c84114b86b3d07a9f90818/ccb1bfab5bdf49bca506f753a253fb16/?activate_block_id=block-v1%%2BCINI01%2B2021T1%2Btype%40sequential%2Bblock%40ccb1bfab5bdf49bca506f753a253fb16" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0" "myip"
lms_1            |     num = len(clone)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 256, in len
lms_1            |     self._fetch_all()
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 1242, in _fetch_all
lms_1            |     self._result_cache = list(self._iterable_class(self))
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/query.py", line 55, in iter
lms_1            |     results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
lms_1            |     cursor.execute(sql, params)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 67, in execute
lms_1            |     return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
lms_1            |     return executor(sql, params, many, context)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
lms_1            |     return self.cursor.execute(sql, params)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/utils.py", line 89, in exit
lms_1            |     raise dj_exc_value.with_traceback(traceback) from exc_value
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
lms_1            |     return self.cursor.execute(sql, params)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py", line 71, in execute
lms_1            |     return self.cursor.execute(query, args)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 206, in execute
lms_1            |     res = self._query(query)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/cursors.py", line 319, in _query
lms_1            |     db.query(q)
lms_1            |   File "/openedx/venv/lib/python3.8/site-packages/MySQLdb/connections.py", line 259, in query
lms_1            |     _mysql.connection.query(self, query)
lms_1            | django.db.utils.OperationalError: (1054, "Unknown column 'lti_consumer_lticonfiguration.config_id' in 'field list'")

Any idea why this may happen?
Is there another easy way to pass “lis_person_name_full” and other information to the LTI Tool?
Thanks a lot in advance for your help.

1 Like

Hi @RonanFR! I feel like your stacktraces don’t include the top-most frames, which makes it difficult to see where the error exactly comes from. Can you confirm?

The LTI consumer XBlock comes with a set of migrations that need to be applied before it will run. You may have installed a newer version of the block without running the migrations.

Please run the migrations on you installation since that will create the tables MySQL is complaining about.

1 Like

Hi @xitij2000 and thanks for your reply. These migrations do not seem to be mentioned on the Github page. Is there some documentation available?

A version of LTI consumer Xblock seem to be installed by default on Open edX (or at least using edX as an LTI consumer works with the default Tutor install in my case) and I am wondering whether the Tahoe Customizations would work as well without explicitly installing the newer version of LTI Consumer XBlock). Is there any difference between the two LTI Consumer XBlocks (the one that seem to be installed with edX and the one on Github) except maybe the version?

@regis yes sorry I tried to isolate (what I thought was) the important part of the logs to make it more readable but I probably removed too much

I would recommend using the version of the XBlock that comes installed by default on Open edX. The one on GitHub is just a newer version with more features, however it is possible in some cases for the latest version on GitHub to not be compatible with a previous release since the latest GitHub release will target the upcoming version of the platform.

The migrations are automatically run during instance setup and upgrade, however if you install a newer version of the XBlock they will need to be run manually. If you’re familiar with running paver commands you can run paver update_db. I think with tutor this should be tutor dev run lms paver update_db (though I’m not very familiar with tutor yet so could be wrong here).

2 Likes

Ok thanks a lot for the clarification! So in the end I do not need to explicitly install the LTI Consumer XBlock except if for some reasons I need a newer version in which case I need to do the migrations manually.

I will close this issue.