Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pylti1p3.exception.LtiException: Invalid Nonce #22

Open
misilot opened this issue Oct 20, 2023 · 1 comment
Open

pylti1p3.exception.LtiException: Invalid Nonce #22

misilot opened this issue Oct 20, 2023 · 1 comment

Comments

@misilot
Copy link

misilot commented Oct 20, 2023

Hello,

We are seeing the error pylti1p3.exception.LtiException: Invalid Nonce happen a lot. The user can typical go back, refresh the page, and it works. Though if they refresh again, it takes another refresh to have the page load.

We are using Canvas if that helps?

readinglistlti-test-reading-1  | [2023-10-20 13:39:30,427] ERROR in app: Exception on /launch/ [POST]
readinglistlti-test-reading-1  | Traceback (most recent call last):
readinglistlti-test-reading-1  |   File "/venv/readinglistlti-MATOk_fk-py3.11/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
readinglistlti-test-reading-1  |     response = self.full_dispatch_request()
readinglistlti-test-reading-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
readinglistlti-test-reading-1  |   File "/venv/readinglistlti-MATOk_fk-py3.11/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
readinglistlti-test-reading-1  |     rv = self.handle_user_exception(e)
readinglistlti-test-reading-1  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
readinglistlti-test-reading-1  |   File "/venv/readinglistlti-MATOk_fk-py3.11/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
readinglistlti-test-reading-1  |     rv = self.dispatch_request()
readinglistlti-test-reading-1  |          ^^^^^^^^^^^^^^^^^^^^^^^
readinglistlti-test-reading-1  |   File "/venv/readinglistlti-MATOk_fk-py3.11/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
readinglistlti-test-reading-1  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
readinglistlti-test-reading-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
readinglistlti-test-reading-1  |   File "/code/reading/app.py", line 112, in launch
readinglistlti-test-reading-1  |     message_launch_data = message_launch.get_launch_data()
readinglistlti-test-reading-1  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
readinglistlti-test-reading-1  |   File "/venv/readinglistlti-MATOk_fk-py3.11/lib/python3.11/site-packages/pylti1p3/message_launch.py", line 529, in get_launch_data
readinglistlti-test-reading-1  |     return self._get_jwt_body()
readinglistlti-test-reading-1  |            ^^^^^^^^^^^^^^^^^^^^
readinglistlti-test-reading-1  |   File "/venv/readinglistlti-MATOk_fk-py3.11/lib/python3.11/site-packages/pylti1p3/message_launch.py", line 330, in _get_jwt_body
readinglistlti-test-reading-1  |     self.validate()
readinglistlti-test-reading-1  |   File "/venv/readinglistlti-MATOk_fk-py3.11/lib/python3.11/site-packages/pylti1p3/message_launch.py", line 317, in validate
readinglistlti-test-reading-1  |     .validate_nonce()
readinglistlti-test-reading-1  |      ^^^^^^^^^^^^^^^^
readinglistlti-test-reading-1  |   File "/code/reading/app.py", line 63, in validate_nonce
readinglistlti-test-reading-1  |     return super().validate_nonce()
readinglistlti-test-reading-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^
readinglistlti-test-reading-1  |   File "/venv/readinglistlti-MATOk_fk-py3.11/lib/python3.11/site-packages/pylti1p3/message_launch.py", line 670, in validate_nonce
readinglistlti-test-reading-1  |     raise LtiException("Invalid Nonce")
readinglistlti-test-reading-1  | pylti1p3.exception.LtiException: Invalid Nonce

Thanks for your help!

@jsogg
Copy link

jsogg commented Mar 8, 2024

I was getting a lot of nonce validation errors until I changed gunicorn from 4 workers to 1 worker. Possibly related to data storage and it being tied to the particular worker, possibly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants