System.InvalidOperationException: JSReport render failed. Status: 404. Response: {"type":"about:blank","title":"Not Found","status":404,"detail":"Template 59e964ec-6c0c-4115-a418-68f636dd0af8 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.<RenderViaJsReportAsync>d__2.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\Helpers\PdfExportSwitchHelper.cs:line 119


System.IO.FileNotFoundException: HTML template missing for Electrical Work category. Expected HTML template path: D:\App-Data\iis\api.incidentreporter365.com\Templates/PDFs\264\WorkPermitV2\ElectricalWork\ExportWorkPermitV2.html
File name: 'D:\App-Data\iis\api.incidentreporter365.com\Templates/PDFs\264\WorkPermitV2\ElectricalWork\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 1558


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


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


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


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


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Pssr/Statuses


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


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Users/DropDown?ModuleName=PSSR


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


Request Body : {}


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Pssr/All


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


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Pssr/165


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Users/DropDown?ModuleName=MOC&siteId=708


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Pssr/165/PssrHistory


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Departments?SortingColumn=Name&SortingOrder=Asc&SiteId=708


Request Body : {"SiteIds":[708],"DepartmentIds":[121]}


Request URL : https://api-sandbox.oqsha.com/Organisations/248/ManagementOfChange/Statuses


Request URL : https://api-sandbox.oqsha.com/Organisations/248/ManagementOfChange/411/MocHistory


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Tasks/List


Request URL : https://api-sandbox.oqsha.com/Organisations/248/ManagementOfChange/Categories


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Departments?siteId=708


Request Body : {"PageNumber":0,"PageSize":0,"SiteId":[708],"UserId":267}


Request URL : https://api-sandbox.oqsha.com/Organisations/248/TaskCategories/Dropdown


Request Body : {"SiteId":[],"UserId":267}


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Users/DropDown?ModuleName=Tasks&siteId=708&siteId=744&siteId=707&siteId=705&siteId=709&siteId=706


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


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


Request URL : https://api-sandbox.oqsha.com/Resources/eng?orgId=270


Request URL : https://api-sandbox.oqsha.com/Resources/eng


Request URL : https://api-sandbox.oqsha.com/AccessControl/Modules/270


Request URL : https://api-sandbox.oqsha.com/Resources/eng?orgId=248


Request URL : https://api-sandbox.oqsha.com/Resources/package-features-eng


Request URL : https://api-sandbox.oqsha.com/Health


Request URL : https://api-sandbox.oqsha.com/Organisation/270/Modules


Request URL : https://api-sandbox.oqsha.com/AccessControl/Modules/248


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Users/NaN


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Users/0


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Safety-Alerts/1917


System.Exception: User details not found for the given user and organisation.


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


Request URL : https://api-sandbox.oqsha.com/Languages


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


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Modules/77/Categories/All


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


Request URL : https://api-sandbox.oqsha.com/Organisation/270/UserPreference


Request Body : {"SiteIds":[],"PageNumber":1,"PageLimit":1000,"UserId":null,"AcmModuleId":77}


Request URL : https://api-sandbox.oqsha.com/Dashboard/Organisations/270/SideMenu


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Safety-Alerts/All


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


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Company/All?&IsActive=1


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Tasks/17675/ReopenComments


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Tasks/17675/Comments


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Tasks/17675


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Users/267


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentManagement/Statuses


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentManagement/Categories


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Users/DropDown?ModuleName=Incident Management&siteId=708&siteId=744&siteId=707&siteId=705&siteId=709&siteId=706&AcmModuleId=46


Request Body : {"SiteId":[708,744,707,705,709,706],"UserId":267}


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Modules


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


Request URL : https://api-sandbox.oqsha.com/Languages


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/TaskCategories/Dropdown


Request Body : {"SiteId":[708],"Source":"User","UserId":267}


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Category/97


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Users/DropDown?ModuleName=Tasks&SiteId=708&AcmModuleId=27&categoryIds=97


Request URL : https://api-sandbox.oqsha.com/Dashboard/Organisations/248/SideMenu


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Departments?siteId=708&siteId=744&siteId=707&siteId=705&siteId=709&siteId=706


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentManagement/Firs


Request URL : https://api-sandbox.oqsha.com/Resources/eng?orgId=260


Request URL : https://api-sandbox.oqsha.com/AccessControl/Modules/260


Request URL : https://api-sandbox.oqsha.com/Health


Request URL : https://api-sandbox.oqsha.com/Resources/package-features-eng


Request URL : https://api-sandbox.oqsha.com/Organisations/260/Users/678


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


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


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


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


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


Request URL : https://api-sandbox.oqsha.com/Organisation/260/Modules


Request URL : https://api-sandbox.oqsha.com/Languages


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


Request URL : https://api-sandbox.oqsha.com/Dashboard/Organisations/260/SideMenu


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


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


Request URL : https://api-sandbox.oqsha.com/Organisations/264/IncidentLocations?isActive=1


Request URL : https://api-sandbox.oqsha.com/Organisations/264/Users/678/incidentsites?isActive=1


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


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


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


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


Request URL : https://api-sandbox.oqsha.com/Resources/eng?orgId=264


Request URL : https://api-sandbox.oqsha.com/Resources/package-features-eng


Request URL : https://api-sandbox.oqsha.com/Health


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


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,"AcmModuleId":85}


Request URL : https://api-sandbox.oqsha.com/Languages


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


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


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


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


Request URL : https://api-sandbox.oqsha.com/Resources/app-language-eng?orgId=211


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


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


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


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


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


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


Request URL : https://api-sandbox.oqsha.com/Modules/APIs


Request URL : https://api-sandbox.oqsha.com/Modules/Version/All?Appversion=6.6.0


Request URL : https://api-sandbox.oqsha.com/UserPushNotifications?filter.pageNumber=1&filter.pageLimit=1&filter.isRead=false


Request URL : https://api-sandbox.oqsha.com/AccessControl/Modules/211


Request URL : https://api-sandbox.oqsha.com/Dashboard/Organisations/211/SideMenu


Request URL : https://api-sandbox.oqsha.com/Health


Request URL : https://api-sandbox.oqsha.com/AppVersions?DeviceType=ios&IsLatestVersion=true&IsOqsha=true


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


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


Request URL : https://api-sandbox.oqsha.com/Users/1955/Organisations?onlyFieldStaff=true


Request URL : https://api-sandbox.oqsha.com/Resources/eng?orgId=270


Request URL : https://api-sandbox.oqsha.com/Resources/eng


Request URL : https://api-sandbox.oqsha.com/AccessControl/Modules/270


Request URL : https://api-sandbox.oqsha.com/Resources/package-features-eng


Request URL : https://api-sandbox.oqsha.com/Organisation/270/Modules


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Users/NaN


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Users/0


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Modules/77/Categories/All


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


Request Body : {"SiteIds":[],"PageNumber":1,"PageLimit":1000,"UserId":null,"AcmModuleId":77}


User details not found for the given user and organisation.


Request URL : https://api-sandbox.oqsha.com/Languages


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


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


Request URL : https://api-sandbox.oqsha.com/Organisations/270/Safety-Alerts/All


Request URL : https://api-sandbox.oqsha.com/Organisation/270/UserPreference


Request URL : https://api-sandbox.oqsha.com/Dashboard/Organisations/270/SideMenu


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


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


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


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


Request URL : https://api-sandbox.oqsha.com/Organisation/264/Users/DropDown


Request URL : https://api-sandbox.oqsha.com/Trigger-Configs/Dropdowns


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/WorkPermitV2/All


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


Request Body : {"Dimensions":{"CategoryTypeId":["100241"]}}


Request Body : {"Dimensions":{"CategoryTypeId":["177"]}}


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


Request Body : {"SiteId":845}


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


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


Request URL : https://api-sandbox.oqsha.com/Incidents


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Company/All?&IsActive=1


Request Body : {"OrgId":[248],"PageNumber":1,"PageLimit":1,"StartDate":"2026-09-04","EndDate":"2026-09-04","SearchTerm":"","SortingColumn":["CreatedOn"],"SortingOrder":["desc"]}


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Divisions?userId=267&userTypeId=1


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Divisions/List


Request Body : {"OrgId":[248],"SiteId":[],"UserId":267,"SearchTerm":""}


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Departments?SortingColumn=Name&SortingOrder=Asc&SiteId=708&SiteId=744&SiteId=707&SiteId=705&SiteId=709&SiteId=706


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Users/DropDown?ModuleName=Tickets&SiteId=708&SiteId=744&SiteId=707&SiteId=705&SiteId=709&SiteId=706&AcmModuleId=12


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


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


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Incidents/79568


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Incidents/79568/IncidentHistory?PageNumber=1&PageLimit=10&SimilarIncidentHistory=true


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentLocations/Dropdown?AcmModuleId=12


Request URL : https://api-sandbox.oqsha.com/Organisation/248/UserDetails


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Users/DropDown?ModuleName=Tickets&SiteId=705&AcmModuleId=12


Request Body : {"OrgId":[248],"SiteId":[705],"UserId":267,"SearchTerm":""}


Request URL : https://api-sandbox.oqsha.com/Organisations/248/tasks?OrgId=248&SortingColumn=TaskTitle&SortingOrder=asc&siteId=705


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Departments?SortingColumn=Name&SortingOrder=Asc&SiteId=705


Request URL : https://api-sandbox.oqsha.com/Assets?OrgId=248&LocationId=705&SortingColumn=UniqueAssetId&SortingOrder=asc&IsActive=true


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Incident/79568/AssociatedTasks


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


Request Body : {"Dimensions":{"CategoryTypeId":["173"]}}


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


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


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


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


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


Request URL : https://api-sandbox.oqsha.com/Trigger-Configs/Dropdowns


Request URL : https://api-sandbox.oqsha.com/Organisation/264/Users/DropDown


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


Request Body : {"Dimensions":{"CategoryTypeId":"177"}}


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Investigation/Categories


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentManagement/Statuses


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentManagement/Investigation/Statuses


Request Body : {}


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


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


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentManagement/Incident/1342


Request URL : https://api-sandbox.oqsha.com/Organisations/248/Departments?siteId=708


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentManagement/Categories


Request URL : https://api-sandbox.oqsha.com/Organisations/248/FieldStaffAndAppUsers?SiteIds=708


Request URL : https://api-sandbox.oqsha.com/Organisation/248/Users/DropDown?ModuleName=Incident Management&siteId=708&AcmModuleId=46


Request URL : https://api-sandbox.oqsha.com/Organisations/248/IncidentManagement/Incident/1342/History


Request Body : {"UserId":267}


Request URL : https://api-sandbox.oqsha.com/Assets?orgId=248&LocationId=708&isActive=true


Request URL : https://api-sandbox.oqsha.com/Users


Request Body : {"OrgId":[248],"RoleId":[340],"LocationId":[708],"SortingColumn":["DisplayName"],"SortingOrder":["asc"],"PageSize":1000,"PageNumber":1,"IsActive":true}


Request Body : {"OrgId":[248],"RoleId":[334],"LocationId":[708],"SortingColumn":["DisplayName"],"SortingOrder":["asc"],"PageSize":1000,"PageNumber":1,"IsActive":true}


Request Body : {"OrgId":[248],"RoleId":[343],"LocationId":[708],"SortingColumn":["DisplayName"],"SortingOrder":["asc"],"PageSize":1000,"PageNumber":1,"IsActive":true}


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