health
[Top][All Lists]
Advanced

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

Re: [Health] Issue upgrading a database from gnuhealth 3.2 to gnuhealth


From: Armand MPASSY-NZOUMBA
Subject: Re: [Health] Issue upgrading a database from gnuhealth 3.2 to gnuhealth 3.4
Date: Sat, 15 Jun 2019 03:59:59 +0000 (UTC)

Hi Axel,

On Friday, June 14, 2019, 4:24:24 PM GMT+1, Axel Braun <address@hidden> wrote:


> Hello Armand,

> In
> /usr/share/doc/packages/gnuhealth/upgrade/3.4/
> is a script that needs to be applied to your 3.2 database:
> psql mydb < /usr/share/doc/packages/gnuhealth/upgrade/3.4/upgrade_34.sql

> Did you apply this?

Thanks for advising. I did a vanilla installation and I finally managed to locate the scripts under:

/home/gnuhealth/gnuhealth-3.4.1/scripts/upgrade/3.4


Here are my findings:

Case 1: Following the instructions from the official GNU Health documentation.
Step 1:
1/I followed the instructions in the manual by first applying tryton-admin and then applying the scripts:
./trytond-admin --all --database=your_database_name
psql your_db_name < upgrade_34.sql

I got the following error:
UndefinedColumn: column a.fed_country does not exist

Here is the error message:

Traceback (most recent call last):

File "/usr/bin/tryton", line 67, in <module>

client.TrytonClient().run()

File "/usr/lib/python2.7/site-packages/tryton/client.py", line 293, in run

main.sig_login()

File "/usr/lib/python2.7/site-packages/tryton/gui/main.py", line 876, in sig_login

common.Login(func)

File "/usr/lib/python2.7/site-packages/tryton/common/common.py", line 1049, in __init__

func(parameters)

File "/usr/lib/python2.7/site-packages/tryton/gui/main.py", line 873, in <lambda>

host, port, database, username, parameters, language)

File "/usr/lib/python2.7/site-packages/tryton/rpc.py", line 72, in login

result = connection.common.db.login(username, parameters, language)

File "/usr/lib64/python2.7/xmlrpclib.py", line 1243, in __call__

return self.__send(self.__name, args)

File "/usr/lib/python2.7/site-packages/tryton/jsonrpc.py", line 297, in __request

raise Fault(*response['error'])

Fault: <Fault u'column a.fed_country does not exist\nLINE 1: ...education", "a"."ethnic_group" AS "ethnic_group", "a"."fed_c...\n ^\n': u'Traceback (most recent call last):\n File "/trytond/wsgi.py", line 70, in dispatch_request\n return endpoint(request, **request.view_args)\n File "/trytond/protocols/dispatcher.py", line 41, in rpc\n request, database_name, *request.rpc_params)\n File "/trytond/protocols/dispatcher.py", line 54, in login\n database_name, user, parameters, language=language)\n File "/trytond/security.py", line 41, in login\n session, = Session.create([{}])\n File "/trytond/model/modelsql.py", line 605, in create\n cls._validate(sub_records)\n File "/trytond/model/modelstorage.py", line 37, in wrapper\n return func(*args, **kwargs)\n File "/trytond/model/modelstorage.py", line 963, in _validate\n ctx_pref = User.get_preferences(context_only=True)\n File "/trytond/res/user.py", line 432, in get_preferences\n preferences = cls._get_preferences(user, context_only=context_only)\n File "/trytond/modules/company/company.py", line 196, in _get_preferences\n context_only=context_only)\n File "/trytond/res/user.py", line 395, in _get_preferences\n getattr(user, field).rec_name\n File "/trytond/model/fields/field.py", line 283, in __get__\n return inst.__getattr__(self.name)\n File "/trytond/model/modelstorage.py", line 1436, in __getattr__\n read_data = self.read(list(ids), list(ffields.keys()))\n File "/trytond/model/modelsql.py", line 779, in read\n getter_results = field.get(ids, cls, field_list, values=result)\n File "/trytond/model/fields/function.py", line 102, in get\n return dict((name, call(name)) for name in names)\n File "/trytond/model/fields/function.py", line 102, in <genexpr>\n return dict((name, call(name)) for name in names)\n File "/trytond/model/fields/function.py", line 96, in call\n return dict((r.id, method(r, name)) for r in records)\n File "/trytond/model/fields/function.py", line 96, in <genexpr>\n return dict((r.id, method(r, name)) for r in records)\n File "/trytond/modules/company/company.py", line 52, in get_rec_name\n return self.party.rec_name\n File "/trytond/model/fields/field.py", line 283, in __get__\n return inst.__getattr__(self.name)\n File "/trytond/model/modelstorage.py", line 1436, in __getattr__\n read_data = self.read(list(ids), list(ffields.keys()))\n File "/trytond/model/modelsql.py", line 779, in read\n getter_results = field.get(ids, cls, field_list, values=result)\n File "/trytond/model/fields/function.py", line 102, in get\n return dict((name, call(name)) for name in names)\n File "/trytond/model/fields/function.py", line 102, in <genexpr>\n return dict((name, call(name)) for name in names)\n File "/trytond/model/fields/function.py", line 96, in call\n return dict((r.id, method(r, name)) for r in records)\n File "/trytond/model/fields/function.py", line 96, in <genexpr>\n return dict((r.id, method(r, name)) for r in records)\n File "/trytond/modules/health/health.py", line 802, in get_rec_name\n if self.lastname:\n File "/trytond/model/fields/field.py", line 283, in __get__\n return inst.__getattr__(self.name)\n File "/trytond/model/modelstorage.py", line 1436, in __getattr__\n read_data = self.read(list(ids), list(ffields.keys()))\n File "/trytond/model/modelsql.py", line 693, in read\n order_by=history_order, limit=history_limit))\n File "/trytond/backend/postgresql/database.py", line 60, in execute\n cursor.execute(self, sql, args)\npsycopg2.errors.UndefinedColumn: column a.fed_country does not exist\nLINE 1: ...education", "a"."ethnic_group" AS "ethnic_group", "a"."fed_c...\n ^\n\n'>


Step2:
I applied again the instruction to update my database:

./trytond-admin --all --database=your_database_name

I got another error:

psycopg2.errors.ForeignKeyViolation: insert or update on table "product_list_price" violates foreign key constraint "product_list_price_template_fkey"
DETAIL:  Key (template)=(563) is not present in table "product_template".


I guess that there is an issue with the update script.


Case 2: 
I applied the postgresql update script first before applying the trytond-admin update command.
The database was updated without problem
I got the same error message as stated above when I applied the trytond-admin command

Cheers,

Armand




Cheers
Axel




reply via email to

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