instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.67k stars 2.5k forks source link

Try to get "/api/lti/security/jwks" and get "undefined method `to_key' for nil:NilClass" #1748

Closed zag2art closed 3 years ago

zag2art commented 3 years ago

Summary:

Just installed production canvas instance - https://canvas.zag2art.xyz (stable branch, November 10, 2020), installed an 1.3 lti-tool. Trying to get public keys - https://canvas.zag2art.xyz/api/lti/security/jwks - returns the error "undefined method `to_key' for nil:NilClass"

Steps to reproduce:

  1. Install fresh stable branch
  2. Install a lti 1.3 tool
  3. go to /api/lti/security/jwks in browser

Expected behavior:

See json with keys right in the browser window

Actual behavior:

Error message like: while(1);{"errors":[{"message":"An error occurred.","error_code":"internal_server_error"}],"error_report_id":22}

Additional notes:

Details from error_reports table:

message: undefined method `to_key' for nil:NilClass

backtrace: https://gist.github.com/zag2art/c4e75100872794ab4b373aca1c8f8e5b

update

  1. Removing the lti tool doesn't affect
  2. Redis (2.8.9) set up as key-value store. (I set it up a little after the main installation)
zag2art commented 3 years ago

Looks like it happened because of consul setup. I was supposed to either deploy consul or setup config/dynamic_settings.yml proper way (for production env). So, in my case (I need the canvas setup to test my lti tool by our test team) I set up the dynamic_settings file. Mainly changing "development" to "production"