Skip to content
Jun Pataleta edited this page Feb 18, 2020 · 23 revisions

How to use an empty password for MySQL/MariaDB?

You can not set an empty password during the initialisation (mdk init). However, you can use the following once MDK is initialised:

mdk config set db.mysqli.password ''
mdk config set db.mariadb.password ''

I upgraded MDK and it stopped working

You are probably missing some python packages. You should install the ones listed in requirements.txt using PIP. Unfortunately, some packages require additional Ubuntu packages.

sudo apt-get install python-dev libpq-dev libmysqlclient-dev 
sudo pip install -r /opt/moodle-sdk/requirements.txt

I upgraded MDK from 1.x.x to 2.x.x and it stopped working

MDK is probably still running as a Python2 program. A quick fix to this would be to uninstall both MDK and pip and reinstall them using Python3.

# If MDK is installed locally for the user.
pip uninstall moodle-sdk

# Or, if MDK is installed system-wide.
sudo pip uninstall moodle-sdk

# Uninstall pip.
sudo pip uninstall pip

# Download the latest get-pip.py.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

# Install pip using Python3. E.g. your Python3 executable is python3:
sudo python3 get-pip.py

# Install MDK as usual.
pip install --user moodle-sdk
# Or...
sudo pip install moodle-sdk

A new Moodle version was released, what should I do?

When a new major version is released, MDK has to be updated to reflect the new master version. Usually, a new MDK release would come close to a Moodle release. If you cannot wait, here is how to set master to Moodle 2.8:

Switch to the master branches
mdk doctor --branch

Add --fix to check out the right branches if they are incorrect.

Update your instances
mdk update --upgrade --all
Update the masterBranch value
mdk config set masterBranch <newMasterNumber>
mdk config set masterBranch 28

MDK thinks my stable_[26, 27, master, ...] is not [26, 27, master, ...]

MDK is unaware of the name of your instances and always guesses the version you are using from version.php. To fix the problem simply check out the stable branch for the version you want.

git checkout master
git checkout MOODLE_27_STABLE

For master, you might need to reset hard to the origin branch.

mdk update -c
git checkout master
git fetch `mdk config show upstreamRemote`
git reset --hard `mdk config show upstreamRemote`/master

Can MDK remember my Jira password?

Yes, you will need the python package keyring.

Using Ubuntu/Debian:

sudo apt-get install python-keyring

Using MacOS:

sudo easy_install pip
sudo pip install keyring

How to checkout a branch from a tracker issue?

mdk pull --no-merge MDL-12345

Behat is not working any more!

It might have happened because your Firefox was automatically updated, which often means that the version of Selenium that MDK cached is outdated. Run the following command to force the download of the latest version of Selenium.

mdk behat --selenium-download

How to upgrade all the instances, except one

Add a file called .noupgrade in the wwwroot of your Moodle instance. Now, when running mdk upgrade --all this instance will be skipped.

MDK has issues connecting to PostreSQL

Usually, the reason is that you do not have a database associated with the user that attempts to connect to PostgreSQL. MDK will not write anything in this database, it is just required for the connection to work.