-
Improvement
-
Resolution: Fixed
-
Minor
-
2.7.4, 2.8.2, 2.9
-
MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
-
MOODLE_29_STABLE
-
MDL-48889-master -
Easy
-
When the S3 repository plugin runs into problems, the errors that are displayed are not descriptive.
Reproduction steps (requires an AWS account):
- Configure an S3 repository instance; it is unimportant to create buckets.
- On your Moodle server, disable automatic time sync and change the time to be several hours before the current time.
- 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.
- 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.
- 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.
- Observe that the S3 library gave you a meaningful message that was not passed up into Moodle, along the lines of