Hi All,
i recently updated my vrealize automation test environment from 7.1 version to 7.3 without problems
When updating my production environment i obtain the following error
"Update failed (code 0-2)"
In updatecli.log i see this detali message:
"Script /etc/bootstrap/postupdate.d/20-vcac failed, error status 2"
Investigating more the problem seems to be in "forms_valuedefinition" table when executing this query:
update forms_valuedefinition set scope_level= 'system', scope_levelfilter ='system' where key like 'PropertyDefinition-null-%'
that fails (correctly) with a key constraint error (see table example below)
key | scope_level | scope_levelfilter
------------------------------------------------------+-------------+-------------------
PropertyDefinition-null-VirtualMachine.Network0.Name | tenant | tenant1
PropertyDefinition-null-backup | tenant | tenant1
PropertyDefinition-null-backup | tenant | tenant2
PropertyDefinition-null-VirtualMachine.Network0.Name | tenant | tenant2
In test environment i have just one tenant, in production I have more then 10 tenant
Any idea?
Thank you very much
Hi All,
we deleted all rows from forms_valuedefinition table except one row for any key like that
key | scope_level | scope_levelfilter
------------------------------------------------------+-------------+-------------------
PropertyDefinition-null-VirtualMachine.Network0.Name | tenant | tenant1
PropertyDefinition-null-backup | tenant | tenant2
The upgrade procedure work fine.
The problem was in production environment which is a multi tenant environment
Hope is usefull
Thanks
I'd recommend opening a SR on this one as troubleshooting failed upgrades can be a tricky and complicated business.
According to the 7.3 table definition, this should not lead to errors:
CREATE TABLE "forms_valuedefinition" ("dtype" CHARACTER VARYING(31) NOT NULL, "id" UUID NOT NULL, "key" CHARACTER VARYING(1023) NOT NULL, "description"
CHARACTER VARYING(2000), "datatype" TEXT, "name" CHARACTER VARYING(255) NOT NULL, "scriptactionfqn" CHARACTER VARYING(255), "multi" BOOLEAN,
"deleted" BOOLEAN, "scope_level" CHARACTER VARYING(255), "scope_levelfilter" CHARACTER VARYING(255),
PRIMARY KEY ("id"), UNIQUE ("key", "scope_level", "scope_levelfilter"));
Maybe the UNIQUE constraint was missing in 7.1 and not applied successfully before inserting tenanted data?
You can try to manually update the table constraints.
Another reason could be that "system" is not a valid scope_levelfiter/scope.
Do you have a tenant called "system"?
Wait....
update forms_valuedefinition set scope_level= 'system', scope_levelfilter ='system' where key like 'PropertyDefinition-null-%'
OK, this will never work with tenanted data. I think there is a problem with your data:
A tenanted property definition looks like this in my database:
PropertyDefinition-orc2-VirtualMachine.Network0.Name
where orc2 is the name of a tenant.
So if your scope_levelfilter is "tenant1"
your property should be
PropertyDefinition-tenant1-VirtualMachine.Network0.Name
instead of
PropertyDefinition-null-VirtualMachine.Network0.Name
I assume "null" is the definition for system wide properties.
Hi All,
we deleted all rows from forms_valuedefinition table except one row for any key like that
key | scope_level | scope_levelfilter
------------------------------------------------------+-------------+-------------------
PropertyDefinition-null-VirtualMachine.Network0.Name | tenant | tenant1
PropertyDefinition-null-backup | tenant | tenant2
The upgrade procedure work fine.
The problem was in production environment which is a multi tenant environment
Hope is usefull
Thanks