Abp.Auditing.AuditingHelper.ConvertArgumentsToJson error
See original GitHub issue- abp 4.8.1
- .net core. I find the following errors from log
- Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property ‘manifestModule’ with type ‘System.Reflection.RuntimeModule’. Path ‘act.method.module.assembly’. at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference(JsonWriter writer, Object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer) at Abp.Auditing.AuditingHelper.ConvertArgumentsToJson(IDictionary`2 arguments).
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Untitled
Auditing.AuditingHelper.ConvertArgumentsToJson error #4877 - Github JsonSerializationException: Self referencing loop detected error JsonSerializationException: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hi @kevgeni
You can try to add the parameter type to
Configuration.Auditing.IgnoredTypes
I had this issue today and it was quite hard to debug. The stack trace was not very helpful as it was inside of the AuditingHelper and would not very show what it was trying to serialize nor where it was trying to serialize it.
Disabling audit logging would temporarely fix the issue (https://aspnetboilerplate.com/Pages/Documents/Audit-Logging)
I implemented a custom abp IAuditSerializer and replaced the default implementation with mine and added a try-catch inside. This allowed me to find that what was failing to be serialized was … a repository ??? The log did show that MyCustomTableRepository but I wasn’t sure what was that.
WARN 2022-10-12 13:29:57,131 [orker] Abp.Auditing.AuditingHelper - Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property ‘manifestModule’ with type ‘System.Reflection.RuntimeModule’. Path ‘MyCustomTableRepository.iocResolver.iocContainer.kernel.graphNodes[0].constructors[0].constructor.module.assembly’. at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference(JsonWriter writer, Object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty)
I found that one of my abp ApplicationService had a method definition like this [HttpPost] public async Task<List<MyCustomDto>> GetMethodA([FromServices] IRepository<MyCustomTable> MyCustomTableRepository, [FromBody] GetMethodAInput input) { }
The default implementation of abp will try to serialize all input parameters, including the injected FromService repository. serializing the repository will fail… I moved that injected repo from the method to the controller and fixed the issue.