Make upgrade-database error

I am going from 3.8.8 to 4.0.4 and am running into an issue during the
upgrade-database part.

When it goes from 3.8.8 to 3.8.9 there is an error that shows:

[Thu Mar 8 12:09:37 2012] [warning]: Use of uninitialized value in
string eq at /usr/local/src/rt-4.0.4/sbin/…/lib/RT/Template.pm line
627, <> line 1.
(/usr/local/src/rt-4.0.4/sbin/…/lib/RT/Template.pm:627)

It looks like it gets past that and moves on through till it gets to
3.9.5 where it dumps me out:

Processing 3.9.5
Now populating database schema.
[Thu Mar 8 12:09:50 2012] [crit]: DBD::Pg::st execute failed: ERROR:
more than one row returned by a subquery used as an expression
(/usr/local/src/rt-4.0.4/sbin/…/lib/RT.pm:341)
DBD::Pg::st execute failed: ERROR: more than one row returned by a
subquery used as an expression
make: *** [upgrade-database] Error 255

This is our second upgrade as we have 2 RT systems. The other upgrade
(3.8.7 to 4.0.4) went flawless. This upgrade is from an RT
installation that has more custom fields and maybe a few more
templates/scrips, but essentially it is very similar to the original
one.

Any ideas?

Thanks in advance!

Joe

Hi,

Probably the following select returns more than one row per custom
field. You should delete incorrect records and re-run upgrade:

SELECT ObjectId, Content FROM Attributes WHERE
Name = ‘Category’ AND ObjectType = ‘RT::CustomFieldValue’;On Thu, Mar 8, 2012 at 16:28, Joe Harris drey111@gmail.com wrote:

I am going from 3.8.8 to 4.0.4 and am running into an issue during the
upgrade-database part.

When it goes from 3.8.8 to 3.8.9 there is an error that shows:

[Thu Mar 8 12:09:37 2012] [warning]: Use of uninitialized value in
string eq at /usr/local/src/rt-4.0.4/sbin/…/lib/RT/Template.pm line
627, <> line 1.
(/usr/local/src/rt-4.0.4/sbin/…/lib/RT/Template.pm:627)

It looks like it gets past that and moves on through till it gets to
3.9.5 where it dumps me out:

Processing 3.9.5
Now populating database schema.
[Thu Mar 8 12:09:50 2012] [crit]: DBD::Pg::st execute failed: ERROR:
more than one row returned by a subquery used as an expression
(/usr/local/src/rt-4.0.4/sbin/…/lib/RT.pm:341)
DBD::Pg::st execute failed: ERROR: more than one row returned by a
subquery used as an expression
make: *** [upgrade-database] Error 255

This is our second upgrade as we have 2 RT systems. The other upgrade
(3.8.7 to 4.0.4) went flawless. This upgrade is from an RT
installation that has more custom fields and maybe a few more
templates/scrips, but essentially it is very similar to the original
one.

Any ideas?

Thanks in advance!

Joe

Best regards, Ruslan.

When it goes from 3.8.8 to 3.8.9 there is an error that shows:

[Thu Mar 8 12:09:37 2012] [warning]: Use of uninitialized value in
string eq at /usr/local/src/rt-4.0.4/sbin/…/lib/RT/Template.pm line
627, <> line 1.
(/usr/local/src/rt-4.0.4/sbin/…/lib/RT/Template.pm:627)

Ruslan already responded with the likely issue, but I wanted to point
out that the above is just a warning (notice it’s tagged [warning] after
the timestamp). It’s a good thing to read the warnings and see if
they’re indicative of an error, but in this case, the above is probably
harmless. Just FYI and for future list readers. :slight_smile:

Thomas

Hi,
Probably the following select returns more than one row per custom
field. You should delete incorrect records and re-run upgrade:
SELECT ObjectId, Content FROM Attributes WHERE
Name = ‘Category’ AND ObjectType = ‘RT::CustomFieldValue’;

Hi Ruz,

I dug this thread up from the archives, as I ran into the same error
while doing a test upgrade.

IIUC, every CustomFieldValue needs to be updated to contain a category
field from the old attributes table.

Rewriting the upgrade script for 3.9.5 into this:

UPDATE CustomFieldValues SET Category = att.Content
from Attributes att
WHERE att.ObjectId = CustomFieldValues.id
AND att.ObjectType = ‘RT::CustomFieldValue’
AND att.Name = ‘Category’

This fixed the problems for me.

Are you sure the original SQL is correct?

Regards,
Kai> On Thu, Mar 8, 2012 at 16:28, Joe Harris wrote:

I am going from 3.8.8 to 4.0.4 and am running into an issue during
the
upgrade-database part.
When it goes from 3.8.8 to 3.8.9 there is an error that shows:
[Thu Mar 8 12:09:37 2012] [warning]: Use of uninitialized value in
string eq at /usr/local/src/rt-4.0.4/sbin/…/lib/RT/Template.pm line
627, <> line 1.
(/usr/local/src/rt-4.0.4/sbin/…/lib/RT/Template.pm:627)
It looks like it gets past that and moves on through till it gets to
3.9.5 where it dumps me out:
Processing 3.9.5
Now populating database schema.
[Thu Mar 8 12:09:50 2012] [crit]: DBD::Pg::st execute failed: ERROR:
more than one row returned by a subquery used as an expression
(/usr/local/src/rt-4.0.4/sbin/…/lib/RT.pm:341)
DBD::Pg::st execute failed: ERROR: more than one row returned by a
subquery used as an expression
make: *** [upgrade-database] Error 255
This is our second upgrade as we have 2 RT systems. The other
upgrade
(3.8.7 to 4.0.4) went flawless. This upgrade is from an RT
installation that has more custom fields and maybe a few more
templates/scrips, but essentially it is very similar to the original
one.
Any ideas?
Thanks in advance!
Joe


Best regards, Ruslan.

I dug this thread up from the archives, as I ran into the same error
while doing a test upgrade.

IIUC, every CustomFieldValue needs to be updated to contain a
category field from the old attributes table.

Since this doesn’t break on a ‘clean’ RT 3.8 with categories, I - like
ruz - suspect some bad data in your tables. I’d like to see what he
requested.

SELECT ObjectId, Content FROM Attributes WHERE
Name = ‘Category’ AND ObjectType = ‘RT::CustomFieldValue’;

Or potentially a slightly modified form:
SELECT Content, CustomFieldValues.id, CustomFieldValues.Name FROM
Attributes, CustomFieldValues WHERE Attributes.Name = ‘Category’ AND
ObjectType = ‘RT::CustomFieldValue’ AND CustomFieldValues.id =
Attributes.ObjectId;

Tweak that to find the places with multiple values.

Are you sure the original SQL is correct?

The original SQL works fine on a test upgrade.

-kevin

Hi Kevin,

Thanks for coming back on this. I only saw today that you responded.

For the search archive I’m including the DBD::Pg error again:

DBD::Pg::st execute failed: ERROR: more than one row returned by a
subquery used as an expression

I dug this thread up from the archives, as I ran into the same error
while doing a test upgrade.

IIUC, every CustomFieldValue needs to be updated to contain a
category field from the old attributes table.

Since this doesn’t break on a ‘clean’ RT 3.8 with categories, I - like
ruz - suspect some bad data in your tables. I’d like to see what he
requested.

Understandable.

SELECT ObjectId, Content FROM Attributes WHERE
Name = ‘Category’ AND ObjectType = ‘RT::CustomFieldValue’;

Or potentially a slightly modified form:
SELECT Content, CustomFieldValues.id, CustomFieldValues.Name FROM
Attributes, CustomFieldValues WHERE Attributes.Name = ‘Category’ AND
ObjectType = ‘RT::CustomFieldValue’ AND CustomFieldValues.id =
Attributes.ObjectId;

I’ve sent you the file off-list. There’s a few fields that I’d prefer
not being archived.

Tweak that to find the places with multiple values.

I’m not amazed by the output, did we insert disturbing data?

Regards,
Kai

signature.asc (906 Bytes)