moodle does not work out of the box with mysql

Bug #463381 reported by Dan Shields
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
moodle (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: moodle

Release of Ubuntu: Karmic Koala (presently pre-release version)

moodle:
  Installed: 1.9.4.dfsg-0ubuntu4
  Candidate: 1.9.4.dfsg-0ubuntu4
  Version table:
 *** 1.9.4.dfsg-0ubuntu4 0
        500 http://ca.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

Recently I installed the pre-release of Karmic, I did so to set up a fresh moodle server, but moodle did not work out of the box! (by 'out of the box' I mean, using only the distro CD and apt-* tools to install fresh packages from the karmic repository) From rigorous investigation I found the package php-db was not installed, when it was installed, moodle worked! I suggest we add php-db to the moodle control file.

Revision history for this message
Dan Shields (d4nshields) wrote :

Steps to replicate:

1. install fresh karmic ubuntu on a new box.
2. apt-get install moodle
3. navigate to 'http://localhost/moodle'
** ALL MOODLE PAGES ARE BLANK, on my tests.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

I can't duplicate this bug on a new Karmic install followed by sudo aptitude install moodle. Moodle appears to work just fine without php-db. Did you do anything unusual when attempting to install moodle? Did you choose postgresql or mysql ?

Could you please attach a copy of /var/log/dpkg.log ?

Changed in moodle (Ubuntu):
status: New → Incomplete
Revision history for this message
Dan Shields (d4nshields) wrote : Re: [Bug 463381] Re: moodle package is lacking critical dependancy on php-db
  • dpkg.log Edit (1.2 MiB, application/octet-stream; name="dpkg.log")

It appears to only affect the mysql-server choice. The postgres choice is
fine.

You were right to suggest the /var/log/dpkg.log file, it shows that the
php5-mysql package was not installed with moodle. Examining the moodle
control file, I see that it uses the expression:

Depends: ... php5-pgsql | php5-mysql, ...

And I consult with Debian Policy in order to understand the '|' thingy:
http://www.debian.org/doc/debian-policy/ch-relationships.html

>"In the Depends, Recommends, Suggests, Pre-Depends, Build-Depends and
Build-Depends-Indep control file fields of the package, which >declare
dependencies on other packages, the package names listed may also include
lists of alternative package names, >separated by vertical bar (pipe)
symbols |. In such a case, if any one of the alternative packages is
installed, that part of the >dependency is considered to be satisfied. "

Now, I am sure that the original intent of the depends line is to somehow
make the moodle package work equally well with both postgres and mysql.
However, given this expression aptitude always installs php5-pgsql
regardless of the selection of which server the administrator wants to use.
This means moodle with postgres works out of the box, and moodle with mysql
does not.

I must confess I was totally wrong initially, the problem is not php-db, but
rather the lack of php5-mysql. An easy workaround is to depend on both
(Depends: ...php5-pgsql, php5-mysql ...) equally. So far as I know, these
packages do not logically conflict nor provide conflicting paths.

On Thu, Oct 29, 2009 at 12:50 PM, Jeremy Bicha <email address hidden> wrote:

> I can't duplicate this bug on a new Karmic install followed by sudo
> aptitude install moodle. Moodle appears to work just fine without php-
> db. Did you do anything unusual when attempting to install moodle? Did
> you choose postgresql or mysql ?
>
> Could you please attach a copy of /var/log/dpkg.log ?
>
> ** Changed in: moodle (Ubuntu)
> Status: New => Incomplete
>
> --
> moodle package is lacking critical dependancy on php-db
> https://bugs.launchpad.net/bugs/463381
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Jeremy Bícha (jbicha) wrote : Re: moodle package is lacking critical dependancy on php-db

Moodle in both Debian and Ubuntu uses postgresql by default. If someone wants mysql, they will have to do more work. Basically, they will need to do something like:

sudo aptitude install moodle mysql-server php5-mysql

If they do this, neither postgresql or php5-pgsql will be installed and moodle will work just fine with mysql. Although php5-mysql is a small file, I'm not sure that we should install it for everyone. Basically, moodle works with either postgresql or mysql but if you want mysql you have to know what you're doing.

Maybe we should add a note that if you want mysql, you'll have to install php5-mysql.

I believe this bug will also occur if someone already has mysql-server installed without php5-mysql.

Changed in moodle (Ubuntu):
status: Incomplete → New
summary: - moodle package is lacking critical dependancy on php-db
+ moodle does not work out of the box with mysql
Revision history for this message
Dan Shields (d4nshields) wrote : Re: [Bug 463381] Re: moodle package is lacking critical dependancy on php-db

I get it. But for a moment I'd like to ask you to consider usabilty of this
package from the point of view of a typical installer. (Comments welcome ;-)

There are a number of problems with trying to get moodle to work out of the
box:

1. The information given in the README.Debian (which is where such a notice
should be) would lead one down the false belief that mysql/moodle is
supported in Debian/Ubuntu (what's that about my.cnf at the end? Adding a
note about 'sudo aptitude install moodle mysql-server php5-mysql' would be
helpful for the lost and weary).

2. The depends: line in the 'apt-cache show moodle' output gives the
impression that there is some kind of choice built in. According to the
syntax of the control file however, the primary choice will always satisfy
the installer, regardless of administrator preferences set elsewhere.
'php5-pgsql' (and postgresql-client, postgresql) should then be dependencies
each on the one package alone. It should be clear rather than ambiguous
what exactly you are getting when you install 'moodle' from Debian/Ubuntu.

3. The install screens give the false impression that there is an either/or
decision being made by the administrator. That is, the administrator
believes that he/she is choosing to set up Moodle with either
postgresql-server or mysql-server. This choice has no effect on the
packages which were already chosen by aptitude. If indeed these scripts are
not supported by Debian/Ubuntu then perhaps they should not be shown at all.

On Fri, Oct 30, 2009 at 2:27 AM, Jeremy Bicha <email address hidden> wrote:

> Moodle in both Debian and Ubuntu uses postgresql by default. If someone
> wants mysql, they will have to do more work. Basically, they will need
> to do something like:
>
> sudo aptitude install moodle mysql-server php5-mysql
>
> If they do this, neither postgresql or php5-pgsql will be installed and
> moodle will work just fine with mysql. Although php5-mysql is a small
> file, I'm not sure that we should install it for everyone. Basically,
> moodle works with either postgresql or mysql but if you want mysql you
> have to know what you're doing.
>
> Maybe we should add a note that if you want mysql, you'll have to
> install php5-mysql.
>
> I believe this bug will also occur if someone already has mysql-server
> installed without php5-mysql.
>
> ** Changed in: moodle (Ubuntu)
> Status: Incomplete => New
>
> ** Summary changed:
>
> - moodle package is lacking critical dependancy on php-db
> + moodle does not work out of the box with mysql
>
> --
> moodle does not work out of the box with mysql
> https://bugs.launchpad.net/bugs/463381
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Dan Shields (d4nshields) wrote :

here's a diff for README.Debian with some text that is open for debate.

23a24,40
> While administrators can choose to set up Moodle with MySQL or Postgres,
> Postgres is the configuration that is automatically chosen by the install
> scripts. If you insist on a MySQL install then moodle should be
> installed using the following command:
>
> $ sudo aptitude install moodle mysql-server php5-mysql
>
> If you have already gone through the Moodle install scripts and selected
> 'mysql-server', then your Moodle install is BROKEN. To un-break it
> run the following commands:
>
> $ sudo aptitude install mysql-server php5-mysql
> $ sudo dpkg-reconfigure moodle
>
> User accounts, access rights, and database rights ought to be set up in
> your MySQL database using your favorite MySQL administration tool.
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.