catalyst / moodle-fileconverter_librelambda

A Libre Office document converter for Moodle leveraging AWS Lambda
https://moodle.org/plugins/fileconverter_librelambda
Other
23 stars 18 forks source link

The provisioning script return error messages #17

Open aec2016 opened 4 years ago

aec2016 commented 4 years ago

Hi all,

When I followed the guide, all things go smooth until the provisioning script, which gives the following error output:

➜ sudo -u www-data php files/converter/librelambda/cli/provision.php \
➜ --keyid=AKI****************4 \
➜ --secret=kI3m8d*******************Z \
➜ --region=cn-north-1 \
➜ --set-config
== Creating resource S3 Bucket ==
Created resource bucket, at location 

== Uploading LibreOffice archive to resource S3 bucket ==
== Uploading Lambda archive to resource S3 bucket ==
Default exception handler: error/1: The input bucket does not exist. Debug: 
Error code: 1: The input bucket does not exist.
$a contents: 
* line 115 of /files/converter/librelambda/cli/provision.php: moodle_exception thrown

!!! error/1: The input bucket does not exist. !!!
!! 
Error code: 1: The input bucket does not exist.
$a contents:  !!
!! Stack trace: * line 115 of /files/converter/librelambda/cli/provision.php: moodle_exception thrown
 !!

And Moodle version is 3.7.3, with the latest librelambda version published on official Moodle website. Also I am using AWS Region cn-north-1(Beijing).

It seems that the S3 bucket hasn't been created? Any help will be appreciated!

mattporritt commented 4 years ago

Hi @aec2016 , From the output of this script I can see the input bucket has not been created. And we know that the provisioning script does indeed work. The only suggestions I have for you are:

Cheers, Matt P

aec2016 commented 4 years ago

Hi @mattporritt , Thanks a lot for your suggestions. I moved the test enviroment to AWS China since my local test network does not have an external IP, which might cause potiential problems as you mentioned in the third suggestions.

This time I am able to create a S3 resouce bucket in AWS China regions using provision script. However, the corresponding configurations were not automatically filled in with the parameter "--set-config" in the plugin setting page. I tried to fill in the settings page manually with created S3 bucket name. Then I ran the test.php in cli to see if the conversion works, I got the following error output:

➜ sudo -u www-data php files/converter/librelambda/cli/test.php \
--keyid=AKIAQUBZ******B3IMG2 \
--secret=qVVk****IdFSJ/Z2****GanQ/lXdg3I/Az****GC \
--region=cn-north-1 \
--input-bucket=df4fbaec5cdee176af5986edb78a54ce-input \
--output-bucket=df4fbaec5cdee176af5986edb78a54ce-output \
--file='/var/www/html/moodle2019/files/converter/librelambda/tests/fixtures/testsubmission.odt'
== Uploading test file ==
!!! error/1: The input bucket does not exist. !!!

So I tried to run provision script again:

sudo -u www-data php files/converter/librelambda/cli/provision.php \
--keyid=AKIAQUBZ******B3IMG2 \
--secret=qVVk****IdFSJ/Z2****GanQ/lXdg3I/Az****GC \
--region=cn-north-1 \
--set-config
== Creating resource S3 Bucket ==
!!! error/1: Bucket exists !!!

It says the Bucket already exists. The created S3 bucket content is only two zip files as following:

截屏2020-01-0310 39 35

I am not sure if the provision.php script works fine or just partly done? Many thanks for your help in advance!