Badges - Can't export badge to backpack

Badges - Can't export badge to backpack

Colum McKenna發表於
Number of replies: 10
Hi, we're currently using Moodle 4.1.3 (Build: 20230424)

We backported the backpack fix from https://tracker.moodle.org/browse/MDL-75552 onto our build, and followed the config instructions as best we could, but there are a couple of steps we don't understand, and think it may be causing issues with exporting the badges to badgr. After having applied the patch, we've got a test badgr account in use, and we've got badges created to test with, so we followed these instructions. 

  1. Go to "Site administration > Server > OAuth 2 services".
  2. Create an "Open Badges" service with the following information:

Fine up to here, but then we're not sure what these steps mean:

  1. Go to the Configure endpoints page for this issuer.
  2. Check "apiBase" is one of the endpoints displayed.

We completed the following below steps anyway, hoping it would work either way. 

  1. Go to "Site administration > Badges > Manage backpacks".
  2. Create a new backpack with the following information:
  3. Logout (to guarantee the email is updated properly in the $USER var).
I'm able to connect my account from our Moodle instance to eu.badger.com, but when I try to export a badge, I get the following error: 
Image

So, what we'd like to ask is, regarding the steps we missed, are we the issuer in this case, or would it count as badgr? 
If it's something we need to check on our end, are there instructions on how to access this page? If possible, a screenshot of what to expect would be very useful. 
  1. Go to the Configure endpoints page for this issuer.
  2. Check "apiBase" is one of the endpoints displayed.
And would skipping these steps cause the above error, if not, is there something else we're missing that we should look out for? 

Many thanks in advanced! 
評比平均分數: -
In reply to Colum McKenna

Re: Badges - Can't export badge to backpack

Sara Arjona Téllez發表於
Core developers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
Hi Colum!

About the step you missed in the testing instructions, that's the screenshot associated with it (as you'll see, you need to access "Site administration > Server > OAuth 2 services" and then click the "Configure endpoints" icon in the Canvas row that you created in the previous step):

How to check that apiBase for the Canvas issuer has the expected value
I can't see the screenshot you attached with the error, so I can't see the exact error you're facing. Could you please send it back? 

Kind regards from Barcelona,
Sara
In reply to Sara Arjona Téllez

Re: Badges - Can't export badge to backpack

Colum McKenna發表於
Hi Sara,

Thank you, that was very helpful, and has helped me confirm that this step is configured correctly!

I've attached our Configurations Endpoints screen for review, and I've reattached the error message we get when trying to share a badge to eu.badgr.com as well. 
附件 apibase_config.png
附件 cant_export_the_badge_to_backpack.png
In reply to Colum McKenna

Re: Badges - Can't export badge to backpack

Sara Arjona Téllez發表於
Core developers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
Hi Colum!
Thanks for the information. However, with this error is hard to see where it comes from. Do you have access to temporarily enable debugging to see if then you get more details about the exact error you're facing?
One thing that might explain this error is, for instance, if the Badgr and the Moodle emails don't match. Could you please also confirm that's not your case and, both (Moodle user and Badgr account) are using the same email?
Kind regards,
Sara
In reply to Sara Arjona Téllez

Re: Badges - Can't export badge to backpack

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
That was on a test server with developer debug turned on and set to show errors in the browser - I don't know why we don't get more info than that, and had not had time to dig into it.
In reply to Tim Hunt

Re: Badges - Can't export badge to backpack

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
I see, the error is coming from https://github.com/moodle/moodle/blob/MOODLE_401_STABLE/badges/classes/backpack_api2p1.php#L268 ...

Ah! and you (Sara) fixed that inadequate error reporting in MDL-77086 & MDL-77842, but for some reason what was deemed to be master-only. Please can we get that backported? (Error messages that are not sufficient to let you fix the poblem are a bug, at least, I managed to get a fix like that onto all branches at MDL-76649 - with the help of an awesome integrator!)
In reply to Tim Hunt

Re: Badges - Can't export badge to backpack

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Of course, if I want this backported, there is something positive I can do about it: I have made the required backport request MDL-78572.
In reply to Tim Hunt

Re: Badges - Can't export badge to backpack

Colum McKenna發表於
Thanks Tim :D

Regarding email mismatching idea, I have an account setup on eu.badgr.com which matches my work email address, and it is this account that I have linked to our moodle instance for testing, so I don't think this would be an issue.
In reply to Colum McKenna

Re: Badges - Can't export badge to backpack

Sara Arjona Téllez發表於
Core developers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
Hi Tim and Colum!

Thanks both for confirming the email is not the problem and also for creating the backport request (and the patch), to improve debugging in 4.1 too 微笑 
Without more information about the error that Badgr is returning, it is really hard to know what's happening and what's the real cause of the failure.
For discarding, I've re-tested too in Moodle 4.1 instance and I've been able to connect and send a badge to my backpack:

Badge added to backpack screenshot for Moodle 4.1
Kind regards,
Sara
評比平均分數:Useful (1)
In reply to Sara Arjona Téllez

Re: Badges - Can't export badge to backpack

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
Just to say that, with the help of the extra diagnostics from MDL-76649, we have got this working now! Thanks for your help with this. 微笑.
評比平均分數:Useful (1)
In reply to Tim Hunt

Re: Badges - Can't export badge to backpack

Sara Arjona Téllez發表於
Core developers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片 Testers的相片
That's great news, Tim! I'm glad that you were able to find the origin of the error (thanks to the issue you backported). Well done! 微笑