LTI 1.3 | Grade synchronisation says "failed" while grade is being received

LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Gemma Lesterhuis -
Number of replies: 12
Picture of Plugin developers Picture of Testers
We are currently testing out LTI 1.3 Provider functionality and with one of the registated platforms we have the followign issue. 

We can see that Moodle sends the grade properly to the platform in their logs.
But Moodle keeps sending this grade over and over.

When I look in the Task log, we see "Failed - The grade '1' for the user '3646', for the resource '204' and the course '125' failed to send." (yellow line)

I think this is the reasons Moodle keeps sending the grade. 

Is this a Moodle issue ór a platform issue, and in any case: what should be done to get thet success (green) as we see by example between Moodle -Moodle ?

Suggestions are very welcome smile

 


Average of ratings: -
In reply to Gemma Lesterhuis

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Jake Dallimore -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Gemma,

That could be caused by MDL-77990, but it's hard to see because it looks like that output is cut off there. What version are you running?

I think improving debugging for LTI in general would really help with stuff like this - on my todo list, but haven't got there yet.

Cheers,
In reply to Jake Dallimore

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Gemma Lesterhuis -
Picture of Plugin developers Picture of Testers
Moodle 4.1.3 (Build: 20230424)

Did I read it right that in 4.2 this issues should not be there - if it is related to the tracker?
In reply to Gemma Lesterhuis

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Jake Dallimore -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Being on 4.1 you're susceptible to that bug. I can't say with 100% certainty that this is the cause in your case, but it could be.

In 4.2, I removed that shim code as we now ship the guzzle library with core (the code was a shim for another library depending on guzzle). So you won't see that bug in 4.2 onward.
In reply to Jake Dallimore

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Gemma Lesterhuis -
Picture of Plugin developers Picture of Testers
Hi Jake,
We just did a test but it failed due something differently - we saw the error below but it's unclear wich parameter is missing

2023/06/16 13:16:20 [error] 598051#598051: *418341 FastCGI sent in stderr: "PHP message: Default exception handler: a required parameter (iss) is missing Debug: Error code: missingparam * line 610 of /lib/moodlelib.php: moodle_exception thrown * line 41 of /enrol/lti/login.php: call to required_param()" while reading response header from upstream, client: xxxx, server: xxx, request: "GET /enrol/lti/login.php?client_id=xxxf&iss=https%3A%2F%2Fenabling.io&login_hint=153&lti_deployment_id=xxx&lti_message_hint=43c55265-10fa-4f95-a9d8-c5995dd45c87&target_link_uri=https%3A%2F%2Flerenxl.nl%2Fenrol%2Flti%2Flaunch.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.0-fpm-lerenxl.nl.sock:", host: "xxx"
In reply to Gemma Lesterhuis

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Jake Dallimore -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
That looks like you're doing a launch and the 'iss' value is missing. Certainly that's what the error says. It's not found in either POST or GET at the login endpoint.
In reply to Jake Dallimore

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Gemma Lesterhuis -
Picture of Plugin developers Picture of Testers
I figured that much but I could not define what the 'iss' value supposed to be?
In reply to Gemma Lesterhuis

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Jake Dallimore -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
It must match the value of "Platform ID (issuer)" set in the platform registration, under Enrolments > Publish as LTI tool > Tool registration > Edit registration > Platform details. Of course, it depends on the platform because the issuer value is the URL of said platform. You can see details of this in the security framework spec: https://www.imsglobal.org/spec/security/v1p1#step-1-third-party-initiated-login, but it's essentially an OpenID Connect concept.
In reply to Jake Dallimore

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Gemma Lesterhuis -
Picture of Plugin developers Picture of Testers
Hi Jake,
we found the issue!

Appearantly they don't send a 200 response back but a 204 response.

I am not sure if this is something that Moodle should adjust to, but for now we changed the code in lti/classes/local/ltiadvantage/task/sync_grade.php - line 197 to the following.

if ($response['status'] == 200) {

aangepast naar

if ($response['status'] == 200 or $response['status'] == 204) {

If I look up the difference between the 2 status, I can understand why they use 204, but as I said not sure if Moodle should adjust code for this. But I can imagine it should be more flexible.

Please let me know if you want me to create a tracker, making a pull request and sorts becomes to 'developy' for me, I am already happy I sorted this smile

Gemma
In reply to Gemma Lesterhuis

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Gemma Lesterhuis -
Picture of Plugin developers Picture of Testers
Hi Jake,

I just found this in the LTI documentation : https://www.imsglobal.org/spec/lti-ags/v2p0/#example-posting-a-final-score-update

it states HTTP/1.1 204 No Content

And just found this tracker: https://tracker.moodle.org/browse/MDL-76557

So I guess it it will be fixed when this reviewed
In reply to Gemma Lesterhuis

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Jake Dallimore -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Yep, just waiting on the assignee there. If they don't post back soon, I'll move that issue along myself.

Cheers,
In reply to Gemma Lesterhuis

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Jorine Koenderman -
Hi Gemma,

When you implement the fixes for those 2 bugs (MDL-77990 and the response 200/204 issue), will this resolve your issues with the LTI problems and Moodle 4.1?
I'm asking because a customer of us will upgrade to Moodle 4.1 and is using LTI with several CAPP clients that might result in the same issues as you are experiencing.

Thank you.
In reply to Jorine Koenderman

Re: LTI 1.3 | Grade synchronisation says "failed" while grade is being received

by Gemma Lesterhuis -
Picture of Plugin developers Picture of Testers
Hi Jorine,
Yes when I implemented the fx for the resonse 200/204 issue my problem was solved. MDL-79990 was not the root cause for the issue.

Gemma