unable to run command gm-bootstrap_server

Bug #478114 reported by Preetam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNUmed
Invalid
Low
ncq

Bug Description

I have an UBUNTU 9.10. I tried installing GNUMED and facing lot of problems.
I first installed postgresql-8.4, then installed gnumed-server, then run the command gnumed-server. I get the response cannot bootstrap bundles I am unable to proceed with the installation.

This is the response I get
===========================================================
Bootstrapping latest GNUmed database.

This will set up a GNUmed database of version v11
with the name "gnumed_v11".
Adjusting PYTHONPATH ...
/var/lib/gnumed/Gnumed/pycommon/gmTools.py:13: DeprecationWarning: the MimeWriter module is deprecated; use the email package instead
  import urllib2 as wget, decimal, StringIO, MimeWriter, mimetypes, mimetools
Traceback (most recent call last):
  File "/usr/lib/python2.6/logging/__init__.py", line 768, in emit
    msg = self.format(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 648, in format
    return fmt.format(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 436, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.6/logging/__init__.py", line 306, in getMessage
    msg = msg % self.args
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/lib/python2.6/logging/__init__.py", line 768, in emit
    msg = self.format(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 648, in format
    return fmt.format(record)
  File "/usr/lib/python2.6/logging/__init__.py", line 439, in format
    s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 31: ordinal not in range(128)
=======================================
Bootstrapping GNUmed database system...
=======================================
You are about to install the following parts of GNUmed:
-------------------------------------------------------
bundle "config" in <gnumed_v2> (or overridden) on <>
bundle "reference" in <gnumed_v2> (or overridden) on <>
bundle "demographics" in <gnumed_v2> (or overridden) on <>
bundle "clinical" in <gnumed_v2> (or overridden) on <>
bundle "documents" in <gnumed_v2> (or overridden) on <>
bundle "office" in <gnumed_v2> (or overridden) on <>
-------------------------------------------------------
This will set up a monolithic GNUmed backend with all bundles
in one database named [gnumed]. It will contain the core schema
without country or language-specific components. Those will
have to be added by using one of the bootstrap-XX.conf file
where XX represents the ISO country code.

Currently this file will also import the test accounts which
MUST be removed prior to real use.

==> bootstrapping "config" ...
==> creating target database [gnumed_v2] from [template1] (5280 kB) ...
Cannot bootstrap bundles.
Please check the log file for details.
Bootstrapping "gnumed_v11" did not finish successfully. Aborting.

Please help me how to continue

Revision history for this message
Preetam (preetam-krish) wrote :
Download full text (3.7 KiB)

# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the
# PostgreSQL documentation for a complete description
# of this file. A short synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: "local" is a Unix-domain socket,
# "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an
# SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket.
#
# DATABASE can be "all", "sameuser", "samerole", a database name, or
# a comma-separated list thereof.
#
# USER can be "all", a user name, a group name prefixed with "+", or
# a comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names from
# a separate file.
#
# CIDR-ADDRESS specifies the set of hosts the record matches.
# It is made up of an IP address and a CIDR mask that is an integer
# (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies
# the number of significant bits in the mask. Alternatively, you can write
# an IP address and netmask in separate columns to specify the set of hosts.
#
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi", "krb5",
# "ident", "pam", "ldap" or "cert". Note that "password" sends passwords
# in clear text; "md5" is preferred since it sends encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE. The available options depend on the different authentication
# methods - refer to the "Client Authentication" section in the documentation
# for a list of which options are available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other special
# characters must be quoted. Quoting one of the keywords "all", "sameuser" or
# "samerole" makes the name lose its special character, and just match a
# database or username with that name.
#
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal. If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect. You can use
# "pg_ctl reload" to do that.

# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL listen
# on a non-local interface via the listen_addresses configuration parameter,
# or via the -i or -h command line switches.
#

# DO NOT DISABLE!
# If you change this first entry you will need to make sure that the
# database
# super user can access the database ...

Read more...

Revision history for this message
Preetam (preetam-krish) wrote :

# allow anyone knowing the proper password to
# log into our GNUmed databases
local samegroup +gm-logins md5

 added these lines - the problem persists
am able to connect to the public database but not able to create a local database

Revision history for this message
Jim Busser (jbusser) wrote : Re: [Bug 478114] Re: unable to run command gm-bootstrap_server
Download full text (4.1 KiB)

Hi Preetam

Others will likely give you a better answer but in the meantime I'll
point you to a wiki page where I have started to compile tips (I am
wondering if it is an ASCII / UTF problem that may need you first
installing or setting something)

 http://wiki.gnumed.de/bin/view/Gnumed/TroubleshootPostgreSQL

... if you do follow the link to the "incident" follow that thread to

 http://lists.gnu.org/archive/html/gnumed-devel/2009-10/msg00167.html

in case you may want to preserve any configuration information

On 2009-11-07, at 11:34 PM, Preetam wrote:

> # allow anyone knowing the proper password to
> # log into our GNUmed databases
> local samegroup +gm-logins md5
>
>
> added these lines - the problem persists
> am able to connect to the public database but not able to create a
> local database
>
> --
> unable to run command gm-bootstrap_server
> https://bugs.launchpad.net/bugs/478114
> You received this bug notification because you are a member of GNUmed
> development team, which is subscribed to GNUmed.
>
> Status in GNUmed - electronic medical record: New
>
> Bug description:
> I have an UBUNTU 9.10. I tried installing GNUMED and facing lot of
> problems.
> I first installed postgresql-8.4, then installed gnumed-server, then
> run the command gnumed-server. I get the response cannot bootstrap
> bundles I am unable to proceed with the installation.
>
> This is the response I get
> ===========================================================
> Bootstrapping latest GNUmed database.
>
> This will set up a GNUmed database of version v11
> with the name "gnumed_v11".
> Adjusting PYTHONPATH ...
> /var/lib/gnumed/Gnumed/pycommon/gmTools.py:13: DeprecationWarning:
> the MimeWriter module is deprecated; use the email package instead
> import urllib2 as wget, decimal, StringIO, MimeWriter, mimetypes,
> mimetools
> Traceback (most recent call last):
> File "/usr/lib/python2.6/logging/__init__.py", line 768, in emit
> msg = self.format(record)
> File "/usr/lib/python2.6/logging/__init__.py", line 648, in format
> return fmt.format(record)
> File "/usr/lib/python2.6/logging/__init__.py", line 436, in format
> record.message = record.getMessage()
> File "/usr/lib/python2.6/logging/__init__.py", line 306, in
> getMessage
> msg = msg % self.args
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
> 0: ordinal not in range(128)
> Traceback (most recent call last):
> File "/usr/lib/python2.6/logging/__init__.py", line 768, in emit
> msg = self.format(record)
> File "/usr/lib/python2.6/logging/__init__.py", line 648, in format
> return fmt.format(record)
> File "/usr/lib/python2.6/logging/__init__.py", line 439, in format
> s = self._fmt % record.__dict__
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
> 31: ordinal not in range(128)
> =======================================
> Bootstrapping GNUmed database system...
> =======================================
> You are about to install the following parts of GNUmed:
> -------------------------------------------------------
> bundle "config" in <gnumed_v2> (or overridden) on <>
> bundle "r...

Read more...

Revision history for this message
shilbert (sebastian-hilbert) wrote : Re: [Bug 478114] [NEW] unable to run command gm-bootstrap_server
Download full text (3.4 KiB)

Am Sonntag 08 November 2009 07:33:52 schrieb Preetam:

Hi,

Thanks for trying GNUmed.

The ascii errors are non-fatal. Those can be ignored.
Please locate the log files created and attach them to the bug report.

These should reside in /var/lib/gnumed/server/bootstrap.
We appreciate your effort.

Sebastian Hillbert

> Public bug reported:
>
> I have an UBUNTU 9.10. I tried installing GNUMED and facing lot of
> problems. I first installed postgresql-8.4, then installed gnumed-server,
> then run the command gnumed-server. I get the response cannot bootstrap
> bundles I am unable to proceed with the installation.
>
> This is the response I get
> ===========================================================
> Bootstrapping latest GNUmed database.
>
> This will set up a GNUmed database of version v11
> with the name "gnumed_v11".
> Adjusting PYTHONPATH ...
> /var/lib/gnumed/Gnumed/pycommon/gmTools.py:13: DeprecationWarning: the
> MimeWriter module is deprecated; use the email package instead import
> urllib2 as wget, decimal, StringIO, MimeWriter, mimetypes, mimetools
> Traceback (most recent call last):
> File "/usr/lib/python2.6/logging/__init__.py", line 768, in emit
> msg = self.format(record)
> File "/usr/lib/python2.6/logging/__init__.py", line 648, in format
> return fmt.format(record)
> File "/usr/lib/python2.6/logging/__init__.py", line 436, in format
> record.message = record.getMessage()
> File "/usr/lib/python2.6/logging/__init__.py", line 306, in getMessage
> msg = msg % self.args
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0:
> ordinal not in range(128) Traceback (most recent call last):
> File "/usr/lib/python2.6/logging/__init__.py", line 768, in emit
> msg = self.format(record)
> File "/usr/lib/python2.6/logging/__init__.py", line 648, in format
> return fmt.format(record)
> File "/usr/lib/python2.6/logging/__init__.py", line 439, in format
> s = self._fmt % record.__dict__
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 31:
> ordinal not in range(128) =======================================
> Bootstrapping GNUmed database system...
> =======================================
> You are about to install the following parts of GNUmed:
> -------------------------------------------------------
> bundle "config" in <gnumed_v2> (or overridden) on <>
> bundle "reference" in <gnumed_v2> (or overridden) on <>
> bundle "demographics" in <gnumed_v2> (or overridden) on <>
> bundle "clinical" in <gnumed_v2> (or overridden) on <>
> bundle "documents" in <gnumed_v2> (or overridden) on <>
> bundle "office" in <gnumed_v2> (or overridden) on <>
> -------------------------------------------------------
> This will set up a monolithic GNUmed backend with all bundles
> in one database named [gnumed]. It will contain the core schema
> without country or language-specific components. Those will
> have to be added by using one of the bootstrap-XX.conf file
> where XX represents the ISO country code.
>
> Currently this file will also import the test accounts which
> MUST be removed prior to real use.
>
> ==> bootstrapping "config" ...
> ==> creating targ...

Read more...

Revision history for this message
Jerzy Luszawski (dr-agon) wrote :

Sunday 08 November 2009 07:33:52 Preetam napisał(a):
> I have an UBUNTU 9.10. I tried installing GNUMED and facing lot of
> problems. I first installed postgresql-8.4, then installed gnumed-server,
> then run the command gnumed-server. I get the response cannot bootstrap
> bundles I am unable to proceed with the installation.
I also run it on Ubuntu. There may be a problem with shell scripts using
the 'su' command, while in Ubuntu everything is by default done by 'sudo'
command. Check if you executed it with proper permissions.

I cannot see a script named 'gnumed-server' in the package, except for cron
action making database backup. Was it the exact command that failed?
Maybe you should use 'bootstrap-latest.sh' (remember to execute it as root).

Jerzy Luszawski

Revision history for this message
ncq (karsten-hilbert) wrote :

On Sun, Nov 08, 2009 at 12:17:32PM -0000, J.Luszawski wrote:

> I also run it on Ubuntu. There may be a problem with shell scripts using
> the 'su' command, while in Ubuntu everything is by default done by 'sudo'
> command. Check if you executed it with proper permissions.
>
> I cannot see a script named 'gnumed-server' in the package

Oh, the Debian packages (and thus the Ubuntu packages) come
with

 /usr/sbin/gm-bootstrap_server

In fact, try

 /usr/sbin/gm-<TAB>

It'll list a whole bunch of useful scripts ;-)

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

Revision history for this message
ncq (karsten-hilbert) wrote : Re: [Bug 478114] Re: unable to run command gm-bootstrap_server

On Sun, Nov 08, 2009 at 07:28:00AM -0000, Preetam wrote:

> # PostgreSQL Client Authentication Configuration File

...

> # Database administrative login by UNIX sockets
> local all postgres ident
>
> # TYPE DATABASE USER CIDR-ADDRESS METHOD
>
> # "local" is for Unix domain socket connections only
> local all all ident
> # IPv4 local connections:
> host all all 127.0.0.1/32 md5
> # IPv6 local connections:
> host all all ::1/128 md5

That's OK for bootstrapping.

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

Revision history for this message
ncq (karsten-hilbert) wrote :

On Sun, Nov 08, 2009 at 07:34:32AM -0000, Preetam wrote:

> # allow anyone knowing the proper password to
> # log into our GNUmed databases
> local samegroup +gm-logins md5
>
>
> added these lines - the problem persists
> am able to connect to the public database but not able to create a local database

Yep, the above line IS needed but only for connecting with
the client *after* bootstrapping.

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

Revision history for this message
ncq (karsten-hilbert) wrote :

On Sun, Nov 08, 2009 at 07:56:05AM -0000, Jim Busser wrote:

> Others will likely give you a better answer but in the meantime I'll
> point you to a wiki page where I have started to compile tips (I am
> wondering if it is an ASCII / UTF problem that may need you first
> installing or setting something)

Nope, the UTF8 problem we are seeing here is an issue inside
the Python logging framework that's well known to them but
so far unfixed. Nothing we can do anything about. It is also
related to the Python 2.x decision to use "ascii" as the
default codec (Python 3.x uses utf8).

At least we've got a workaround installed so it's non-fatal.

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

Revision history for this message
Preetam (preetam-krish) wrote :
Download full text (75.0 KiB)

2009-11-08 13:01:37 CRITICAL gm.logging (/var/lib/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #231): -------- start of logging ------------------------------
2009-11-08 13:01:37 INFO gm.logging (/var/lib/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #232): log file is </var/lib/gnumed/server/bootstrap/bootstrap-latest.log>
2009-11-08 13:01:37 INFO gm.logging (/var/lib/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #233): log level is [DEBUG]
2009-11-08 13:01:37 INFO gm.logging (/var/lib/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #234): log file encoding is <utf8>
2009-11-08 13:01:37 INFO gm.logging (/var/lib/gnumed/Gnumed/pycommon/gmLog2.py::__setup_logging() #235): initial python.str -> python.unicode encoding is <ANSI_X3.4-1968>
2009-11-08 13:01:37 INFO gm.cfg (/var/lib/gnumed/Gnumed/pycommon/gmCfg2.py::<module>() #19): $Revision: 1.20 $
2009-11-08 13:01:37 INFO gm.bootstrapper (/var/lib/gnumed/Gnumed/pycommon/gmPsql.py::<module>() #18): $Revision: 1.10 $
2009-11-08 13:01:37 INFO gm.db (/var/lib/gnumed/Gnumed/pycommon/gmLoginInfo.py::<module>() #13): $Revision: 1.17 $
2009-11-08 13:01:37 INFO gm.i18n (/var/lib/gnumed/Gnumed/pycommon/gmI18N.py::<module>() #63): $Revision: 1.47 $
2009-11-08 13:01:37 INFO gm.datetime (/var/lib/gnumed/Gnumed/pycommon/gmDateTime.py::<module>() #58): $Revision: 1.29 $
2009-11-08 13:01:37 INFO gm.datetime (/var/lib/gnumed/Gnumed/pycommon/gmDateTime.py::<module>() #59): mx.DateTime version: 3.1.2
2009-11-08 13:01:37 INFO gm.db (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::<module>() #29): $Revision: 1.115 $
2009-11-08 13:01:37 INFO gm.db (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::<module>() #41): psycopg2 version: 2.0.8 (dec mx dt ext pq3)
2009-11-08 13:01:37 INFO gm.db (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::<module>() #42): PostgreSQL via DB-API module "<module 'psycopg2' from '/usr/lib/python2.6/dist-packages/psycopg2/__init__.pyc'>": API level 2.0, thread safety 2, parameter style "pyformat"
2009-11-08 13:01:37 DEBUG psycopg2 (/usr/lib/python2.6/dist-packages/psycopg2/pool.py::<module>() #34): installed. Logging using Python logging module
2009-11-08 13:01:37 INFO gm.db (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::<module>() #69): assuming default client encoding of [UTF8]
2009-11-08 13:01:37 INFO gm.tools (/var/lib/gnumed/Gnumed/pycommon/gmTools.py::<module>() #29): $Revision: 1.87 $
2009-11-08 13:01:37 INFO gm.bootstrapper (/var/lib/gnumed/server/bootstrap/gmAuditSchemaGenerator.py::<module>() #32): $Revision: 1.33 $
2009-11-08 13:01:37 INFO gm.bootstrapper (/var/lib/gnumed/server/bootstrap/gmNotificationSchemaGenerator.py::<module>() #29): $Revision: 1.36 $
2009-11-08 13:01:37 DEBUG gm.i18n (/var/lib/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #125): unmodified startup locale settings (should be [C])
2009-11-08 13:01:37 DEBUG gm.i18n (/var/lib/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #127): current locale settings:
2009-11-08 13:01:37 DEBUG gm.i18n (/var/lib/gnumed/Gnumed/pycommon/gmI18N.py::__log_locale_settings() #128): locale.g...

Revision history for this message
Preetam (preetam-krish) wrote :

I tried running the script bootstrap-latest.sh doesn't help

Revision history for this message
Preetam (preetam-krish) wrote :

contd#11...same response "cannot bootstrap bundles..."

Revision history for this message
ncq (karsten-hilbert) wrote :

On Sun, Nov 08, 2009 at 07:24:11PM -0000, Preetam wrote:

...

> 2009-11-08 13:01:37 INFO gm.db (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::get_raw_connection() #1200): PostgreSQL version (numeric): 8.4

...

> 2009-11-08 13:01:37 DEBUG gm.db (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::__log_PG_settings() #1446): PG option [server_encoding]: SQL_ASCII
> 2009-11-08 13:01:37 DEBUG gm.db (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::__log_PG_settings() #1446): PG option [server_version]: 8.4.1

...

There's your problem right there:

> 2009-11-08 13:01:39 ERROR gm.bootstrapper (./bootstrap_gm_db_system.py::__create_db() #774): >>>[
> create database "gnumed_v2" with
> owner = "gm-dbo"
> template = "template1"
> encoding = 'unicode'
> ;]<<< failed
> Traceback (most recent call last):
> File "./bootstrap_gm_db_system.py", line 772, in __create_db
> cursor.execute(cmd)
> File "/usr/lib/python2.6/dist-packages/psycopg2/extras.py", line 88, in execute
> return _cursor.execute(self, query, vars, async)
> DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
> HINT: Use the same encoding as in the template database, or use template0 as template.

You can try editing bootstrap-monolithic_core.conf to contain:

[database core]
...
template database = template0
...

You will, however, then have to enable access to template0
inside PostgreSQL (don't forget to re-disable it
afterwards).

It is probably better, however, to teach Ubuntu to use utf8
in the first place. The above isn't guarantueed to work
either.

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

Revision history for this message
shilbert (sebastian-hilbert) wrote :

Am Sonntag 08 November 2009 20:59:26 schrieb ncq:
> On Sun, Nov 08, 2009 at 07:24:11PM -0000, Preetam wrote:
>
> > File "/usr/lib/python2.6/dist-packages/psycopg2/extras.py", line 88, in
> > execute return _cursor.execute(self, query, vars, async)
> > DataError: new encoding (UTF8) is incompatible with the encoding of the
> > template database (SQL_ASCII) HINT: Use the same encoding as in the
> > template database, or use template0 as template.
>
If you do not have any other data inside the PostgreSQL database consider
setting it up with a UFT-8 cluster.

If you need help with this let us know. It seems Ubuntu installs a database
cluster with SQL_ASCII encoding which is ancient and is insufficient for
GNUmed and many other software products that want to store e.g. umlauts.

While this an Ubuntu problem let us know if you need help.

Sebastian

Revision history for this message
shilbert (sebastian-hilbert) wrote :

Am Sonntag 08 November 2009 20:59:26 schrieb ncq:
> On Sun, Nov 08, 2009 at 07:24:11PM -0000, Preetam wrote:
>
> ...
>
> > 2009-11-08 13:01:37 INFO gm.db
>
> (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::get_raw_connection() #1200):
> PostgreSQL version (numeric): 8.4
>
> ...
>
> > 2009-11-08 13:01:37 DEBUG gm.db
> > (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::__log_PG_settings() #1446): PG
> > option [server_encoding]: SQL_ASCII 2009-11-08 13:01:37 DEBUG gm.db
> > (/var/lib/gnumed/Gnumed/pycommon/gmPG2.py::__log_PG_settings() #1446): PG
> > option [server_version]: 8.4.1
>
> ...
>
> There's your problem right there:
> > 2009-11-08 13:01:39 ERROR gm.bootstrapper
> > (./bootstrap_gm_db_system.py::__create_db() #774): >>>[ create database
> > "gnumed_v2" with
> > owner = "gm-dbo"
> > template = "template1"
> > encoding = 'unicode'
> > ;]<<< failed
> > Traceback (most recent call last):
> > File "./bootstrap_gm_db_system.py", line 772, in __create_db
> > cursor.execute(cmd)
> > File "/usr/lib/python2.6/dist-packages/psycopg2/extras.py", line 88, in
> > execute return _cursor.execute(self, query, vars, async)
> > DataError: new encoding (UTF8) is incompatible with the encoding of the
> > template database (SQL_ASCII) HINT: Use the same encoding as in the
> > template database, or use template0 as template.
>
> You can try editing bootstrap-monolithic_core.conf to contain:
>
> [database core]
> ...
> template database = template0
> ...
>
> You will, however, then have to enable access to template0
> inside PostgreSQL (don't forget to re-disable it
> afterwards).
>
> It is probably better, however, to teach Ubuntu to use utf8
> in the first place. The above isn't guarantueed to work
> either.
>
> Karsten
>
See the following thread.

http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/5b4850ca8e980c83?pli=1

Revision history for this message
Jerzy Luszawski (dr-agon) wrote :

Sunday 08 November 2009 20:59:26 ncq napisał(a):
>
> There's your problem right there:
(...)
> > DataError: new encoding (UTF8) is incompatible with the encoding of the
> > template database (SQL_ASCII) HINT: Use the same encoding as in the
> > template database, or use template0 as template.
>
> You can try editing bootstrap-monolithic_core.conf to contain:
(...)
> It is probably better, however, to teach Ubuntu to use utf8
> in the first place.
Exactly! Is your system encoding set to UTF-8 (check the output of 'locale'
command)?

Most probably Postgres during setup did not recognized your locale as UTF-8,
and created a database template with default locale SQL_ASCII, which cause
trouble.

You have 2 possibilities:
1. edit the bootstrap config as Karsten described
2. fix your Postgres installation and bootstrap gnumed (and any other
databases) without problems

If you want to fix Postgres istallation, either re-create the whole database:
See the list archive at
http://lists.gnu.org/archive/html/gnumed-devel/2009-10/msg00167.html
or at least create template1 database with proper encoding:
see:
http://www.postgresql.org/docs/8.4/static/manage-ag-templatedbs.html

Revision history for this message
Preetam (preetam-krish) wrote :

Dear Karsten
I could change the template1 to template0 but can you please tell how to enable access to the template0 from postgresql. I have no idea

Revision history for this message
Preetam (preetam-krish) wrote :

Hi Luszawski
http://www.postgresql.org/docs/8.4/static/manage-ag-templatedbs.html - to crate database mentions
createdb -T template0 dbname

what is the dbname that am i supposed to give?

Revision history for this message
Jerzy Luszawski (dr-agon) wrote :

Monday 09 November 2009 10:44:25 Preetam napisał(a):
> http://www.postgresql.org/docs/8.4/static/manage-ag-templatedbs.html - to crate database mentions
> createdb -T template0 dbname
>
> what is the dbname that am i supposed to give?
Whatever you want. But the purpose is to make things easy, so I would create proper template1 database, and then bootstrap the gnumed database using standard scripts, which can be upgraded without remembering to fiddle with config etc..

First, I would recommend using SQL instead of shell command.
Just do 'sudo -u postgres psql' to log-in to postgres databases as user postgres.
Then drop the template1 database and recreate it:
postgres=# DROP DATABASE template1;
postgres=# CREATE DATABASE template1 WITH TEMPLATE=template0 ENCODING=UTF8;
verify encoding:
postgres=# \connect template1
template1=# show server_encoding;
...
template1=# show lc_ctype;
...
Check if the output contains UTF8.

Then log-out and try to bootstrap gnumed as root.

Jerzy Luszawski

Revision history for this message
Preetam (preetam-krish) wrote :

preetam@acer-laptop:/var/lib/gnumed/server/bootstrap$ sudo -u postgres psql
psql (8.4.1)
Type "help" for help.

postgres=# DROP DATABASE template1;
ERROR: cannot drop a template database
postgres=# CREATE DATABASE template1 WITH TEMPLATE=template0 ENCODING=UTF8;
ERROR: syntax error at or near "UTF8"
LINE 1: ...TE DATABASE template1 WITH TEMPLATE=template0 ENCODING=UTF8;
                                                                                                                           ^
postgres=#

Revision history for this message
Preetam (preetam-krish) wrote :
Revision history for this message
Preetam (preetam-krish) wrote :

postgres=# \connect template1
psql (8.4.1)
You are now connected to database "template1".
template1=# show server_encoding;
 server_encoding
-----------------
 SQL_ASCII
(1 row)

template1=# show lc_ctype;
 lc_ctype
----------
 C
(1 row)

template1=#

Revision history for this message
Jerzy Luszawski (dr-agon) wrote :

Monday 09 November 2009 13:26:56 Preetam napisał(a):
>
> preetam@acer-laptop:/var/lib/gnumed/server/bootstrap$ sudo -u postgres psql
> psql (8.4.1)
> Type "help" for help.
>
> postgres=# DROP DATABASE template1;
> ERROR: cannot drop a template database
From the postgres manual page, I have pointed to eariler:
"To delete template1, it must have pg_database.datistemplate = false."
So execute first:
UPDATE pg_database SET datistemplate = False WHERE datname='template1';
then try to drop template1.
> postgres=# CREATE DATABASE template1 WITH TEMPLATE=template0 ENCODING=UTF8;
> ERROR: syntax error at or near "UTF8"
Oh, probably UTF8 should be quoted, try 'UTF8'.

If you have so many problems, you should better drop the entire cluster and recreate it with proper encoding, as in the message I pointed to you earlier.

BTW - what is your system encoding?

Jerzy Luszawski

Revision history for this message
Preetam (preetam-krish) wrote :

I don't know what is encoding mean - I guess the answer to your question is probably SQL_ASCII

Revision history for this message
Preetam (preetam-krish) wrote :

postgres=# UPDATE pg_database SET datistemplate = False WHERE datname='template1';
UPDATE 1
postgres=# DROP DATABASE template1;
DROP DATABASE
postgres=# CREATE DATABASE template1 WITH TEMPLATE=template0 ENCODING='UTF8';
CREATE DATABASE
postgres=# connect template1
postgres-# \connect template1
psql (8.4.1)
You are now connected to database "template1".
template1-# show server_encoding;
ERROR: syntax error at or near "connect"
LINE 1: connect template1
        ^
template1=# show server_encoding;
 server_encoding
-----------------
 UTF8
(1 row)

template1=# show lc_ctype;
 lc_ctype
----------
 C
(1 row)

Revision history for this message
Preetam (preetam-krish) wrote :

I have attached the latest log. "We very likely succeeded" I will refer to the installation guide and come up here if I face any other problems.

Thank you

Revision history for this message
ncq (karsten-hilbert) wrote :

> postgres=# UPDATE pg_database SET datistemplate = False WHERE
> datname='template1';
> UPDATE 1
> postgres=# DROP DATABASE template1;
> DROP DATABASE
> postgres=# CREATE DATABASE template1 WITH TEMPLATE=template0
> ENCODING='UTF8';
> CREATE DATABASE
> postgres=# connect template1
> postgres-# \connect template1
> psql (8.4.1)
> You are now connected to database "template1".
> template1-# show server_encoding;
> ERROR: syntax error at or near "connect"
> LINE 1: connect template1
> ^
> template1=# show server_encoding;
> server_encoding
> -----------------
> UTF8
> (1 row)
>
> template1=# show lc_ctype;
> lc_ctype
> ----------
> C
> (1 row)

That looks good to me. Please retry bootstrapping.

Karsten

--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

Revision history for this message
ncq (karsten-hilbert) wrote :

not a GNUmed bug

Changed in gnumed:
assignee: nobody → ncq (karsten-hilbert)
importance: Undecided → Low
status: New → Invalid
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.