Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Run API CSIT test without updating persistence.xml


 API Docker log

Waiting for mariadb port 3306...
mariadb (172.19.0.2:3306) open
.....Waiting for policy-db-migrator port 6824...
policy-db-migrator (172.19.0.3:6824) open
.......Policy api config file: /opt/app/policy/api/etc/defaultConfig.json
[EL Info]: 2021-08-11 07:41:50.619--ServerSession(878861517)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4
[EL Warning]: 2021-08-11 07:41:51.532--ServerSession(878861517)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=333) Can't create table `policyadmin`.`toscanodetemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaNodeTemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES ToscaCapabilityAssignments (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaNodeTemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES ToscaCapabilityAssignments (name, version)")
[EL Warning]: 2021-08-11 07:41:51.559--ServerSession(878861517)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=333) Can't create table `policyadmin`.`toscanodetype` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaNodeType ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES ToscaRequirements (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaNodeType ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES ToscaRequirements (name, version)")
[EL Warning]: 2021-08-11 07:41:51.606--ServerSession(878861517)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=333) Can't create table `policyadmin`.`toscaservicetemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaServiceTemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES ToscaDataTypes (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaServiceTemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES ToscaDataTypes (name, version)")
[EL Warning]: 2021-08-11 07:41:51.638--ServerSession(878861517)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=333) Can't create table `policyadmin`.`toscatopologytemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaTopologyTemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES ToscaPolicies (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaTopologyTemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES ToscaPolicies (name, version)")
[EL Info]: 2021-08-11 07:42:02.006--ServerSession(559000277)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4
[EL Warning]: 2021-08-11 07:42:02.353--ServerSession(559000277)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=334) Can't create table `policyadmin`.`toscanodetemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaNodeTemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES ToscaCapabilityAssignments (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaNodeTemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES ToscaCapabilityAssignments (name, version)")
[EL Warning]: 2021-08-11 07:42:02.373--ServerSession(559000277)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=334) Can't create table `policyadmin`.`toscanodetype` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaNodeType ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES ToscaRequirements (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaNodeType ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES ToscaRequirements (name, version)")
[EL Warning]: 2021-08-11 07:42:02.415--ServerSession(559000277)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=334) Can't create table `policyadmin`.`toscaservicetemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaServiceTemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES ToscaDataTypes (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaServiceTemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES ToscaDataTypes (name, version)")
[EL Warning]: 2021-08-11 07:42:02.447--ServerSession(559000277)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=334) Can't create table `policyadmin`.`toscatopologytemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaTopologyTemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES ToscaPolicies (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaTopologyTemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES ToscaPolicies (name, version)")
[EL Info]: 2021-08-11 07:42:06.689--ServerSession(1456799384)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4

A number of errors are thrown because db-migrator has already created these objects


Run API CSIT test with updated persistence.xml

In the api directory go to main/src/main/resources/META-INF/persistence.xml

Update the properties section

persistence.xml
<properties>
<property
name="javax.persistence.schema-generation.database.action"
value="create" />
<!--property
name="eclipselink.ddl-generation"
value="create-or-extend-tables" /-->
<property
name="eclipselink.ddl-generation"
value="none" />
<property
name="eclipselink.ddl-generation.output-mode"
value="database" />
<property
name="eclipselink.logging.level"
value="INFO" />
</properties>


mvn clean install to build the projject

cd to packages/policy-api-docker/ and run mvn clean install again to build the docker image

cd to the docker/csit directory and edit docker-compose-all.yml

docker-compose-all.yml
   api:
      #image: nexus3.onap.org:10001/onap/policy-api:${POLICY_API_VERSION}
      image: onap/policy-api:${POLICY_API_VERSION}

Re-run CSIT test for API

 API docker log

Waiting for mariadb port 3306...
mariadb (172.21.0.2:3306) open
.....Waiting for policy-db-migrator port 6824...
policy-db-migrator (172.21.0.3:6824) open
........Policy api config file: /opt/app/policy/api/etc/defaultConfig.json
[EL Info]: 2021-08-11 08:54:22.739--ServerSession(1961129028)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4
[EL Info]: 2021-08-11 08:54:33.045--ServerSession(1054452800)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4
[EL Info]: 2021-08-11 08:54:38.963--ServerSession(865436777)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4
[EL Info]: 2021-08-11 08:54:39.563--ServerSession(1114449639)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4
[EL Info]: 2021-08-11 08:54:40.433--ServerSession(2113871782)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4

SQL errors no longer present

------------------------------------------------------------------------------
api | PASS |
16 tests, 16 passed, 0 failed
==============================================================================



Run PAP CSIT test without updating persistence.xml

 PAP docker log

mariadb (172.22.0.3:3306) open
.......Waiting for policy-db-migrator port 6824...
policy-db-migrator (172.22.0.4:6824) open
...........Waiting for message-router port 3905...
message-router (172.22.0.2:3905) open
Waiting for api port 6969...
api (172.22.0.5:6969) open
............Policy pap config file: /opt/app/policy/pap/etc/defaultConfig.json
[EL Info]: 2021-08-11 09:11:51.066--ServerSession(73698537)--EclipseLink, version: Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4
[EL Warning]: 2021-08-11 09:11:51.9--ServerSession(73698537)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=335) Can't create table `policyadmin`.`toscanodetemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaNodeTemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES ToscaCapabilityAssignments (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaNodeTemplate ADD CONSTRAINT FK_ToscaNodeTemplate_capabilitiesName FOREIGN KEY (capabilitiesName, capabilitiesVersion) REFERENCES ToscaCapabilityAssignments (name, version)")
[EL Warning]: 2021-08-11 09:11:51.932--ServerSession(73698537)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=335) Can't create table `policyadmin`.`toscanodetype` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaNodeType ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES ToscaRequirements (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaNodeType ADD CONSTRAINT FK_ToscaNodeType_requirementsName FOREIGN KEY (requirementsName, requirementsVersion) REFERENCES ToscaRequirements (name, version)")
[EL Warning]: 2021-08-11 09:11:51.995--ServerSession(73698537)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=335) Can't create table `policyadmin`.`toscaservicetemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaServiceTemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES ToscaDataTypes (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaServiceTemplate ADD CONSTRAINT FK_ToscaServiceTemplate_dataTypesName FOREIGN KEY (dataTypesName, dataTypesVersion) REFERENCES ToscaDataTypes (name, version)")
[EL Warning]: 2021-08-11 09:11:52.042--ServerSession(73698537)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.8.v20201217-ecdf3c32c4): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLTransientConnectionException: (conn=335) Can't create table `policyadmin`.`toscatopologytemplate` (errno: 121 "Duplicate key on write or update")
Error Code: 1005
Call: ALTER TABLE ToscaTopologyTemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES ToscaPolicies (name, version)
Query: DataModifyQuery(sql="ALTER TABLE ToscaTopologyTemplate ADD CONSTRAINT FK_ToscaTopologyTemplate_policyName FOREIGN KEY (policyName, policyVersion) REFERENCES ToscaPolicies (name, version)")

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
        <properties>
            <property name="javax.persistence.schema-generation.database.action" value="create" />
            <!--property name="eclipselink.ddl-generation" value="create-or-extend-tables" /-->
            <property name="eclipselink.ddl-generation" value="none" />
            <property name="eclipselink.ddl-generation.output-mode" value="database" />
            <property name="eclipselink.logging.level" value="INFO" />
        </properties>


run mvn clean install

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
 


  • No labels