Open Closed

The type 'System.Object' is not a supported dictionary key using converter of type 'System.Text.Json.Serialization.Converters.DefaultObjectConverter' #7985


User avatar
0
dfzamora created
  • ABP Framework version: v8.2.1
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: The type 'System.Object' is not a supported dictionary key using converter of type 'System.Text.Json.Serialization.Converters.DefaultObjectConverter'. Path: $.Error.Data. The type 'System.Object' is not a supported dictionary key using converter of type 'System.Text.Json.Serialization.Converters.DefaultObjectConverter'.
  • Steps to reproduce the issue:
  • Hello I have an application running on Azure, when I userFriendlyException is thrown the server is returning 500 error, I have enabled application Insights and this is what I have

The exception System.NotSupportedException, seems to be happening in Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware

Based on this documentation I have tried to include Newtonsoft because I though the issue was related to serialization, I added the package Volo.Abp.Json.Newtonsoft and AbpJsonNewtonsoftModule dependency on HttpApi, HttpApi.Host and Application modules, but this is not fixing the issue,

These are the packages contained in HttpApi.host

This issue is only happening on Azure (release environment), locally it is working with no issue at all Both environment are working with net8,

I would appreciate if you can help me with this issue, thanks!


8 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    when I userFriendlyException is thrown the server is returning 500 error,

    Are there any logs in Logs.txt file?

    If so, please share it.

    Thanks.

  • User Avatar
    0
    dfzamora created

    Hello, I could generate a CSV file with all errors detected by Application Insights and share it to you, does it work for you like that?

    If so, you could provide me an email to send the file,

    Thanks!

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share the Logs.txt file?

    liming.ma@volosoft.com

    .WriteTo.Async(c => c.File("Logs/logs.txt"))

    public class Program
    {
        public async static Task<int> Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
    #if DEBUG
                .MinimumLevel.Debug()
    #else
                .MinimumLevel.Information()
    #endif
                .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
                .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
                .Enrich.FromLogContext()
                .WriteTo.Async(c => c.File("Logs/logs.txt"))
                .WriteTo.Async(c => c.Console())
                .CreateLogger();
    
  • User Avatar
    0
    dfzamora created

    This is the content of logs.txt

    The line that you wrote was already there

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Only have one line log?

    That's strange.

    Hello, I could generate a CSV file with all errors detected by Application Insights and share it to you, does it work for you like that?

    Please share the logs.

    Thanks

  • User Avatar
    0
    dfzamora created

    Oh, sorry this is a misunderstood, I sent you the content of the file logs.txt (generated by the app), I will generate a file myself using Application Insights records and send it to you

  • User Avatar
    0
    dfzamora created

    I sent you the email, let me know if you find something or if you need to schedule a meeting to have a better idea of the issue,

    thanks

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I sent you the content of the file logs.txt (generated by the app)

    I didn't receive Logs.txt can you share it by https://wetransfer.com/

    liming.ma@volosoft.com
    Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38