Booting up a new EC2 with the bitnami moodle from the marketplae

Keywords: Moodle - AWS - Technical issue - Other
bnsupport ID: 813db836-7af0-a055-d067-afcbe00737c1
Description:
Hi guys, we tried to create a new ec2 instance with bitnami moodle. Previously whenever we created a new instance with moodle it would come with the default install of moodle.

Meaning when we first went to the site moodle would be already set up. But now, we’re faced with an ‘issue’ where we have to run through the installation from top to bottom. Is this what’s ‘normal’ / expected when you start up a new ec2 instance with moodle?

Also, I would like to note, we expected to see the moodle data in /bitnami/moodle and /bitnami/moodledata but with this instance it’s we find the install here /opt/bitnami/moodle and there isn’t a moodledata folder yet. As mentioned above, we would start a new instance with moodle already installed, but now we have to run through the install.

Hi @shibulendhambi

Thanks for using Bitnami Moodle!

Meaning when we first went to the site moodle would be already set up. But now, we’re faced with an ‘issue’ where we have to run through the installation from top to bottom. Is this what’s ‘normal’ / expected when you start up a new ec2 instance with moodle?

No, that is not the expected behaviour. You should expect to have Moodle up & running, just like you did before.

In order to test this, I have launched myself an instance matching the version reported in your bnsupport-tool id (3.11.0-2) on AWS, and it seems to work fine for me:

Main page working

Login as admin working

How are you creating the new instance? Are you using Bitnami LaunchPad or directly from the AWS Dashboard? In case of the latter, please make sure that the Status check shows the message 2/2 checks passed before connecting to it. This is because the instance may take some time to get ready, and it may be possible to see the moodle installation page for a while.

Can you please create a new instance and wait for the status check to succeed? After that, connect to it as usual and see if that resolves the issue :slightly_smiling_face:

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

Hi, thank you for the feedback. Will try create another instance and check the logs.
One thing I did see on the 2 ec2 instances we tried to create ( using the AWS dashboard) , when i checked the first-boot log file I get this.
2021-07-01T15:36:46.926Z - error: Unable to initialize instance Export setup for mariadb failed with exit code 1

@jcarmona

In the first boot log file we see the following :

2021-07-01T15:36:46.748Z - info: Initializing module mariadb

ESC[38;5;6mmariadb ESC[38;5;5m15:36:46.91 ESC[0mESC[38;5;2mINFO ESC[0m ==> Validating settings in MYSQL_*/MARIADB_* env vars
ESC[38;5;6mmariadb ESC[38;5;5m15:36:46.92 ESC[0mESC[38;5;1mERRORESC[0m ==> The MARIADB_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development.
2021-07-01T15:36:46.924Z - info: Saving configuration info to disk
2021-07-01T15:36:46.925Z - info: Saving configuration info to disk
2021-07-01T15:36:46.926Z - error: Unable to initialize instance Export setup for mariadb failed with exit code 1

Here’s the ami id if needed : ami-0e13f0e24a5e728fb (af-south-1)

Hi, we found the problem and solved it.

While trying to go through all the logs we could on the ec2 instance we had up and running. We kept seeing errors relating to :

ESC[38;5;6mmariadb ESC[38;5;5m15:36:46.92 ESC[0mESC[38;5;1mERRORESC[0m ==> The MARIADB_PASSWORD environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development.

So we decided to go through the set up scripts to see how it set this variable. It lead us to looking at the get_metadata and functions scripts. The instance metadata service used for our instance was IMDSv2. We believe because of this, the script wasn’t able to get the metadata it needed to completely set up moodle. We believe that this version (IMDSv2) isn’t supported by any function in the script that makes a curl to get metadata or userdata. aws_get_metadata_now() in the functions script being an example of one of those functions

We had to set the instance metadata service for our instance to be IMDSv1 and IMDSv2 so that the functions can curl and get back metadata

1 Like

Hi @shibulendhambi

Thank you very much for sharing your insights! I was able to reproduce your issue as soon as I selected IMDSv2 as the metadata version of the instance.

We had to set the instance metadata service for our instance to be IMDSv1 and IMDSv2 so that the functions can curl and get back metadata

Yes, selecting IMDSv1 as the metadata version should solve this. It seems that with the new schema, the instance is not able to retrieve important data on the setup.

I will notify the team to take a look at this. Again, thanks for reporting!

Best regards,
Jose Antonio Carmona


Was my answer helpful? Click on :heart:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.