package moodle 1.9.4.dfsg-0ubuntu4 failed to install/upgrade: exit status 1 - ERROR: role "moodle" already exists

Bug #534971 reported by Bud Maddock
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
moodle (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: moodle

Database connection failed. After fixing up php.ini where the default memory_limit in Ubuntu is too small for Moodle 1.9 and restarting apache a pop-up window requests that "sudo dpkg-reconfigue moodle" be run. When this is run the database connection fails. The following solution has worked with a previous version of Ubuntu but is not currently functional.

The workaround is to remove --purge everything vaguely related to postgresql, remove moodle and start again.
rm -rf /var/lib/postgresql after saving its content in needed.
 sudo aptitude purge cl-sql-postgresql odbc-postgresql \
 postgresql-8.4 postgresql-common-8.4 postgresql-common
 sudo apt-get remove --purge postgresql-client-8.4
 sudo find / -name postgresql -exec rm -Rf {} \; removes users.
 sudo find / -name pgsql -exec rm -Rf {} \;
 sudo find / -name psql -exec rm -Rf {} \;
        apt-get -f install
        apt-get remove --purge moodle
        edit /etc/php5/apache2/php.ini modify so memory_limit =128M
        apt-get install postresql-8.4
        apt-get install moodle
Some things work sometimes. In a previous install of moodle (about a year ago) reloading libgd2-xpm caused it to start working. Moodle has broken every attempt at installation on Debian and Ubuntu for many years. The problem most often turns out to be php.ini related. If a reboot has been requested by an upgrade the above does not work until after the reboot has been performed.

Would it make sense to update the default php.ini to overcome this difficulty? Google is full of unsolved problems that appear to be the same as the one described. The suggested updates can be found here:
http://docs.moodle.org/en/Installing_Moodle/Creating_custom_php.ini_files

moodle 1.9.4, Ubuntu 9.10, postgresql 8.4.2, apache2 2.2.12, php5 5.2.10

ProblemType: Package
AptOrdering:
 moodle: Install
 moodle: Configure
Architecture: amd64
Date: Tue Mar 9 04:40:01 2010
DistroRelease: Ubuntu 9.10
ErrorMessage: subprocess installed post-installation script returned error exit status 1
Package: moodle 1.9.4.dfsg-0ubuntu4
PackageArchitecture: all
ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
SourcePackage: moodle
Title: package moodle 1.9.4.dfsg-0ubuntu4 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
Uname: Linux 2.6.31-19-generic x86_64

Revision history for this message
Bud Maddock (budmaddock) wrote :
tags: added: karmic
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

The relevant error is
---
Setting up moodle (1.9.4.dfsg-0ubuntu4) ...

Creating config file /etc/moodle/apache.conf with new version

Creating config file /etc/moodle/config.php with new version
[Tue Mar 09 04:40:01 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
[Tue Mar 09 04:40:01 2010] [warn] NameVirtualHost *:80 has no VirtualHosts
Your settings in /etc/postgresql/8.4/main/pg_hba.conf do not allow me to continue.
uid=120(moodle) gid=65534(nogroup) groups=65534(nogroup)
ERROR: role "moodle" already exists
dpkg: error processing moodle (--configure):
 subprocess installed post-installation script returned error exit status 1

It looks like the script tries to recreate the schema even if it already exists.

summary: - package moodle 1.9.4.dfsg-0ubuntu4 failed to install/upgrade: subprocess
- installed post-installation script returned error exit status 1
+ package moodle 1.9.4.dfsg-0ubuntu4 failed to install/upgrade: exit
+ status 1 - ERROR: role "moodle" already exists
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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