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

S3 repository errors are non-specific

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.9
    • 2.7.4, 2.8.2, 2.9
    • Repositories
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • MDL-48889-master
    • Easy
    • Hide

      This test does not require an AWS account.

      1. Configure an S3 repository instance, with a nonsense word for the access key and another for the secret key.
      2. Set debug to developer level.
      3. Attempt to use the S3 repository.
        • Moodle will throw a moodle_exception, and tell you "Error while communicating with the repository '<yourreponamehere>'".
        • Verify that under "Debug info", the S3 library has printed the message

          S3::listBuckets(): [InvalidAccessKeyId] The AWS Access Key Id you provided does not exist in our records.
          

      Show
      This test does not require an AWS account. Configure an S3 repository instance, with a nonsense word for the access key and another for the secret key. Set debug to developer level. Attempt to use the S3 repository. Moodle will throw a moodle_exception, and tell you "Error while communicating with the repository '<yourreponamehere>'". Verify that under "Debug info", the S3 library has printed the message S3::listBuckets(): [InvalidAccessKeyId] The AWS Access Key Id you provided does not exist in our records.

      When the S3 repository plugin runs into problems, the errors that are displayed are not descriptive.

      Reproduction steps (requires an AWS account):

      1. Configure an S3 repository instance; it is unimportant to create buckets.
      2. On your Moodle server, disable automatic time sync and change the time to be several hours before the current time.
      3. Attempt to use the S3 repository.
        • Moodle will throw a moodle_exception, and tell you "Error while communicating with the repository '<yourreponamehere>'".
        • The error code will be "errorwhilecommunicatingwith", which doesn't tell you what actually happened.
      4. Create a PHP file in your Moodle directory, s3test.php, with the following contents:

        <?php
        require_once("repository/s3/S3.php");
         
        $key_a = "your access key here";
        $key_s = "your secret access key here";
         
        S3::setAuth($key_a, $key_s);
         
        $buckets = S3::listBuckets(true);
         
        echo '<pre>';
        print_r($buckets);
        echo '</pre>';
         
        ?>
        

        • Amend the file with your access and secret access keys.
      5. Access the file you created in a web browser.
        • Observe that the S3 library gave you a meaningful message that was not passed up into Moodle, along the lines of
          Warning: S3::listBuckets(): [RequestTimeTooSkewed] The difference between the request time and the current time is too large.

            jethac Jetha Chan
            jethac Jetha Chan
            Simey Lameze Simey Lameze
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            John Okely John Okely
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.