A number of errors are thrown because db-migrator has already created these objects
Run PAP CSIT test with updated persistence.xml
In the pap directory go to main/src/main/resources/META-INF/persistence.xml
persistence.xml
run mvn clean install
Use docker images to see image stored in the local cache.
Use docker rmi <image id> to remove pap images
cd packages/policy-pap-docker and run mvn clean install again to build the docker image
update docker-compose-all.yml
docker-compose-all.yml
Re-run CSIT test for pap
Waiting for mariadb port 3306... mariadb (172.23.0.3:3306) open .......Waiting for policy-db-migrator port 6824... policy-db-migrator (172.23.0.4:6824) open ...........Waiting for message-router port 3905... message-router (172.23.0.2:3905) open Waiting for api port 6969... api (172.23.0.5:6969) open .........Policy pap config file: /opt/app/policy/pap/etc/defaultConfig.json [EL Info]: 2021-08-11 09:30:21.762--ServerSession(1758893871)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4 [EL Warning]: 2021-08-11 09:30:22.738--ServerSession(1758893871)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLSyntaxErrorException: (conn=335) Unknown column 't1.LASTUPDATE' in 'field list' Error Code: 1054 Call: SELECT t1.HEALTHY, t1.LASTUPDATE, t1.MESSAGE, t1.PDPSTATE, t1.parentLocalName, t1.localName, t1.parentKeyVersion, t1.parentKeyName FROM PdpSubGroup_Pdp t0, Pdp t1 WHERE ((t0.pdpLocalName = ?) AND ((t0.pdpParentLocalName = ?) AND ((t0.pdpParentKeyVersion = ?) AND ((t0.pdpParentKeyName = ?) AND ((t1.parentKeyName = t0.parentKeyName) AND ((t1.parentKeyVersion = t0.parentKeyVersion) AND ((t1.localName = t0.localName) AND (t1.parentLocalName = t0.parentLocalName)))))))) bind => [4 parameters bound] Query: ReadAllQuery(name="pdpInstances" referenceClass=JpaPdp sql="SELECT t1.HEALTHY, t1.LASTUPDATE, t1.MESSAGE, t1.PDPSTATE, t1.parentLocalName, t1.localName, t1.parentKeyVersion, t1.parentKeyName FROM PdpSubGroup_Pdp t0, Pdp t1 WHERE ((t0.pdpLocalName = ?) AND ((t0.pdpParentLocalName = ?) AND ((t0.pdpParentKeyVersion = ?) AND ((t0.pdpParentKeyName = ?) AND ((t1.parentKeyName = t0.parentKeyName) AND ((t1.parentKeyVersion = t0.parentKeyVersion) AND ((t1.localName = t0.localName) AND (t1.parentLocalName = t0.parentLocalName))))))))") Exception in thread "main" org.onap.policy.pap.main.PolicyPapRuntimeException: Start of policy-pap service failed. at org.onap.policy.pap.main.startstop.Main.<init>(Main.java:93) at org.onap.policy.pap.main.startstop.Main.main(Main.java:159) Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLSyntaxErrorException: (conn=335) Unknown column 't1.LASTUPDATE' in 'field list' Error Code: 1054 Call: SELECT t1.HEALTHY, t1.LASTUPDATE, t1.MESSAGE, t1.PDPSTATE, t1.parentLocalName, t1.localName, t1.parentKeyVersion, t1.parentKeyName FROM PdpSubGroup_Pdp t0, Pdp t1 WHERE ((t0.pdpLocalName = ?) AND ((t0.pdpParentLocalName = ?) AND ((t0.pdpParentKeyVersion = ?) AND ((t0.pdpParentKeyName = ?) AND ((t1.parentKeyName = t0.parentKeyName) AND ((t1.parentKeyVersion = t0.parentKeyVersion) AND ((t1.localName = t0.localName) AND (t1.parentLocalName = t0.parentLocalName)))))))) bind => [4 parameters bound] Query: ReadAllQuery(name="pdpInstances" referenceClass=JpaPdp sql="SELECT t1.HEALTHY, t1.LASTUPDATE, t1.MESSAGE, t1.PDPSTATE, t1.parentLocalName, t1.localName, t1.parentKeyVersion, t1.parentKeyName FROM PdpSubGroup_Pdp t0, Pdp t1 WHERE ((t0.pdpLocalName = ?) AND ((t0.pdpParentLocalName = ?) AND ((t0.pdpParentKeyVersion = ?) AND ((t0.pdpParentKeyName = ?) AND ((t1.parentKeyName = t0.parentKeyName) AND ((t1.parentKeyVersion = t0.parentKeyVersion) AND ((t1.localName = t0.localName) AND (t1.parentLocalName = t0.parentLocalName))))))))") at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:342) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:691) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:567) at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2099) at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:603) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:277) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:263) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:334) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:746) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2768) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2721) at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:584) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1232) at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:911) at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1191) at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:485) at org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:3356) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1898) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1880) at org.eclipse.persistence.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolicy.java:328) at org.eclipse.persistence.mappings.ForeignReferenceMapping.valueFromRowInternal(ForeignReferenceMapping.java:2344) at org.eclipse.persistence.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java:2185) at org.eclipse.persistence.mappings.ForeignReferenceMapping.readFromRowIntoObject(ForeignReferenceMapping.java:1511) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:472) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.refreshObjectIfRequired(ObjectBuilder.java:4321) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:1050) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:747) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:1351) at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:605) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1232) at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:911) at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1191) at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:485) at org.eclipse.persistence.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:3356) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1898) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1880) at org.eclipse.persistence.internal.indirection.NoIndirectionPolicy.valueFromQuery(NoIndirectionPolicy.java:328) at org.eclipse.persistence.mappings.ForeignReferenceMapping.valueFromRowInternal(ForeignReferenceMapping.java:2344) at org.eclipse.persistence.mappings.ForeignReferenceMapping.valueFromRow(ForeignReferenceMapping.java:2185) at org.eclipse.persistence.mappings.ForeignReferenceMapping.readFromRowIntoObject(ForeignReferenceMapping.java:1511) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:472) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.refreshObjectIfRequired(ObjectBuilder.java:4321) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:1050) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:909) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:862) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:745) at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:699) at org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:861) at org.eclipse.persistence.queries.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:901) at org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:568) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1232) at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:911) at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1191) at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:447) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1279) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2983) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1898) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1880) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1830) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery(EntityManagerImpl.java:1012) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(EntityManagerImpl.java:1156) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(EntityManagerImpl.java:1042) at org.onap.policy.models.dao.impl.DefaultPfDao.genericGet(DefaultPfDao.java:443) at org.onap.policy.models.dao.impl.DefaultPfDao.get(DefaultPfDao.java:412) at org.onap.policy.models.pdp.persistence.provider.PdpProvider.createPdpGroups(PdpProvider.java:114) at org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl.createPdpGroups(DatabasePolicyModelsProviderImpl.java:225) at org.onap.policy.pap.main.startstop.PapDatabaseInitializer.initializePapDatabase(PapDatabaseInitializer.java:79) at org.onap.policy.pap.main.startstop.Main.<init>(Main.java:72) ... 1 more Caused by: java.sql.SQLSyntaxErrorException: (conn=335) Unknown column 't1.LASTUPDATE' in 'field list' at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:62) at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:153) at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:274) at org.mariadb.jdbc.ClientSidePreparedStatement.executeInternal(ClientSidePreparedStatement.java:229) at org.mariadb.jdbc.ClientSidePreparedStatement.execute(ClientSidePreparedStatement.java:149) at org.mariadb.jdbc.ClientSidePreparedStatement.executeQuery(ClientSidePreparedStatement.java:163) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1015) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:651) ... 67 more Caused by: org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Unknown column 't1.LASTUPDATE' in 'field list' at org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException.of(MariaDbSqlException.java:34) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:194) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:177) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:321) at org.mariadb.jdbc.ClientSidePreparedStatement.executeInternal(ClientSidePreparedStatement.java:220) ... 71 more Caused by: java.sql.SQLException: Unknown column 't1.LASTUPDATE' in 'field list' at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1683) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1545) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1508) at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:318) ... 72 more
QueryPolicyAuditAfterDeploy :: Verify policy audit record after de... /tmp/v/robot/lib/python3.8/site-packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings warnings.warn(( QueryPolicyAuditAfterDeploy :: Verify policy audit record after de... | FAIL | Resolving variable '${resp.json()[0]['pdpGroup']}' failed: IndexError: list index out of range ------------------------------------------------------------------------------ UndeployPolicy :: Undeploy a policy named 'onap.restart.tca' from ... /tmp/v/robot/lib/python3.8/site-packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings warnings.warn(( UndeployPolicy :: Undeploy a policy named 'onap.restart.tca' from ... | PASS | ------------------------------------------------------------------------------ QueryPdpGroupsAfterUndeploy :: Verify PdpGroups after undeploy /tmp/v/robot/lib/python3.8/site-packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings warnings.warn(( QueryPdpGroupsAfterUndeploy :: Verify PdpGroups after undeploy | PASS | ------------------------------------------------------------------------------ QueryPolicyAuditAfterUnDeploy :: Verify policy audit record after ... /tmp/v/robot/lib/python3.8/site-packages/urllib3/connectionpool.py:852: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings warnings.warn(( QueryPolicyAuditAfterUnDeploy :: Verify policy audit record after ... | FAIL | Resolving variable '${resp.json()[0]['pdpGroup']}' failed: IndexError: list index out of range
Updated docker/policy-db-migrator
vi config/policyadmin/sql/0900/upgrade/0110-sequence.sql