Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

ksc_copy_request always failed with error "Request with ID 0 was not found in the system."

SOLVED
Go to solution
Highlighted
Sascha_1
Member

ksc_copy_request always failed with error "Request with ID 0 was not found in the system."

Hello,

 

we want to copy a request using ksc_copy_request functionality. But for some days on a specific step, this functionality doesn't work. To reproduce the behavior, here are the steps:

 

1. ksc_comment Get Request_type_id of the target request
ksc_itg_run_sql QUERY_STRING="select request_type_id from kcrt_request_types where request_type_name = target_request
ksc_store TEMP_CHILD_RT_ID= [SQL_OUTPUT]

 

2. ksc_comment Get Worklow_id of the target request
ksc_itg_run_sql QUERY_STRING="select workflow_id from kwfl_workflows where workflow_name = 'target request
'"
ksc_store TEMP_CHILD_WF_ID= [SQL_OUTPUT]

 

3. ksc_copy_request

REQUEST_TYPE_ID="[REQD.P.TEMP_CHILD_RT_ID]"

WORKFLOW_ID="[REQD.P.TEMP_CHILD_WF_ID]"

COPY_FIELDS="Y"

COPY_NOTES="N"

CREATE_REFERENCE="Y"

REFERENCE_RELATIONSHIP="Predecessor"

SUBMIT="Y" STATUS_NAME="Set Initial States"

 

Now you will see the error at the execution log:

 

TEMP_CHILD_WF_ID="30645", "30645"

The following Command Step is not subject to timing out: com.kintana.crt.server.KSCCopyRequest

Beginning command: KSC Copy Request
Running PL/SQL procedure KCRT_REQUEST_UTIL.COPY_REQUEST
Summary of parameters:
FROM_REQUEST_ID=93919
REQUEST_TYPE_ID=30291
WORKFLOW_ID=30645
COPY_FIELDS=Y
COPY_NOTES=N
CREATE_REFERENCE=Y
REF_RELATIONSHIP_ID=15
STATUS_NAME=Set Initial States
SUBMIT=Y
PROCESS_RULE=N
Request copied successfully with new ID = 0
Exception occured during execution: com.kintana.core.openapi.OpenAPIException: Request with ID 0 was not found in the system.  Import was not performed.

Furthermore we checked the kcrt_requests_int table and see the entries for the target request (with request_id) already entered by the system. It looks like the procedure KCRT_REQUEST_UTIL.COPY_REQUEST causes the error.

3 REPLIES
Jim Esler
Honored Contributor

Re: ksc_copy_request always failed with error "Request with ID 0 was not found in the system.&q

You do not say what release level you are running. Error reporting is substantially improved in 9.12. In earlier releases, errors that prevent the request from being created are not reported.

 

The most common reason we found for this command to fail was a mismatch of fields between the two request types. The copy command will populate fields in the new request with values in the current request. If the new request type has field definitions that cannot accomodate a value, the request is not created. For instance, if the new request has a field defined with a character length limit of 200 and the current request has a value that is longer than that, the copy command fails.

Utkarsh_Mishra
Honored Contributor

Re: ksc_copy_request always failed with error "Request with ID 0 was not found in the system.&q

Hi Sascha,

 

This issue generally comes when many request instance are concurrently executing this step, and if there is any server load then generally this kind of behaviour is also observed during COMMAND execution.

 

My suggestion would be to directly call the kcrt_requests utilty instead of using the command; any way command is also calling this procedure. Secondly COMMAND execution is also resource expensive as in this IO operations are involved.

 

You can give a try to this... (include this in function)

 

BEGIN


P_FROM_REQUEST_ID := <REQUEST_ID>;
P_REQUEST_TYPE_NAME := '<REQUEST_TYPE>t';
P_WORKFLOW_NAME := '<WORKFLOW_NAME>';
P_USER_ID := V_USER_ID;
P_COPY_FIELDS := 'Y';
P_COPY_NOTES := 'N';
P_CREATE_REFERENCE := 'Y';
P_REF_RELATION := 15;
P_STATUS_NAME := '<REQUEST_STATUS>';
P_SUBMIT_FLAG := 'Y';
O_REQUEST_ID := NULL;

 

KCRT_REQUEST_UTIL.COPY_REQUEST ( P_FROM_REQUEST_ID, P_REQUEST_TYPE_NAME, P_WORKFLOW_NAME, P_USER_ID, P_COPY_FIELDS, P_COPY_NOTES, P_CREATE_REFERENCE, P_REF_RELATION, P_STATUS_NAME, P_SUBMIT_FLAG, O_REQUEST_ID );

 

DBMS_OUTPUT.PUT_LINE(O_REQUEST_ID);

 

COMMIT;

 

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Sascha_1
Member
Solution

Re: ksc_copy_request always failed with error "Request with ID 0 was not found in the system.&a

Hi Utkasrh,

the problem was caused due to differences between the storage value of the specific field. In the source request type, the storage value is set to 4000. But the same field does only have 200 at the target request type. I can reproduce this issue when creating a new Reference (Request New) at the source request. Then the system also copy all data for same token. But if you try to submit the new request, you got the message that you exceed the maximum storage for this field.

Best regards,
Sascha
//Add this to "OnDomLoad" event