function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pardeep GodaraPardeep Godara 

Error while using Metadata API

I am getting this error "insufficient access rights on cross-reference id" when I am using checkDeployStatus() for a Deployment Id which I got form Monitor Deployment Section of Setup. This is related to Metadata API.

 

Same piece of code is working when I am running the complete deployment cycle, that is sending file, polling status and the checking deploystatus but when I am trying to get individual deployment status by using the Deployment Id for an already done deployment, I am getting this error

 

vbsvbs
Can you post the code for executing this API call?
Pardeep GodaraPardeep Godara

Method goes like this:

 

public boolean checkDeploy(String deployId) throws MyException {

DeployResult result;
try {
result = metadataConnection.checkDeployStatus(deployId);
} catch (ConnectionException e) {
e.printStackTrace();
throw new MyException(104);
}
if (!result.isSuccess()) {
writeErrorLog(result,file);
return false;
}else {
writeErrorLog(result,file);
return true;
}
}

 

I am exectuting above code under two condition:

1. Just after I deployed a zip and polling the status to completed.

2. When I fired a huge deployment which will take a while so I will check the deployment status later. I have the deployment Id.

 

This is fine under first condition but giving said error on second.

 

error: insufficient access rights on cross-reference id: <unknown>

 

pls advice.

vbsvbs
As per the documentation, it seems the check has to be done in a loop in the same transaction. Can you try adding a loop for checking the result in the second case?