This error could be caused by an entry in the data location table that is referencing a now deleted deployment history record.
You can first verify if the reference exists between the data location and deployment history tables by running the following query
select * from <repository_schema>.MTA_DATA_LOC_JOB where R_DEPLOYHIST = 'UUID From ERROR LOG';
select * from <repository_schema>.MTA_DEPLOY_HISTORY where UUID = 'UUID From ERROR LOG';
If the query in the MTA_DATA_LOC_JOB returns a result but the MTA_DEPLOY_HISTORY query returns no results you will need to need to re-insert that row back into MTA_DEPLOY_HISTORY.
First, take a look at the row in MTA_DATA_LOCATION for the particular Data Location in question.
Use this sample SQL:
INSERT INTO MTA_DEPLOY_HISTORY ( UUID, REVISION, CREDATE, CREATOR, UPDDATE, UPDATOR, CLASSNAME, O_DATALOCATION, R_DEPLOYEDME, DEPLOY_DATE, INSTALL_MODE, ON_DEPLOY_ME_STATUS ) values ('dfbe0f8b-3e10-41e5-b174-7c691bf03ed1', <RevisionNumber>, <CreateTimestamp>, 'semadmin', <UpdateTimestamp>, 'semadmin', 'DeploymentHistory', '<DataLocationUUID>', '<R_DeployedMe>', '<DeployTimestamp>, 'AUTOMATIC', 'OPEN') ;
- For column REVISION, the <RevisionNumber> value is obtained from MTA_DATA_LOCATION.REVISION
- For column O_DATALOCATION, the <DataLocationUUID> value is obtained from MTA_DATA_LOCATION.UUID
- For column R_DEPLOYEDME, the <R_DeployedMe> value is obtained from MTA_DATA_LOCATION.R_DEPLOYEDME
In the above sample SQL, I've used 'semadmin' as Updator/Creator - you might have different value(s).
You can use suitable timestamp values for <CreateTimestamp>, <UpDateTimestamp> and <DeployTimestamp>
The ON_DEPLOY_ME_STATUS can either be set to 'OPEN' or 'CLOSED'.