level: Error

severity: ERROR

stackTrace:
MySql.Data.MySqlClient.MySqlException (0x80004005): Cannot add or update a child row: a foreign key constraint fails (`qa_stg_oqsha`.`user_grid_filter_preferences_lookup`, CONSTRAINT `fk_org_grid_pref_lookup_id` FOREIGN KEY (`organisation_grid_filter_preferences_lookup_id`) REFERENCES `organisation_grid_filte)
   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.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteScalar()
   at Dapper.SqlMapper.ExecuteScalarImpl[T](IDbConnection cnn, CommandDefinition& command)
   at Dapper.SqlMapper.ExecuteScalar[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType)
   at IncidentReporter.DAL.Repositories.UsersRepo.InsertUserGridPreferenceLookup(UserGridPreferenceLookupDBO userGridPreferenceLookup) in C:\Gitlab-Runner\builds\pmbcEkqkx\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\UsersRepo.cs:line 10113
   at IncidentReporter.API.BLL.UsersBLL.<UpdateUserPreference>d__165.MoveNext() in C:\Gitlab-Runner\builds\pmbcEkqkx\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\UsersBLL.cs:line 9835


stackTrace:
System.InvalidCastException: Cannot cast Newtonsoft.Json.Linq.JArray to Newtonsoft.Json.Linq.JToken.
   at Newtonsoft.Json.Linq.Extensions.Convert[T,U](T token)
   at Newtonsoft.Json.Linq.JToken.Value[T](Object key)
   at IncidentReporter.API.BLL.HealthBLL.MapHealthChecksToIncidentChecks(CreateHealthRequestDTO request) in C:\Gitlab-Runner\builds\pmbcEkqkx\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\HealthBLL.cs:line 1728
   at IncidentReporter.API.BLL.HealthBLL.<IncidentFromHealthAsync>d__17.MoveNext() in C:\Gitlab-Runner\builds\pmbcEkqkx\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\HealthBLL.cs:line 863
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at IncidentReporter.API.BLL.HealthBLL.<UpdateHealthRequest>d__20.MoveNext() in C:\Gitlab-Runner\builds\pmbcEkqkx\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\HealthBLL.cs:line 1106


message: Cannot cast Newtonsoft.Json.Linq.JArray to Newtonsoft.Json.Linq.JToken.


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


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


stackTrace:
Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[IncidentReporter.DAL.Models.WorkPermitSectionCheck]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'Sections', line 1, position 12.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at IncidentReporter.DAL.Repositories.WorkPermitRepo.<>c__DisplayClass81_0.<GetWorkPermitExtensionsWithApprovers>b__3(Object e) in C:\Gitlab-Runner\builds\pmbcEkqkx\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\WorkPermitRepo.cs:line 2686
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at IncidentReporter.DAL.Repositories.WorkPermitRepo.<GetWorkPermitExtensionsWithApprovers>d__81.MoveNext() in C:\Gitlab-Runner\builds\pmbcEkqkx\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.DAL\Repositories\WorkPermitRepo.cs:line 2686
--- 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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at IncidentReporter.API.BLL.WorkPermitBLL.<GetWorkPermitById>d__17.MoveNext() in C:\Gitlab-Runner\builds\pmbcEkqkx\0\incident-reporter\incident-reporter-api\IncidentReporter\IncidentReporter.API\BLL\WorkPermitBLL.cs:line 1703