instructure / canvas-lms

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

undefined method `sign' for nil:NilClass #1981

Closed uc-sgu closed 3 years ago

uc-sgu commented 3 years ago

Hello,

I successfully set up canvas LMS but I am getting the 500 error when launching LTI 1.3 link.

undefined method `sign' for nil:NilClass

    apps/canvaslms/htdocs/vendor/bundle/ruby/2.7.0/gems/json-jwt-1.13.0/lib/json/jws.rb:107:in `sign'

apps/canvaslms/htdocs/vendor/bundle/ruby/2.7.0/gems/json-jwt-1.13.0/lib/json/jws.rb:17:in sign!' apps/canvaslms/htdocs/vendor/bundle/ruby/2.7.0/gems/json-jwt-1.13.0/lib/json/jwt.rb:35:insign' apps/canvaslms/htdocs/gems/lti-advantage/lib/lti_advantage/messages/jwt_message.rb:74:in `create_jws'

Can anyone help me?

miguelsrr commented 2 years ago

Hi, I found a solution for this error, I was missing this yml file https://raw.githubusercontent.com/instructure/canvas-lms/master/config/dynamic_settings.yml.example just edit the jwk

doldsimo commented 2 years ago

For everyone who have the same problem here is my solution to solve the problem:

look if you have an dynamic_settings.yml file in your canvas/config directory. If you do not have one than copy the example file which might be in the canvas/config/dynamic_settings.yml.example. Rename that file to dynamic_settings.yml. If you do not have that file in the canvas/config you can also get that file from here: https://raw.githubusercontent.com/instructure/canvas-lms/master/config/dynamic_settings.yml.example Copy the file and paste in at canvas/config.

That LTI1.3 was working for me I have to change the word development: to production: inside the dynamic_settings.yml file.

After that restart your web server. For Apache use: sudo /etc/init.d/apache2 restart

Here is another post fom the canvas forum that describe how to solve this problem. So credits to @ttiole

https://community.canvaslms.com/t5/Canvas-Developers-Group/Canvas-LTI-1-3-Error-Unknown-Key-Type/m-p/390285/highlight/true#M6345

To get this working costs me 2 Weeks.

Hope this helps someone.

rickgm commented 12 months ago

I thank all of you from the bottom of my heart. Without this issue coming up in the search engine I would have spent countless hours debugging this. Instead I fixed the issue in a few minutes. We were missing the dynamic_settings.yml file.