Thread: [Postfixadmin-devel] Setup error
Brought to you by:
christian_boltz,
gingerdog
From: Geoff S. <ge...@Qu...> - 2011-05-05 16:23:54
|
Hi, Apologies if this is the wrong place. I'm seting up a VPS running Debian Squeeze and I want to use PostfixAdmin. I managed to find the Debian package (I was surprised there isn't an official Debian package yet), installed it, manually linked the apache.conf file to the write place so that it would actually work then ran "lynx http://localhost/postfixadmin/setup.php". It all seemed to be going well until: updating to version 730 (PgSQL)... DEBUG INFORMATION: Invalid query: ERROR: language "plpgsql" does not exist HINT: Use CREATE LANGUAGE to load the language into the database. This is the first database to be used and I've not yet done any other Postfix configuration. I don't know enough about this to debug it, and figured someone else would know. Any thoughts? Geoff. |
From: Christian B. <pos...@cb...> - 2011-05-05 20:11:30
|
Hello, Am Donnerstag, 5. Mai 2011 schrieb Geoff Shang: > Apologies if this is the wrong place. You are perfectly right - it's just the mailinglist name that might be misleading ;-) (in other words: we don't have enough questions for a separate -users mailinglist.) > then ran "lynx http://localhost/postfixadmin/setup.php". > > updating to version 730 (PgSQL)... > > DEBUG INFORMATION: > Invalid query: ERROR: language "plpgsql" does not exist HINT: Use > CREATE LANGUAGE to load the language into the database. The interesting thing is that the function to update to version 730 first runs a 'CREATE LANGUAGE plpgsql' query. Looks like this fails on your system for some reason. Please run setup.php?debug=1 to get a more useful error message. Or login to PostgreSQL directly and run the following query: CREATE LANGUAGE plpgsql If you can't get it working, post the detailed PostgreSQL error message. David can then probably help you (I can't because I'm using MySQL ;-) Regards, Christian Boltz -- > ganz im Gegensatz zu dir süffisanten Personal-Firewall-/-Knallkopp. cool ... du bist ja putzig. > Geh mal einen Psychologen aufsuchen. ich dachte ich bin der Psychologe. soll ich mich also selber aufsuchen, ja? [> Timo Nentwig und Michael Meyer in suse-linux] |
From: Geoff S. <ge...@Qu...> - 2011-05-05 21:02:13
|
Hi, Thanks for the reply. On Thu, 5 May 2011, Christian Boltz wrote: >> then ran "lynx http://localhost/postfixadmin/setup.php". >> >> updating to version 730 (PgSQL)... >> >> DEBUG INFORMATION: >> Invalid query: ERROR: language "plpgsql" does not exist HINT: Use >> CREATE LANGUAGE to load the language into the database. > > The interesting thing is that the function to update to version 730 > first runs a 'CREATE LANGUAGE plpgsql' query. Looks like this fails on > your system for some reason. > > Please run setup.php?debug=1 to get a more useful error message. Updating database: - old version: 729; target version: 740 updating to version 730 (PgSQL)... CREATE LANGUAGE plpgsql DEBUG INFORMATION: Invalid query: ERROR: must be owner of database postfixadmin CREATE OR REPLACE FUNCTION merge_quota() RETURNS TRIGGER AS $merge_quota$ BEGIN UPDATE quota SET current = NEW.current + current WHERE username = NEW.username AND path = NEW.path; IF found THEN RETURN NULL; ELSE RETURN NEW; END IF; END; $merge_quota$ LANGUAGE plpgsql; DEBUG INFORMATION: Invalid query: ERROR: language "plpgsql" does not exist HINT: Use CREATE LANGUAGE to load the language into the database. > Or login to PostgreSQL directly and run the following query: > CREATE LANGUAGE plpgsql Not sure exactly what I need to do that. I've only just installed this on a clean VPS and don't know what account I should use to ogin. I'll need to go look at Debian docs I guess. Thanks, Geoff. |
From: Geoff S. <ge...@Qu...> - 2011-05-05 21:26:15
|
On Thu, 5 May 2011, Christian Boltz wrote: > Please run setup.php?debug=1 to get a more useful error message. FYI, I edited config.inc.php with my customisations, and then took its suggestion of saving it as config.local.php to proof it against upgrades. But when I ran setup.php, both with and without debug, I got the following in the error log: [Thu May 05 22:40:35 2011] [error] [client ::1] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 30720 bytes) in /etc/postfixadmin/config.local.php on line 137 If I used the original config.inc.php *or* my modified one as that filename (i.e. not being loaded as config.local.php), it ran just fine. Geoff. |
From: David G. <da...@co...> - 2011-05-05 21:55:23
|
See below. >> >> The interesting thing is that the function to update to version 730 >> first runs a 'CREATE LANGUAGE plpgsql' query. Looks like this fails on >> your system for some reason. >> >> Please run setup.php?debug=1 to get a more useful error message. > > Updating database: > > - old version: 729; target version: 740 > > updating to version 730 (PgSQL)... > > CREATE LANGUAGE plpgsql > > DEBUG INFORMATION: > Invalid query: ERROR: must be owner of database postfixadmin > > CREATE OR REPLACE FUNCTION merge_quota() RETURNS TRIGGER AS > $merge_quota$ BEGIN UPDATE quota SET current = NEW.current + current > WHERE username = NEW.username AND path = NEW.path; IF found THEN RETURN > NULL; ELSE RETURN NEW; END IF; END; $merge_quota$ LANGUAGE plpgsql; > sudo -s (or otherwise become root) su - postgres psql postfix (assuming db name is postfix; "psql -l" will list all databases) Copy and paste the above in.... if that fails, try the 'create language plpgsql' then paste the above in. I'm wondering if it's a case of some default setting changing.... thanks David. |
From: David G. <da...@co...> - 2011-05-05 22:00:23
|
On 5 May 2011, at 22:26, Geoff Shang wrote: > On Thu, 5 May 2011, Christian Boltz wrote: > >> Please run setup.php?debug=1 to get a more useful error message. > > FYI, I edited config.inc.php with my customisations, and then took its > suggestion of saving it as config.local.php to proof it against upgrades. > But when I ran setup.php, both with and without debug, I got the > following in the error log: > You /might/ have a circular reference there. config.local.php should only contain the variables / settings you wish to override, e.g. orange:~ $ cat src/postfixadmin/trunk/config.local.php <?php $CONF['configured'] = true; $CONF['setup_password'] = 'changeme'; $CONF['postfix_admin_url'] = '/david/postfixadmin/'; // shouldn't need changing. $CONF['postfix_admin_path'] = dirname(__FILE__); // Language config // Language files are located in './languages', change as required.. $CONF['default_language'] = 'en'; // Database Config // mysql = MySQL 3.23 and 4.0, 4.1 or 5 // mysqli = MySQL 4.1+ // pgsql = PostgreSQL $CONF['database_type'] = 'pgsql'; $CONF['database_host'] = 'pgsqlserver'; $CONF['database_user'] = 'dg'; $CONF['database_password'] = 'whatever'; $CONF['database_name'] = 'postfix'; $CONF['database_prefix'] = ''; $CONF['vacation'] = 'YES'; // end file. thanks David. > [Thu May 05 22:40:35 2011] [error] [client ::1] PHP Fatal error: Allowed > memory size of 134217728 bytes exhausted (tried to allocate 30720 bytes) > in /etc/postfixadmin/config.local.php on line 137 > > If I used the original config.inc.php *or* my modified one as that > filename (i.e. not being loaded as config.local.php), it ran just fine. > > Geoff. > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > Postfixadmin-devel mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postfixadmin-devel |
From: Geoff S. <ge...@Qu...> - 2011-05-05 22:36:10
|
On Thu, 5 May 2011, David Goodwin wrote: >> FYI, I edited config.inc.php with my customisations, and then took its >> suggestion of saving it as config.local.php to proof it against upgrades. >> But when I ran setup.php, both with and without debug, I got the >> following in the error log: >> > > You /might/ have a circular reference there. Oh of *course* I do. Duh!!!! <mutters something about PHP warning about including a file in itself> I did wonder how I managed to fill up 134 MB of RAM. Oops. It's getting late. Geoff. |
From: Geoff S. <ge...@Qu...> - 2011-05-05 22:59:37
|
On Thu, 5 May 2011, David Goodwin wrote: > See below. Thanks for getting back to me. >> updating to version 730 (PgSQL)... >> >> CREATE LANGUAGE plpgsql >> >> DEBUG INFORMATION: >> Invalid query: ERROR: must be owner of database postfixadmin >> >> CREATE OR REPLACE FUNCTION merge_quota() RETURNS TRIGGER AS >> $merge_quota$ BEGIN UPDATE quota SET current = NEW.current + current >> WHERE username = NEW.username AND path = NEW.path; IF found THEN RETURN >> NULL; ELSE RETURN NEW; END IF; END; $merge_quota$ LANGUAGE plpgsql; >> > > > sudo -s (or otherwise become root) > > su - postgres > > psql postfix (assuming db name is postfix; "psql -l" will list all databases) postgres@patronus:~$ psql postfix psql: FATAL: database "postfix" does not exist postgres@patronus:~$ psql -l List of databases Name | Owner | Encoding | Collation | Ctype | Access privileges --------------+----------+----------+-------------+-------------+----------------------- postfixadmin | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres : postgres=CTc/postgres (4 rows) postgres@patronus:~$ psql postfixadmin psql (8.4.7) Type "help" for help. > Copy and paste the above in.... if that fails, try the 'create language plpgsql' then paste the above in. postfixadmin=# CREATE OR REPLACE FUNCTION merge_quota() RETURNS TRIGGER AS $merge_quota$ BEGIN UPDATE quota SET current = NEW.current + current WHERE username = NEW.username AND path = NEW.path; IF found THEN RETURN NULL; ELSE RETURN NEW; END IF; END; $merge_quota$ LANGUAGE plpgsql; ERROR: language "plpgsql" does not exist HINT: Use CREATE LANGUAGE to load the language into the database. postfixadmin=# create language plpgsql; CREATE OR REPLACE FUNCTION merge_quota() RETURNS TRIGGER AS $merge_quota$ BEGIN UPDATE quota SET current = NEW.current + current WHERE username = NEW.username AND path = NEW.path; IF found THEN RETURN NULL; ELSE RETURN NEW; END IF; END; $merge_quota$ LANGUAGE plpgsql; CREATE LANGUAGE CREATE FUNCTION Looks like that worked. updating to version 730 (PgSQL)... CREATE LANGUAGE plpgsql DEBUG INFORMATION: Invalid query: ERROR: language "plpgsql" already exists CREATE OR REPLACE FUNCTION merge_quota() RETURNS TRIGGER AS $merge_quota$ BEGIN UPDATE quota SET current = NEW.current + current WHERE username = NEW.username AND path = NEW.path; IF found THEN RETURN NULL; ELSE RETURN NEW; END IF; END; $merge_quota$ LANGUAGE plpgsql; DEBUG INFORMATION: Invalid query: ERROR: must be owner of function merge_quota Ergh. Looks like I should have only run the "create language plpgsql" statement as user postgres and run the second query via the setup script. I'm guessing I can undo what I did as postgres, but as I'm not very familiar with postgresql, I'm not sure what I should do next. > I'm wondering if it's a case of some default setting changing.... Is there more information I can give you? Geoff. |
From: David G. <da...@co...> - 2011-05-06 01:08:35
|
> > > Ergh. Looks like I should have only run the "create language plpgsql" > statement as user postgres and run the second query via the setup script. > > I'm guessing I can undo what I did as postgres, but as I'm not very > familiar with postgresql, I'm not sure what I should do next. Either install phppgadmin or nuke the database from orbit and restart the installation - fixing the plpgsql problem first ;-) I'm sure you can fix permissions on postgresql objects, but I can't remember the syntax off the top of my head. Sorry, I'm not overly helpful. Thanks David. |
From: Geoff S. <ge...@Qu...> - 2011-05-06 14:33:47
|
On Fri, 6 May 2011, David Goodwin wrote: > Either install phppgadmin or nuke the database from orbit and restart > the installation - fixing the plpgsql problem first ;-) ah yes. I should have thought of this. This should work. I uninstalled the package so that dbconfig would get rid of the database. I didn't notice this the first time I installed, but when I reinstalled the package this time, I got the following errors: sh: getcwd() failed: No such file or directory shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory dbconfig-common: writing config to /etc/dbconfig-common/postfixadmin.conf shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory sh: getcwd() failed: No such file or directory shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory sh: getcwd() failed: No such file or directory creating postgres user postfixadmin: already exists. resetting password: success. sh: getcwd() failed: No such file or directory creating database postfixadmin: already exists. dbconfig-common: flushing administrative password It looks like it did all it should do, but the errors are a bit concerning. There's nothing about these in /var/log/dpkg.log. postgres@patronus:~$ psql postfixadmin psql (8.4.7) Type "help" for help. postfixadmin=# CREATE LANGUAGE plpgsql; ERROR: language "plpgsql" already exists Guess it already remembered that from before. hmm. Same error, guess i actually need to purge, not just uninstall. OK, didn't get the shell errors this time. hmm, still remembered the database. Will have to try removing postgresql *as well*. OK, this time I purged postfixadmin, postgresql-8.4 and dbconfig-common. I should add that each time I've removed the dump that the uninstall wrote to /var/tmp. This time, the PFA install didn't seem to give comments about he database already existing, despite the uninstall saying that it was gone. postgres@patronus:~$ psql postfixadmin psql (8.4.7) Type "help" for help. postfixadmin=# CREATE LANGUAGE plpgsql; CREATE LANGUAGE OK, everything worked this time. Obviously this will need to get sorted. Fortunately I'd only just installed the database so nothing was lost, but this won't always be the case. > I'm sure you can fix permissions on postgresql objects, but I can't > remember the syntax off the top of my head. I know almost nothing about PG. I'm more familiar with MySQL, but made the switch for philosophical reason. I decided the only way to learn it was to use it, but I've not made the time to actually learn it yet. > Sorry, I'm not overly helpful. You were very helpful. Thanks. Geoff. |
From: David G. <da...@co...> - 2011-05-06 15:17:52
|
On 6 May 2011, at 15:33, Geoff Shang wrote: > On Fri, 6 May 2011, David Goodwin wrote: > >> Either install phppgadmin or nuke the database from orbit and restart >> the installation - fixing the plpgsql problem first ;-) > > ah yes. I should have thought of this. This should work. > > I uninstalled the package so that dbconfig would get rid of the database. > I didn't notice this the first time I installed, but when I reinstalled > the package this time, I got the following errors: > > sh: getcwd() failed: No such file or directory > shell-init: error retrieving current directory: getcwd: cannot access > parent directories: No such file or directory > dbconfig-common: writing config to /etc/dbconfig-common/postfixadmin.conf > shell-init: error retrieving current directory: getcwd: cannot access > parent directories: No such file or directory > shell-init: error retrieving current directory: getcwd: cannot access > parent directories: No such file or directory > sh: getcwd() failed: No such file or directory > shell-init: error retrieving current directory: getcwd: cannot access > parent directories: No such file or directory > shell-init: error retrieving current directory: getcwd: cannot access > parent directories: No such file or directory > sh: getcwd() failed: No such file or directory > creating postgres user postfixadmin: already exists. > resetting password: success. > sh: getcwd() failed: No such file or directory > creating database postfixadmin: already exists. > dbconfig-common: flushing administrative password I'd guess your shell was 'in' /etc/postfixadmin or something similar which was removed when you nuked the package from orbit. > > It looks like it did all it should do, but the errors are a bit > concerning. There's nothing about these in /var/log/dpkg.log. > > postgres@patronus:~$ psql postfixadmin > psql (8.4.7) > Type "help" for help. > > postfixadmin=# CREATE LANGUAGE plpgsql; > ERROR: language "plpgsql" already exists > Yes, 'create language' is a database wide change... hence it just needs doing once. > Guess it already remembered that from before. > > hmm. Same error, guess i actually need to purge, not just uninstall. > > OK, didn't get the shell errors this time. > You'd probably changed directory! > hmm, still remembered the database. Will have to try removing postgresql > *as well*. > > OK, this time I purged postfixadmin, postgresql-8.4 and dbconfig-common. > I should add that each time I've removed the dump that the uninstall wrote > to /var/tmp. > I suspect that's a dbcommon thing. > This time, the PFA install didn't seem to give comments about he database > already existing, despite the uninstall saying that it was gone. > As expected, /var/lib/postgresql had been nuked. > postgres@patronus:~$ psql postfixadmin > psql (8.4.7) > Type "help" for help. > > postfixadmin=# CREATE LANGUAGE plpgsql; > CREATE LANGUAGE > > OK, everything worked this time. Obviously this will need to get sorted. > Fortunately I'd only just installed the database so nothing was lost, but > this won't always be the case. > >> I'm sure you can fix permissions on postgresql objects, but I can't >> remember the syntax off the top of my head. > > I know almost nothing about PG. I'm more familiar with MySQL, but made > the switch for philosophical reason. I decided the only way to learn it > was to use it, but I've not made the time to actually learn it yet. > >> Sorry, I'm not overly helpful. > > You were very helpful. Thanks. np. David |