System.InvalidOperationException: JSReport render failed. Status: 404. Response: {"type":"about:blank","title":"Not Found","status":404,"detail":"Template 1aeb311a-621e-47dd-8784-0f0e5842a6f3 not found","instance":"/api/v1/render","error_code":"NOT_FOUND"}
   at IncidentReporter.API.Helpers.JsReportUtils.<RenderPdfAsync>d__0.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\Helpers\JsReportUtils.cs:line 70
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IncidentReporter.API.Helpers.PdfExportSwitchHelper.<TryRenderPdfViaJsReportAsync>d__0.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\Helpers\PdfExportSwitchHelper.cs:line 64


System.IO.FileNotFoundException: HTML template missing for General Work category. Expected HTML template path: D:\App-Data\iis\api.incidentreporter365.com\Templates/PDFs\264\WorkPermitV2\GeneralWork\ExportWorkPermitV2.html
File name: 'D:\App-Data\iis\api.incidentreporter365.com\Templates/PDFs\264\WorkPermitV2\GeneralWork\ExportWorkPermitV2.html'
   at IncidentReporter.API.Helpers.WorkPermitV2PDFHelper.ResolveTemplatePath(String baseDir, String templatesRoot, String orgId, String module, String categoryFolder, String fileName) in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\Helpers\WorkPermitV2PDFHelper.cs:line 89
   at IncidentReporter.API.Helpers.WorkPermitV2PDFHelper.<ExportWorkPermitV2PDFAsync>d__1.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\Helpers\WorkPermitV2PDFHelper.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at IncidentReporter.API.BLL.WorkPermitV2Bll.<ExportWorkPermitV2PDFAsync>d__11.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\WorkPermitV2Bll.cs:line 1556


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Reports/Dashboards


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Modules/99/Workflows/Transitions/Available


Request URL : https://api-sandbox.oqsha.com/Transition-History?orgId=262&ModuleId=99&EntityId=20


Request URL : https://api-sandbox.oqsha.com/Organisations/262


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Modules/83/Workflows/States/Types


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Modules/83/Categories/All


Request Body : {"SiteIds":[],"PageNumber":1,"PageLimit":1000,"UserId":267}


Request URL : https://api-sandbox.oqsha.com/Organisation/262/Users/DropDown?ModuleName=Action Trackers


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Action-Trackers/All


Request URL : https://api-sandbox.oqsha.com/Organisations/262/QualityManagementV2/All


Request Body : {"PageNumber":1,"PageLimit":10,"ShowPendingWithMe":false,"FromDate":"2026-06-28","ToDate":"2026-08-04"}


Request URL : https://api-sandbox.oqsha.com/Organisations/264


Request URL : https://api-sandbox.oqsha.com/Organisations/264/Departments?SortingColumn=Name&SortingOrder=Asc&SiteId=845&SiteId=846&SiteId=900


Request URL : https://api-sandbox.oqsha.com/Organisations/264/Modules/85/Workflows/States/Types


Request URL : https://api-sandbox.oqsha.com/Organisations/264/Modules/85/Categories/All


Request Body : {"PageNumber":1,"PageLimit":1000,"UserId":678}


Request URL : https://api-sandbox.oqsha.com/Organisations/264/WorkPermitV2/All


Request URL : https://api-sandbox.oqsha.com/Transition-History?orgId=264&ModuleId=85&EntityId=446


Request URL : https://api-sandbox.oqsha.com/Organisation/264/AccessControl/Roles


Request URL : https://api-sandbox.oqsha.com/Organisations/264/WorkPermitV2/446


Request Body : {"PageNumber":1,"PageLimit":1000,"SiteIds":[900],"IsPublished":true,"UserId":678}


Request URL : https://api-sandbox.oqsha.com/Organisations/264/Modules/85/Workflows/Transitions/Available


Request URL : https://api-sandbox.oqsha.com/Organisation/264/Users/DropDown?ModuleName=Work Permit V2&siteId=900&isActive=true


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Zones


Request URL : https://api-sandbox.oqsha.com/Organisations/264/Departments


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Zones/Sites


Request Body : {"SiteId":[900],"SearchTerm":"","SortingColumn":["Name"],"SortingOrder":["asc"],"PageNumber":1,"PageSize":1000}


Request Body : {"ZoneIds":[10]}


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Modules/113/Categories/All


Request Body : {"PageNumber":1,"PageLimit":200,"UserId":"267"}


Request URL : https://api-sandbox.oqsha.com/Organisation/262/Users/DropDown?ModuleName=Quality Management&siteId=887&siteId=882&siteId=912&siteId=881&siteId=841&siteId=886&siteId=884&siteId=883&siteId=889&siteId=888&siteId=885


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Modules/113/Workflows/States/Types


Request URL : https://api-sandbox.oqsha.com/Organisations/262/Departments


Request URL : https://api-sandbox.oqsha.com/Organisations/264/WorkPermitV2/446/Export