MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Fatal error encountered attempting to read the resultset. ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Reading from the stream has failed. ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32 offset, Int32 count)
   at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
   at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
   at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- 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 Dapper.SqlMapper.<QueryMultipleAsync>d__57.MoveNext()
--- 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.DAL.Repositories.PtwRepo.<>c__DisplayClass54_0.<<GetAllPermitToWork>b__1>d.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\PtwRepo.cs:line 2413
--- 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.DAL.Repositories.BaseRepo.<ExecuteQueryAsync>d__7`1.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\BaseRepo.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.DAL.Repositories.PtwRepo.<GetAllPermitToWork>d__54.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\PtwRepo.cs:line 2411
--- 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.PtwBLL.<GetAllPermitToWork>d__25.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\PtwBLL.cs:line 2546


The operation was canceled.

System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()


System.InvalidOperationException: JSReport render failed. Status: 400. Response: {"message":"Error when evaluating engine handlebars for template /ShivGanga/Inspection/monthly vehicle & equipment checklist/monthly vehicle & equipment checklist\n(because) missing helper: \"addOne\"","stack":"Error: Missing helper: \"addOne\"\n  at Object.<anonymous> (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)\n  at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)\n  at 1 (eval at <anonymous> (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:8504:27)), <anonymous>:21:102)\n  at prog (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:267:12)\n  at execIteration (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51:19)\n  at Object.<anonymous> (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:61:13)\n  at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)\n  at 0 (eval at <anonymous> (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:8504:27)), <anonymous>:11:52)\n  at prog (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:267:12)\n  at Object.<anonymous> (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js:32:14)\n  at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)\n  at Object.main (eval at <anonymous> (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:8504:27)), <anonymous>:58:49)\n  at main (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:206:32)\n  at ret (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:210:12)\n  at Object.execute (/app/node_modules/@jsreport/jsreport-handlebars/lib/handlebarsEngine.js:80:14)\n  at Object.execute (/app/node_modules/@jsreport/jsreport-handlebars/lib/worker.js:27:43)\nwrapped by:\nError: Error when evaluating engine handlebars for template /ShivGanga/Inspection/monthly vehicle & equipment checklist/monthly vehicle & equipment checklist\n(because) missing helper: \"addOne\"\n  at module.exports (/app/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)\n  at WorkerReporter.createError (/app/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:53:12)\n  at executeEngine (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:377:35)\n  at async engine.engine (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:162:14)\n  at async invokeRender (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:61:23)\n  at async WorkerReporter._render (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:148:7)\n  at async /app/node_modules/@jsreport/jsreport-core/lib/worker/reporter.js:234:24\n  at async processAndResponse (/app/node_modules/@jsreport/advanced-workers/lib/workerHandler.js:42:17)"}
   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 77
--- 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.InspectionV2Bll.<ExportInspectionV2PDFAsync>d__8.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\InspectionV2Bll.cs:line 895


System.IO.FileNotFoundException: Could not find file 'D:\App-Data\iis\api.incidentreporter365.com\Templates\ExportInspectionV2PDFTemplate.html'.
File name: 'D:\App-Data\iis\api.incidentreporter365.com\Templates\ExportInspectionV2PDFTemplate.html'
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)
   at InspectionV2PDFHelper.<ExportInspectionV2PDFAsync>d__1.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\Helpers\InspectionV2PDFHelper.cs:line 82
--- 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.InspectionV2Bll.<ExportInspectionV2PDFAsync>d__8.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\InspectionV2Bll.cs:line 914


System.InvalidOperationException: JSReport render failed. Status: 404. Response: {"message":"Unable to find specified template (Drop Survey Checklist)","stack":"Error: Unable to find specified template (Drop Survey Checklist)\n  at module.exports (/app/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)\n  at WorkerReporter.createError (/app/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:53:12)\n  at AsyncFunction.<anonymous> (/app/node_modules/@jsreport/jsreport-core/lib/worker/templates.js:51:28)\n  at async ListenerCollection.fire (/app/node_modules/@jsreport/jsreport-core/lib/shared/listenerCollection.js:157:21)\n  at async beforeRender (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:24:5)\n  at async WorkerReporter._render (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:147:7)\n  at async /app/node_modules/@jsreport/jsreport-core/lib/worker/reporter.js:234:24\n  at async processAndResponse (/app/node_modules/@jsreport/advanced-workers/lib/workerHandler.js:42:17)"}
   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 77
--- 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.InspectionV2Bll.<ExportInspectionV2PDFAsync>d__8.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\InspectionV2Bll.cs:line 895


System.InvalidOperationException: JSReport render failed. Status: 400. Response: {"message":"Error when evaluating engine handlebars for template /ShivGanga/Inspection/monthly vehicle & equipment checklist/monthly vehicle & equipment checklist\n(because) missing helper: \"addOne\"\n\n(sandbox.js line 40:18)","stack":"Error: Missing helper: \"addOne\"\n  at Object.<anonymous> (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)\n  at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)\n  at 0 (eval at <anonymous> (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:8504:27)), <anonymous>:12:102)\n  at prog (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:267:12)\n  at execIteration (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51:19)\n  at Object.<anonymous> (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:61:13)\n  at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)\n  at Object.main (eval at <anonymous> (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:8504:27)), <anonymous>:47:49)\n  at main (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:206:32)\n  at ret (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:210:12)\n  at Object.execute (/app/node_modules/@jsreport/jsreport-handlebars/lib/handlebarsEngine.js:80:14)\n  at Object.execute (/app/node_modules/@jsreport/jsreport-handlebars/lib/worker.js:27:43)\n  at executionFn (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:273:42)\n  at eval (sandbox.js:40:18)\n  at async run (/app/node_modules/@jsreport/jsreport-core/lib/worker/sandbox/createSandbox.js:135:18)\n  at async WorkerReporter.runInSandbox [as _runInSandbox] (/app/node_modules/@jsreport/jsreport-core/lib/worker/sandbox/runInSandbox.js:214:14)\nwrapped by:\nError: Error when evaluating engine handlebars for template /ShivGanga/Inspection/monthly vehicle & equipment checklist/monthly vehicle & equipment checklist\n(because) missing helper: \"addOne\"\n  at module.exports (/app/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)\n  at WorkerReporter.createError (/app/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:53:12)\n  at executeEngine (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:377:35)\n  at async engine.engine (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:162:14)\n  at async invokeRender (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:61:23)\n  at async WorkerReporter._render (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:148:7)\n  at async /app/node_modules/@jsreport/jsreport-core/lib/worker/reporter.js:234:24\n  at async processAndResponse (/app/node_modules/@jsreport/advanced-workers/lib/workerHandler.js:42:17)"}
   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 77
--- 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.InspectionV2Bll.<ExportInspectionV2PDFAsync>d__8.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\InspectionV2Bll.cs:line 895


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


System.InvalidOperationException: JSReport render failed. Status: 400. Response: {"message":"Error when evaluating engine handlebars for template /ShivGanga/Inspection/monthly vehicle & equipment checklist/monthly vehicle & equipment checklist\n(because) missing helper: \"getVal\"\n\n(sandbox.js line 36:18)","stack":"Error: Missing helper: \"getVal\"\n  at Object.<anonymous> (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)\n  at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)\n  at 0 (eval at <anonymous> (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:8504:27)), <anonymous>:12:102)\n  at prog (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:267:12)\n  at Object.<anonymous> (/app/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js:32:14)\n  at Object.wrapper (/app/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js:15:19)\n  at Object.main (eval at <anonymous> (eval at makeEvaluate (/app/node_modules/@jsreport/ses/index.js:8504:27)), <anonymous>:85:49)\n  at main (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:206:32)\n  at ret (/app/node_modules/handlebars/dist/cjs/handlebars/runtime.js:210:12)\n  at Object.execute (/app/node_modules/@jsreport/jsreport-handlebars/lib/handlebarsEngine.js:80:14)\n  at Object.execute (/app/node_modules/@jsreport/jsreport-handlebars/lib/worker.js:27:43)\n  at executionFn (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:273:42)\n  at eval (sandbox.js:36:18)\n  at async run (/app/node_modules/@jsreport/jsreport-core/lib/worker/sandbox/createSandbox.js:135:18)\n  at async WorkerReporter.runInSandbox [as _runInSandbox] (/app/node_modules/@jsreport/jsreport-core/lib/worker/sandbox/runInSandbox.js:214:14)\n  at async executeEngine (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:354:16)\nwrapped by:\nError: Error when evaluating engine handlebars for template /ShivGanga/Inspection/monthly vehicle & equipment checklist/monthly vehicle & equipment checklist\n(because) missing helper: \"getVal\"\n  at module.exports (/app/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)\n  at WorkerReporter.createError (/app/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:53:12)\n  at executeEngine (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:377:35)\n  at async engine.engine (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/executeEngine.js:162:14)\n  at async invokeRender (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:61:23)\n  at async WorkerReporter._render (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:148:7)\n  at async /app/node_modules/@jsreport/jsreport-core/lib/worker/reporter.js:234:24\n  at async processAndResponse (/app/node_modules/@jsreport/advanced-workers/lib/workerHandler.js:42:17)"}
   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 77
--- 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.InspectionV2Bll.<ExportInspectionV2PDFAsync>d__8.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\InspectionV2Bll.cs:line 895


System.InvalidOperationException: HealthV2UIDFormatOptions not found in PageFlags.
   at IncidentReporter.API.BLL.HealthV2Bll.<GenerateHealthV2UidAsync>d__11.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\HealthV2Bll.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.HealthV2Bll.<CreateHealthV2Async>d__5.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\HealthV2Bll.cs:line 161


One or more errors occurred.

System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MySql.Data.MySqlClient.Statement.ExecuteNext()
   at MySql.Data.MySqlClient.PreparableStatement.Execute()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior)
   at Dapper.SqlMapper.<QueryImpl>d__138`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType)
   at IncidentReporter.DAL.Repositories.PtwRepo.GetWorkPermitCommentsByPtwId(List`1 permitIds, Int32 orgId) in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\PtwRepo.cs:line 2986
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
   at MySql.Data.MySqlClient.Statement.ExecuteNext()
   at MySql.Data.MySqlClient.PreparableStatement.Execute()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior)
   at Dapper.SqlMapper.<QueryImpl>d__138`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType)
   at IncidentReporter.DAL.Repositories.PtwRepo.GetWorkPermitCommentsByPtwId(List`1 permitIds, Int32 orgId) in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\PtwRepo.cs:line 2986
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()<---

---> (Inner Exception #1) MySql.Data.MySqlClient.MySqlException (0x80004005): There is already an open DataReader associated with this Connection which must be closed first.
   at MySql.Data.MySqlClient.Interceptors.ExceptionInterceptor.Throw(Exception exception)
   at MySql.Data.MySqlClient.MySqlCommand.Throw(Exception ex)
   at MySql.Data.MySqlClient.MySqlCommand.CheckState()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at Dapper.SqlMapper.ExecuteReaderWithFlagsFallback(IDbCommand cmd, Boolean wasClosed, CommandBehavior behavior)
   at Dapper.SqlMapper.<QueryImpl>d__138`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Dapper.SqlMapper.Query[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Boolean buffered, Nullable`1 commandTimeout, Nullable`1 commandType)
   at IncidentReporter.DAL.Repositories.PtwRepo.GetPtwHistoryAttachments(List`1 ptwIds) in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\PtwRepo.cs:line 3065
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()<---


One or more errors occurred.


An unexpected error occurred.

IncidentReporter.DAL.Exceptions.UpstreamServiceException: An unexpected error occurred.
   at IncidentReporter.API.Handlers.EntityStateWorkflowHandler.<GetAvailableTransitionsAsync>d__4.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\Handlers\EntityStateWorkflowHandler.cs:line 152
--- 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.OrganisationBLL.<GetEntityStateAvailableTransitionsAsync>d__81.MoveNext() in C:\GitLab-Runner\builds\27n6lYj0J\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\OrganisationBLL.cs:line 15293


An unexpected error occurred.


The operation was canceled.

System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()