Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49669

Error connecting to external backpack: The data return from the backpack was invalid.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Make sure that you can connect to a Backpack and retrieve your badges.

      1. Log in as admin
      2. Browse to My profile settings ▶ Badges ▶ Backpack settings
      3. Click the button that looks horribly out of place.
      4. Proceed through the dialogues, you may not need to do anything if you have an already connected Persona account.
      5. When the dialogue closes you should see Connecting....
      6. When this disappears you should see status connected.
      7. There should be NO read error message
      Show
      Make sure that you can connect to a Backpack and retrieve your badges. Log in as admin Browse to My profile settings ▶ Badges ▶ Backpack settings Click the button that looks horribly out of place. Proceed through the dialogues, you may not need to do anything if you have an already connected Persona account. When the dialogue closes you should see Connecting.... When this disappears you should see status connected. There should be NO read error message
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49669_master

      Description

      When attempting to connect to my external backpack I am getting the following error.

      You could not be connected to an external backpack for the following reason: The data return from the backpack was invalid.

      I can reproduce this reliably on Moodle 2.7 - Moodle 2.9 and on qa.moodle.net as well.
      To reproduce:

      1. I log in as anyone.
      2. I browse to My profile settings > Badges > Backpack settings
      3. I click "Sign in with your email"
      4. I follow the prompts in the popup.
      5. When I get taken back to Moodle it shows "connecting..." and then that finishes and I get an error.

      Interestingly this affects myself but not Yuliya, so potentially there is something related to the backpack there.
      I used my existing gmail account and created a new persona account using my Totara email address. Neither worked on my local or on QA.

      Yuliya and myself put a bit of effort into investigating this, the end result of which is that the call to the displayer API is resulting in HTML being returned rather than the expected JSON.
      https://github.com/mozilla/openbadges-backpack/wiki/Using-the-Displayer-API

      Mozilla use this same URL to serve both the HTML email conversion interface and to perform the JSON conversion.
      We should be getting JSON back but instead are getting the manual HTML process which we don't deal with.

      The problem is why we get the HTML version and not the JSON version.
      Could be curl, could be mozilla.

      Noting there are several reports of this in the Moodle forums and at least one in the Mozilla forums.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15