Issue
Running g! upgrade:check it turns out that a component was not migrated successfully, the output is for example:
There is an upgrade process available for ServiceBuilder.service from 0.0.0 to 1.0.0
Upon executing the upgrade, a similar error appears:
com.liferay.portal.kernel.upgrade.UpgradeException: Bundle ServiceBuilder.service_1.0.0 [93] has invalid content in indexes.sql:
create index IX_F27B1EFC on marketnotice (isEnglish);
create index IX_441C90FD on marketnotice (marketNoticeId);
create index IX_6415039A on marketnotice (uuid_[$COLUMN_LENGTH:75$]);
at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextExtender$ModuleApplicationContextExtension$1.upgrade(ModuleApplicationContextExtender.java:350)
at com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfosRunnable.run(ReleaseManagerOSGiCommands.java:539)
... 32 more
Caused by: java.sql.SQLException: ORA-01408: such column list already indexed
Environment
- Portal 6.2
- DXP 7.0
- DXP 7.1
- DXP 7.2
Resolution
The origin of the problem is the presence of a finder element - in this case - marketNoticeId in service.xml, thus the duplication of the index, which Oracle does not allow (it is supported in MySQL and PostgreSQL).
In the DB we can see that the primary key of the marketnotice table is marketNoticeId. Being the primary key of the marketnotice table, marketNoticeId field already has an index and methods to retrieve elements with that field. Therefore this finder is not necessary in this case.
The resolution would be eliminating the said finder and redeploy the custom module. Or optionally the value of the db-index attribute on the finder element can be set to false.