Trouble upgrading to 2.1

Using the latest snapshot from Jenkins, I get this upgrading from 2.0.6 to 2.1

* INFO 13:33:49,514 System property dhis2.home not set
(DefaultLocationManager.java [Thread-2])
* INFO 13:33:49,520 Environment variable DHIS2_HOME points to
/etc/dhis2/ghain/ (DefaultLocationManager.java [Thread-2])
* INFO 13:35:37,796 Executing startup routine [1 of 12, runlevel 1]:
TableAlteror (DefaultStartupRoutineExecutor.java [Thread-2])
* INFO 13:35:42,926 Tables updated (TableAlteror.java [Thread-2])
* INFO 13:35:42,971 Executing startup routine [2 of 12, runlevel 2]:
PeriodTypePopulator (DefaultStartupRoutineExecutor.java [Thread-2])
* INFO 13:35:43,171 Executing startup routine [3 of 12, runlevel 3]:
TableCreator (DefaultStartupRoutineExecutor.java [Thread-2])
* INFO 13:35:43,311 Table aggregateddatavalue exists
(TableCreator.java [Thread-2])
* INFO 13:35:43,326 Table aggregatedindicatorvalue exists
(TableCreator.java [Thread-2])
* INFO 13:35:43,345 Index crosstab exists on table datavalue
(TableCreator.java [Thread-2])
* INFO 13:35:43,349 Table aggregateddatasetcompleteness exists
(TableCreator.java [Thread-2])
* INFO 13:35:43,354 Table datavaluearchive exists (TableCreator.java
[Thread-2])
* INFO 13:35:43,358 Table patientdatavaluearchive exists
(TableCreator.java [Thread-2])
* INFO 13:35:43,359 Executing startup routine [4 of 12, runlevel 3]:
DataElementDefaultDimensionPopulator
(DefaultStartupRoutineExecutor.java [Thread-2])
* INFO 13:35:43,431 Linked default category with default concept
(DataElementDefaultDimensionPopulator.java [Thread-2])
* INFO 13:35:46,037 Executing startup routine [5 of 12, runlevel 3]:
MultiDimensionExpressionUpgrader (DefaultStartupRoutineExecutor.java
[Thread-2])
* WARN 13:35:46,078 SQL Error: 0, SQLState: 42703
(JDBCExceptionReporter.java [Thread-2])
* ERROR 13:35:46,079 ERROR: column dataelemen1_.uuid does not exist
  Position: 166 (JDBCExceptionReporter.java [Thread-2])

···

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

Hi,

···

Den 2. mars 2011 kl. 18.08 skrev Jason Pickering:

Using the latest snapshot from Jenkins, I get this upgrading from 2.0.6 to 2.1

* ERROR 13:35:46,079 ERROR: column dataelemen1_.uuid does not exist
Position: 166 (JDBCExceptionReporter.java [Thread-2])

Since we want to use a more stable id for external communication, I think I added uuid to dataelement (at least I've added the population of uuids on startup).

I think that means you have to have

hibernate.hbm2ddl.auto = update

set on the first startup for Hibernate to take care of adding it. I think this is our "default" way of handling db changes, but we should probably be more explicit about it..

Jo

Thanks for this Jo, but I think this is not the issue. A bit more detail.

1) Here is my hibernate.properties file.

wheel@dhissvr01:~$ tail -f /etc/dhis2/ghain/hibernate.properties
hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://*****/*****
hibernate.connection.username = dhis2
hibernate.connection.password = *******
hibernate.hbm2ddl.auto = update

I already have it.

2) Here is the query produced by Hibernate, which fails from the postgres log.

DETAIL: parameters: $1 = 'default'
ERROR: column dataelemen1_.uuid does not exist at character 166
STATEMENT: select optioncomb0_.categorycomboid as category2_149_1_,
optioncomb0_.categoryoptioncomboid as category1_1_,
dataelemen1_.categoryoptioncomboid as category1_143_0_,
dataelemen1_.uuid as uuid143_0_, dataelemen1_1_.categorycomboid as
category2_144_0_ from categorycombos_optioncombos optioncomb0_ inner
join categoryoptioncombo dataelemen1_ on
optioncomb0_.categoryoptioncomboid=dataelemen1_.categoryoptioncomboid
left outer join categorycombos_optioncombos dataelemen1_1_ on
dataelemen1_.categoryoptioncomboid=dataelemen1_1_.categoryoptioncomboid
where optioncomb0_.categorycomboid=$1
ERROR: current transaction is aborted, commands ignored until end of
transaction block

Look carefully and you will see that the dataelement1_ table
references categoryoptioncombo, which according to the query, needs a
uuid.

3) dataelement already has a uuid column.

Regards,
Jason

···

On Wed, Mar 2, 2011 at 2:54 PM, Jo Størset <storset@gmail.com> wrote:

Hi,

Den 2. mars 2011 kl. 18.08 skrev Jason Pickering:

Using the latest snapshot from Jenkins, I get this upgrading from 2.0.6 to 2.1

* ERROR 13:35:46,079 ERROR: column dataelemen1_.uuid does not exist
Position: 166 (JDBCExceptionReporter.java [Thread-2])

Since we want to use a more stable id for external communication, I think I added uuid to dataelement (at least I've added the population of uuids on startup).

I think that means you have to have

hibernate.hbm2ddl.auto = update

set on the first startup for Hibernate to take care of adding it. I think this is our "default" way of handling db changes, but we should probably be more explicit about it..

Jo

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

More ominously

categorycombos_optioncombos was nuked.

I had to restore from backup.

Regards,
Jason

···

On Wed, Mar 2, 2011 at 3:03 PM, Jason Pickering <jason.p.pickering@gmail.com> wrote:

Thanks for this Jo, but I think this is not the issue. A bit more detail.

1) Here is my hibernate.properties file.

wheel@dhissvr01:~$ tail -f /etc/dhis2/ghain/hibernate.properties
hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://*****/*****
hibernate.connection.username = dhis2
hibernate.connection.password = *******
hibernate.hbm2ddl.auto = update

I already have it.

2) Here is the query produced by Hibernate, which fails from the postgres log.

DETAIL: parameters: $1 = 'default'
ERROR: column dataelemen1_.uuid does not exist at character 166
STATEMENT: select optioncomb0_.categorycomboid as category2_149_1_,
optioncomb0_.categoryoptioncomboid as category1_1_,
dataelemen1_.categoryoptioncomboid as category1_143_0_,
dataelemen1_.uuid as uuid143_0_, dataelemen1_1_.categorycomboid as
category2_144_0_ from categorycombos_optioncombos optioncomb0_ inner
join categoryoptioncombo dataelemen1_ on
optioncomb0_.categoryoptioncomboid=dataelemen1_.categoryoptioncomboid
left outer join categorycombos_optioncombos dataelemen1_1_ on
dataelemen1_.categoryoptioncomboid=dataelemen1_1_.categoryoptioncomboid
where optioncomb0_.categorycomboid=$1
ERROR: current transaction is aborted, commands ignored until end of
transaction block

Look carefully and you will see that the dataelement1_ table
references categoryoptioncombo, which according to the query, needs a
uuid.

3) dataelement already has a uuid column.

Regards,
Jason

On Wed, Mar 2, 2011 at 2:54 PM, Jo Størset <storset@gmail.com> wrote:

Hi,

Den 2. mars 2011 kl. 18.08 skrev Jason Pickering:

Using the latest snapshot from Jenkins, I get this upgrading from 2.0.6 to 2.1

* ERROR 13:35:46,079 ERROR: column dataelemen1_.uuid does not exist
Position: 166 (JDBCExceptionReporter.java [Thread-2])

Since we want to use a more stable id for external communication, I think I added uuid to dataelement (at least I've added the population of uuids on startup).

I think that means you have to have

hibernate.hbm2ddl.auto = update

set on the first startup for Hibernate to take care of adding it. I think this is our "default" way of handling db changes, but we should probably be more explicit about it..

Jo

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

<snip/>

This sounds about right. I guess I only added uuids that are missing for data elements, while optioncombo has also gotten uuid added in the hibernate mapping (it already had uuid as a property). I thought hibernate would take care of updating by itself, and have not noticed any trouble myself (on quite a lot of databases). But I'm not the most knowledgable about hibernate, so there might be subtle details I don't know about.

This uuid is not critical for now (as long as nobody needs to post datavalues with combos to the api), so it can be removed from the branch if finding another solution is difficult.

Jo

···

Den 2. mars 2011 kl. 19.33 skrev Jason Pickering:

Thanks for this Jo, but I think this is not the issue. A bit more detail.

0

···

Sent from my BlackBerry® wireless device

-----Original Message-----
From: Jo Størset <storset@gmail.com>
Sender: dhis2-devs-bounces+greg.rowles=gmail.com@lists.launchpad.net
Date: Wed, 2 Mar 2011 20:00:40
To: Jason Pickering<jason.p.pickering@gmail.com>
Cc: dhis2-devs<dhis2-devs@lists.launchpad.net>
Subject: Re: [Dhis2-devs] Trouble upgrading to 2.1

Den 2. mars 2011 kl. 19.33 skrev Jason Pickering:

Thanks for this Jo, but I think this is not the issue. A bit more detail.

<snip/>

This sounds about right. I guess I only added uuids that are missing for data elements, while optioncombo has also gotten uuid added in the hibernate mapping (it already had uuid as a property). I thought hibernate would take care of updating by itself, and have not noticed any trouble myself (on quite a lot of databases). But I'm not the most knowledgable about hibernate, so there might be subtle details I don't know about.

This uuid is not critical for now (as long as nobody needs to post datavalues with combos to the api), so it can be removed from the branch if finding another solution is difficult.

Jo
_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

OK. Not really sure what to do at this point then. I have tried the
procedure several times. My categoryoptioncombo table is defined as
follows

CREATE TABLE categoryoptioncombo
(
  categoryoptioncomboid integer NOT NULL,
  CONSTRAINT categoryoptioncombo_pkey PRIMARY KEY (categoryoptioncomboid)
)
WITH (
  OIDS=FALSE
);

Does not seem to have a uuid property. Is this the right table?

···

On Wed, Mar 2, 2011 at 3:30 PM, Jo Størset <storset@gmail.com> wrote:

Den 2. mars 2011 kl. 19.33 skrev Jason Pickering:

Thanks for this Jo, but I think this is not the issue. A bit more detail.

<snip/>

This sounds about right. I guess I only added uuids that are missing for data elements, while optioncombo has also gotten uuid added in the hibernate mapping (it already had uuid as a property). I thought hibernate would take care of updating by itself, and have not noticed any trouble myself (on quite a lot of databases). But I'm not the most knowledgable about hibernate, so there might be subtle details I don't know about.

This uuid is not critical for now (as long as nobody needs to post datavalues with combos to the api), so it can be removed from the branch if finding another solution is difficult.

Jo

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

Works here… Permissions? Try adding a “uuid” column manually (like the one we have for dataelement etc) as a quick fix.

···

On Wed, Mar 2, 2011 at 3:45 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

OK. Not really sure what to do at this point then. I have tried the

procedure several times. My categoryoptioncombo table is defined as

follows

CREATE TABLE categoryoptioncombo

(

categoryoptioncomboid integer NOT NULL,

CONSTRAINT categoryoptioncombo_pkey PRIMARY KEY (categoryoptioncomboid)

)

WITH (

OIDS=FALSE

);

Does not seem to have a uuid property. Is this the right table?

On Wed, Mar 2, 2011 at 3:30 PM, Jo Størset storset@gmail.com wrote:

Den 2. mars 2011 kl. 19.33 skrev Jason Pickering:

Thanks for this Jo, but I think this is not the issue. A bit more detail.

This sounds about right. I guess I only added uuids that are missing for data elements, while optioncombo has also gotten uuid added in the hibernate mapping (it already had uuid as a property). I thought hibernate would take care of updating by itself, and have not noticed any trouble myself (on quite a lot of databases). But I’m not the most knowledgable about hibernate, so there might be subtle details I don’t know about.

This uuid is not critical for now (as long as nobody needs to post datavalues with combos to the api), so it can be removed from the branch if finding another solution is difficult.

Jo

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+260974901293


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Yeah, I am beginning to think it is a permissions issue...again....

···

On Wed, Mar 2, 2011 at 3:49 PM, Lars Helge Øverland <larshelge@gmail.com> wrote:

Works here.. Permissions? Try adding a "uuid" column manually (like the one
we have for dataelement etc) as a quick fix.

On Wed, Mar 2, 2011 at 3:45 PM, Jason Pickering > <jason.p.pickering@gmail.com> wrote:

OK. Not really sure what to do at this point then. I have tried the
procedure several times. My categoryoptioncombo table is defined as
follows

CREATE TABLE categoryoptioncombo
(
categoryoptioncomboid integer NOT NULL,
CONSTRAINT categoryoptioncombo_pkey PRIMARY KEY (categoryoptioncomboid)
)
WITH (
OIDS=FALSE
);

Does not seem to have a uuid property. Is this the right table?

On Wed, Mar 2, 2011 at 3:30 PM, Jo Størset <storset@gmail.com> wrote:
>
> Den 2. mars 2011 kl. 19.33 skrev Jason Pickering:
>
>> Thanks for this Jo, but I think this is not the issue. A bit more
>> detail.
>
>
> <snip/>
>
> This sounds about right. I guess I only added uuids that are missing for
> data elements, while optioncombo has also gotten uuid added in the hibernate
> mapping (it already had uuid as a property). I thought hibernate would take
> care of updating by itself, and have not noticed any trouble myself (on
> quite a lot of databases). But I'm not the most knowledgable about
> hibernate, so there might be subtle details I don't know about.
>
> This uuid is not critical for now (as long as nobody needs to post
> datavalues with combos to the api), so it can be removed from the branch if
> finding another solution is difficult.
>
> Jo

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293