[LS-957] getAllPendingTasks is failed on OLD FN .80 Created: 24/Feb/26  Updated: 10/Mar/26  Due: 23/Feb/26

Status: Ready for QA
Project: L3 Support
Component/s: FN
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Urgent
Reporter: Mbaye Lo Assignee: Mbaye Lo
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 1 day
Original Estimate: Not Specified

Customer:
OMAN-Tel
Planned Start:
Planned End:
Actual Start:
Date of Baselining:

 Description   

getAllPendingTasks is failed on OLD FN .80

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://server.api.nep.mobinets.com/">
<soapenv:Header/>
<soapenv:Body>
<ser:getAllPendingTasks/>
</soapenv:Body>
</soapenv:Envelope>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Error while loading Tasks No enum constant com.mobinets.nep.fn.model.nep.persist.enums.FnWoTaskStatus.Completed; nested exception is java.lang.IllegalArgumentException: No enum constant com.mobinets.nep.fn.model.nep.persist.enums.FnWoTaskStatus.Completed</faultstring>
<detail>
<ns1:NepFault xmlns:ns1="http://server.api.nep.mobinets.com/">
<errorCode xsi:type="xs:int" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://server.api.nep.mobinets.com/">1</errorCode>
</ns1:NepFault>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>



 Comments   
Comment by Ayed Bada [ 26/Feb/26 ]

During the investigation of the NullPointerException occurring in the getAllPendingTasks API, we identified that the issue was caused by inconsistent data in the database.

Root Cause :

Some records in FN_WO_TASK were linked to work orders whose subscriber_id referenced subscribers that do not exist in the FN_SUBSCRIBER table.

This situation likely occurred due to a manual deletion of subscriber records directly from the database without cleaning or updating the related records in FN_WORK_ORDER and FN_WO_TASK, resulting in orphaned references.

Resolution Applied

We identified and removed the affected tasks whose work orders referenced non-existent subscribers.

Verification Query :
SELECT t.id AS task_id, t.task_name, w.id AS wo_id, w.subscriber_id
FROM FN_WO_TASK t
JOIN FN_WORK_ORDER w ON t.wo_id = w.id
LEFT JOIN SUBSCRIBER s ON w.subscriber_id = s.id
WHERE w.subscriber_id IS NOT NULL
AND s.id IS NULL;

Cleanup Query Executed

DELETE FROM FN_WO_TASK
WHERE wo_id IN (
SELECT w.id
FROM FN_WORK_ORDER w
LEFT JOIN SUBSCRIBER s ON w.subscriber_id = s.id
WHERE w.subscriber_id IS NOT NULL
AND s.id IS NULL
);

Optionally, orphaned work orders can also be removed:

DELETE FROM FN_WORK_ORDER
WHERE subscriber_id IS NOT NULL
AND subscriber_id NOT IN (SELECT id FROM SUBSCRIBER);

Generated at Fri Apr 17 08:22:16 EEST 2026 using JIRA 6.1.4#6159-sha1:44eaedef2e4a625c6c7183698b2468d4719c20dc.