question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
malimingcommented, Oct 13, 2022

hi @kevgeni

You can try to add the parameter type to Configuration.Auditing.IgnoredTypes

0reactions
kevgenicommented, Oct 12, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled
Auditing.AuditingHelper.ConvertArgumentsToJson error #4877 - Github JsonSerializationException: Self referencing loop detected error JsonSerializationException: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found