Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Run API CSIT test without updating persistence.xml

API docker log


Expand
titleAPI 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

...

SQL errors no longer present

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



Run PAP CSIT test without updating persistence.xml

Expand
titlePAP 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

Code Block
languagexml
titlepersistence.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

Code Block
languageyml
titledocker-compose-all.yml