Installation

Error encoding JWT

Error encoding JWT

by Troy Welch -
Number of replies: 8

Hi, we are running a dev installation of Webwork against a dev installation of Moodle. We are in the process of moving from LTI 1.1, which we just used for Authentication, to LTI 1.3 which we will use for both auth and grade return.

Authentication is testing just fine for use, but we are having a grade return issue. The linking of the Moodle assignment to the WW course and assignment is working great. However, the grade is not being returned to Moodle and we have the accompanying errors in the webwork2.log file:

│[2024-07-22 09:07:25.52338] [329164] [info] Submitting grade for user XXXXXXX and set Grade_return_test.                                                                                                 │
│[2024-07-22 09:07:25.52434] [329164] [info] Error encoding JWT: Can't call method "url_for" on unblessed reference at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvantage/SubmitGrade.pm line 147.

I've double checked the configuration files several times. I started working my way through the code files to see where we might be getting hung up, but I have no PERL chops and got lost fairly quickly.

Does anyone have an idea where I might start trouble-shooting this issue. (I'll spare you the team wise-guy's comment that we might need a clergy member to bless our references.)


In reply to Troy Welch

Re: Error encoding JWT

by Glenn Rice -

You say you are running a dev installation of WeBWorK.  Is that version 2.18, or is it really the development branch (or the release candidate branch for 2.19)?

There was a bug in the 2.18 code that caused the error that you are seeing.  It has been fixed for the 2.19 release (that fix is in both the develop branch and the WeBWorK-2.19 branch).  I suggested that fix be considered for a hotfix to 2.18, but that never happened.  I recommend that you switch to the WeBWorK-2.19 branch.  We are about to release it, and it is rather stable.

In reply to Glenn Rice

Re: Error encoding JWT

by Troy Welch -
Thanks for the quick response Glenn. Is the 2.18 release version we are using. My reference to 'dev server' is that it is a dev server for us that we test on before moving things to our production server.

So, it sounds like moving to 2.19 is the solution. I would imagine following a similar set of steps to the Release notes/upgrade to 2.18 would work in upgrading to 2.19. Are there any dependency issues I need to look out for?
In reply to Troy Welch

Re: Error encoding JWT

by Glenn Rice -
There are release notes for 2.19 at https://webwork.maa.org/wiki/Release_notes_for_WeBWorK_2.19. If you are upgrading from 2.18 it is not very hard. The upgrade to 2.18 was the big step. Basically, there are a few new dependencies you will need to install, and you will need to check the changes to the configuration files carefully.
In reply to Glenn Rice

Re: Error encoding JWT

by Troy Welch -
Thanks again Glenn, these updated release notes came at exactly the right time. Cheers.
In reply to Troy Welch

Re: Error encoding JWT

by Troy Welch -
Hi Glenn, the upgrade went smoothly, I did need to update Mojo to a newer version.

However, I'm getting errors when I load the server. Can you think of any directions I can look for a solutions. I already combed my way through the config files.

× webwork2.service - webwork2
Loaded: loaded (/etc/systemd/system/webwork2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-07-23 08:03:28 PDT; 26s ago
Process: 10095 ExecStart=hypnotoad /opt/webwork/webwork2/bin/webwork2 (code=exited, status=255/EXCEPTION)
CPU: 1.099s

Jul 23 08:03:27 webwork-dev systemd[1]: Starting webwork2...
Jul 23 08:03:28 webwork-dev hypnotoad[10095]: Can't load application from file "/opt/webwork/webwork2/bin/webwork2": Could not evaluate global environment file /opt/webwork/webwork2> Jul 23 08:03:28 webwork-dev hypnotoad[10095]: at /opt/webwork/webwork2/lib/Mojolicious/WeBWorK.pm line 61.
Jul 23 08:03:28 webwork-dev systemd[1]: webwork2.service: Control process exited, code=exited, status=255/EXCEPTION
Jul 23 08:03:28 webwork-dev systemd[1]: webwork2.service: Failed with result 'exit-code'.
Jul 23 08:03:28 webwork-dev systemd[1]: Failed to start webwork2.
Jul 23 08:03:28 webwork-dev systemd[1]: webwork2.service: Consumed 1.099s CPU time.
In reply to Troy Welch

Re: Error encoding JWT

by Glenn Rice -

Webwork is not able to to evaluate the file "/opt/webwork/webwork2/conf/defaults.config".  That file includes all of your customized configuration files.  This most likely means that you don't have something correct (a syntax error perhaps) in one of them.  Compare each of them to the corresponding .dist file and see what is changed.

In reply to Glenn Rice

Re: Error encoding JWT

by Danny Glin -

It could also be a permissions issue.  Make sure that the config files are readable by the user that WeBWorK is running under.

In reply to Troy Welch

Re: Error encoding JWT

by Troy Welch -
Thanks very much for the tips Glenn and Danny. I finally got it. I'm going to drop my process and a tip here so that others might find it.

I reviewed (another couple of times) my config files. Both line by line and vimdiff against the dist version, until I convinced myself (foreshadowing) they were fine.

I also created a new user and redid all of the ownership and permissions steps. Still nothing.

Then I tried a tip I picked up off the web somewhere and one by one tested syntax on each config file ( just the perl ones of course) using:
perl -c filename

Lo and behold, I found my error in authen_LTI.conf on line 17 where I had failed to put a value in for $debug_lit_parameters =

Popped a 1 in there as my original problem/testing was LTI grade returns and bob's your uncle.

I must have missed that error about a dozen times all tolled. I'm going to blame it on the tail end of a summer cold.

Cheers and thanks again for the help.