gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] bootstrapping database problem


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] bootstrapping database problem
Date: Tue, 15 Jul 2008 16:18:38 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, Jul 15, 2008 at 12:49:23PM +0200, Florian Hubold wrote:

>> Surely. As the very first step I would make sure I can
>> bootstrap the database just so. Download the tarball,
>> bootstrap from that.
>>
>> What happens if you try that ?
>>   
> Seems not to work, seems to be some problem with postgresql configuration.
That is entirely possible. PostgreSQL is quite powerful in
how it can be set up and thus a bit complex and certainly
site-dependant.

> The bootstrapping script doesn't find it, but it's running,
> actually it is a fresh installation where the database just got initialized.
That's good.

> But the errors messages in bootstrap-latest-v2.log are over my head.
No problem, I wrote them to be able to tell what's going on.

> First it finds the template1 db, creates some users and groups,
> then it creates the gnumed_v2 db, then there are some errors ending in:
>
>    "could not access file "$libdir/plpgsql": No such file or directory"
Sounds like the plpgsql package for PostgreSQL isn't
properly installed.


pg_ident.conf:

> # PostgreSQL Ident Authentication Maps
...
> # MAPNAME     IDENT-USERNAME    PG-USERNAME
> gm-dbo-alikes gmadm gm-dbo

This line should not be needed unless you are using a system user gmadm.

> postgres-alikes postgres postgres
> postgres-alikes gmadm postgres

Same here, that last line is only needed if you have a
system user gmadm which you want to use to handle the
bootstrapping.

In fact, the whole pg_ident.conf business is only needed
when you want to bootstrap as a user different from either
root or postgres.


postgresql.conf
> # -----------------------------
> # PostgreSQL configuration file
> # -----------------------------
No settings needed unless you want to enable remote machines
to connect. In that case set listen_address.

> local template1 postgres ident postgres-alikes
> local gnumed_v7 postgres ident postgres-alikes
> local gnumed_v8 postgres ident postgres-alikes
> local all postgres ident sameuser
> local template1 gm-dbo ident gm-dbo-alikes
> local samegroup +gm-logins md5

Uh, like, those need to be in pg_hba.conf ?!?

And then only this line

> local samegroup +gm-logins md5

is really needed. Except if you want to bootstrap under an
account other than root/postgres, then you'd need this too:

> local template1 postgres ident postgres-alikes
> local gnumed_vX postgres ident postgres-alikes
> local all postgres ident sameuser

I have somewhat reoarganized

        http://wiki.gnumed.de/bin/view/ConfigurePostgreSQL

so perhaps that's a bit clearer now.

> $ sudo urpmi gnumed-server
> Um die Abh??ngigkeiten zu erf??llen, werden die folgenden Pakete installiert
>    Package                        Version      Release       Arch
> (medium "local")
>   gnumed-server                  v8           6mud2008.1    i586
> (medium "main_release")
>   postgresql8.3                  8.3.1        2mdv2008.1    i586
>   postgresql8.3-plpython         8.3.1        2mdv2008.1    i586
>   postgresql8.3-server           8.3.1        2mdv2008.1    i586

This really looks like it's missing postgresql8.3-plpgsql
(unless that's included in the basic server anyway).

In the bootstrap log I noticed this:

> Stopping postgresql service: [FEHLER]
What is this about ?

Oh, maybe PG didn't run yet.

> + cd /usr/lib/gnumed-server/server/bootstrap
> + pwd
> /usr/lib/gnumed-server/server/bootstrap
OK, looks sane.

> + ./bootstrap-latest.sh
> ln: Erzeuge symbolische Verkn??pfung ???Gnumed???: Die Datei existiert bereits
Yep, sounds right.

> /usr/lib/gnumed-server/server/bootstrap
> ===========================================================
> Bootstrapping latest GNUmed database.
...
> ==> bootstrapping "config" ...
...
> ==> creating new target database [gnumed_v2] ...
>     (this can take a while if [template1] is large)
So far so good.

> Cannot bootstrap bundles.
:-o

> Please check the log file for details.
Let's go do that ...

> 2008-07-15 12:28:49    
> ------------------------------------------------------------
...
> 2008-07-15 12:28:50  [INFO]   (./bootstrap_gm_db_system.py:address@hidden):  
> Successfully created GNUmed database [gnumed_v2].
...
> 2008-07-15 12:28:50  [INFO]   (./bootstrap_gm_db_system.py:address@hidden):  
> trying DB connection to gnumed_v2 on localhost as postgres
...
> 2008-07-15 12:28:50  [INFO]   (./bootstrap_gm_db_system.py:address@hidden):  
> successfully connected
...
> 2008-07-15 12:28:50  [DATA]   
> (/usr/lib/gnumed-server/Gnumed/pycommon/gmPsql.py:address@hidden):  create 
> language 'plpgsql'
> 2008-07-15 12:28:50  [DATA]   
> (/usr/lib/gnumed-server/Gnumed/pycommon/gmPsql.py:address@hidden):  
> ../sql/gmCreateProceduralLanguages.sql:20: could not access file 
> "$libdir/plpgsql": No such file or directory
Creating plpgsql fails.

> 2008-07-15 12:28:50  [DATA]   
> (/usr/lib/gnumed-server/Gnumed/pycommon/gmPsql.py:address@hidden):  
> SELECT CASE
>       WHEN (SELECT COUNT(1) > 0 FROM pg_language WHERE lanname = 'plpgsql') 
> THEN
>               true
>       ELSE
>               (SELECT make_plpgsql())
>     END
> 
> 2008-07-15 12:28:50  [DATA]   
> (/usr/lib/gnumed-server/Gnumed/pycommon/gmPsql.py:address@hidden):  
> ../sql/gmCreateProceduralLanguages.sql:42: could not access file "plpgsql": 
> No such file or directoryCONTEXT:  SQL function "make_plpgsql" statement 1
The second method we try fails, too.

> 2008-07-15 12:28:50  [INFO]   (./bootstrap_gm_db_system.py:address@hidden):  
> successfully imported [../sql/gmCreateProceduralLanguages.sql]
But the GNUmed bootstrapper fails to detect that and thus later ...

> 2008-07-15 12:28:50  [DATA]   
> (/usr/lib/gnumed-server/Gnumed/pycommon/gmPsql.py:address@hidden):  create or 
> replace function gm_create_user(name, text)
>       returns boolean
>       language 'plpgsql'
...
> 2008-07-15 12:28:50  [ERROR]  
> (/usr/lib/gnumed-server/Gnumed/pycommon/gmPsql.py:address@hidden):  
> ../sql/gmCreateUserFunction.sql:49: language "plpgsql" does not existHINT:  
> Use CREATE LANGUAGE to load the language into the database.

... *using* that procedural language fails :-)

> 2008-07-15 12:28:50  [ERROR]  (./bootstrap_gm_db_system.py:address@hidden):  
> failed to import [../sql/gmCreateUserFunction.sql]
Which, eventually, GNUmed does detect and then aborts
bootstrapping such that the user does not end up with a
faulty database and not know about it.

I have added an explicit test to the appropriate SQL file
(which will only appear in the database release gnumed_v10,
however).

You need to include the postgresql-plpgsql.rpm in the
dependencies. We'll then have to make sure it installs the
language into the template1 database (very likely it does).

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]