Invalid ConnectorId for "Internal" connector at worker initialization
Description
When the worker first starts, it looks for the connector "internal" by name. If an exception occurs, it attempts to create a new connector called "Internal.”
The issue arises when the connector already exists but another exception is thrown. The worker attempts to create a new one with a random ID but is unable to save it because another connector with the same name already exists.
The exception thrown by the creation is then ignored, and the new, unsaved connector is stored in the SystemLogHandler variable.
Any subsequent use of that worker instance will result in a Connector Not Found exception.
#Slack thread:
https://totvscarol.slack.com/archives/CFZ1562UB/p1702563943460059
Initialization Error:
https://cloudlogging.app.goo.gl/CS48uvSNVdY8GvtDA
Subsequent errors occurring in the same worker:
https://cloudlogging.app.goo.gl/kRd8u4G3oCu4RyBi8
Code to fix at SystemLogHandler.java:
ApplicationService connectorService = MdmSingletonManager.getInstance(ApplicationService.class);
try {
this.connector = connectorService.getConnectorByName(this.adminUad, CONNECTOR_NAME);
} catch (Exception e) {
this.connector = new Connector();
this.connector.setMdmName(CONNECTOR_NAME);
try {
this.connector = connectorService.createConnector(adminUad, this.connector);
} catch (Exception e2) {
// ignore creation error
logger.warn(MARKER, "Error setting up connector", e2);
}
}
This issue was automatically transitioned to REGRESSION, as its PR was just merged into qa branch in Github.
This issue was automatically transitioned to REGRESSION, as its PR was just merged into qa branch in Github.
This issue was automatically transitioned to TESTED & MERGED, as its PR was just merged into develop branch in Github. PR Approved by olivandre,jwmoraes.
Github user jwmoraes has just approved a PR (added as Shard Assignee in this Jira issue).
fix: https://totvslabs.atlassian.net/browse/CAPL-5245#icft=CAPL-5245 Create Internal Connector at dataloader and prevent invalid id to be …
Card validated by the QA team.
This issue was automatically transitioned to QA REVIEW, as its PR was just approved in Github.
This issue was automatically transitioned to REVIEW, as its PR (not DRAFT and not WIP) was just created in Github.
fix: https://totvslabs.atlassian.net/browse/CAPL-5245#icft=CAPL-5245 Create Internal Connector at dataloader and prevent invalid id to be …
@Reinaldo Oliveira Machado Junior ,
@Geny Isam Hamud Herrera , @Douglas Coimbra Lopes
This issue was planned to be delivered until 2024-01-22. You can check that by consulting the issue in the Due Date field.
Dates already planned for this issue: 2024-01-22
If External Issue Link field is filled, customer was also informed on JIRA TOTVS.