NullReferenceException Telerik.Reporting.Services.Engine.ReportEngine.CreateDocumentCore

1 Answer 132 Views
.NET Core
Sergei
Top achievements
Rank 1
Sergei asked on 19 Jun 2023, 11:02 AM

Hi,

I use the telerik reporting version: 15.2.21.1125 .NET Core 6 MVC.

The service is working correctly, but there are errors in the logs.

And sometimes when I click to generate a report, I get this error.

 

RequestPath: /TelerikReporting/Report/clients/f06d6c18a51/instances/d88f958a6a9/documents

Exception.StackTrace:

{
  "ClassName": "System.NullReferenceException",
  "Message": "Object reference not set to an instance of an object.",
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "HResult": -2147467261,
  "HelpURL": null,
  "Depth": 0,
  "Source": "Telerik.Reporting",
  "StackTraceString": "   at Telerik.Reporting.Services.Engine.ReportEngine.CreateDocumentCore(ReportInstance instance, Refresh refresh, String format, Dictionary`2 deviceInfo, ReportDocumentState rds, String clientID)\n   at Telerik.Reporting.Services.Engine.ReportEngine.CreateDocument(String clientID, String instanceID, String format, Dictionary`2 deviceInfo, Boolean useCache, String baseDocumentID, String actionID)\n   at Telerik.Reporting.Services.AspNetCore.ReportsControllerBase.CreateDocument(String clientID, String instanceID, CreateDocumentArgs args)\n   at lambda_method473(Closure , Object , Object[] )\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\n--- End of stack trace from previous location ---\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)"
}

I would be grateful for your assistance.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 22 Jun 2023, 07:47 AM

Hi Sergei,

If I understand correctly, the Resolve Document request is failing occasionally when you try to export a report, I assume from a report viewer, is that correct?

That indicates a problem with the storage and its cache. Are you perhaps using FileStorage? If yes, please consider switching one of the storage implementations better suited for production - IStorage implementation suitable for deploying both on single instance application hosting and in Web Farms.

If the problems persist even after switching the storage, please attach a trace listener to your project and send us the produced log - How to troubleshoot errors in ASP.NET Core projects - Telerik Reporting.

I will be looking forward to receiving an update from you.

Regards,
Dimitar
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Sergei
Top achievements
Rank 1
commented on 22 Jun 2023, 12:17 PM

Hi Dimitar,

I use the RedisStorage.

Attached the log file.

Thanks

Dimitar
Telerik team
commented on 27 Jun 2023, 09:33 AM

Hi Sergei,

Thank you for the attached log!

I inspect it but the log does not appear to be a normal trace log, would you please generate it as shown in the How to troubleshoot errors in ASP.NET Core projects - Telerik Reporting article?

From the currently presented log, I still cannot determine what is causing the issue, could you please share more details on when the problem appears? Is it for a specific rendering format and are you able to reproduce it consistently?

In what environment does the reporting service run? Azure? What is the OS?

If the service is running on Azure, and it occurs occasionally, the issue might be related to the server load and you may need a higher-tier Azure service, please refer to the Use Report Viewers with REST Service on Azure - Telerik Reporting KB for more details.

If the service is hosted on an OS different than Windows, please make sure that you have installed the necessary packages - Using Telerik Reporting with .NET Core, 6, 7, or Standard - Telerik Reporting.

If you would need further assistance, besides the trace log and answering the questions about the scenario, please also attach a report definition that has the problem and the data necessary to preview it on my machine so that I can debug it locally.

I will be looking forward to your next update.

 

 

Sergei
Top achievements
Rank 1
commented on 27 Jun 2023, 11:29 AM

Hi Dimitar,

I am using stack: .NET 6, Alpine Linux v3.15 + Kubernetes.

The error appears on all reports.

I don't have the ability to create a regular trace log on a production environment.

Thanks

Dimitar
Telerik team
commented on 30 Jun 2023, 08:33 AM

Hello Sergei,

Thank you for the new information!

Currently, there is a specific .NET setting that must be turned on when reporting is running on .NET 6 and non-Windows OS, please see the System.Drawing.Common is not supported on non-Windows platforms starting with .NET 6 - Telerik Reporting KB article for details on what that setting is and how to enable it.

If the above does not help, it would be hard to debug the problem without seeing some kind of trace log. Why is it not possible to create the trace log? I assume the problem is with accessing it so, how about exposing and downloading the log file from an endpoint of your service?

I expect that the problem will be resolved with the runtime setting but if not, I will need to see a trace log to diagnose the root of the issue, please try to produce such.

Sergei
Top achievements
Rank 1
commented on 06 Jul 2023, 07:47 AM

Hi Dimitar,

I applied a specific .NET setting, the error repeated.

I found a way to create a trace log from a productive environment.
What email address can I send the log file to?

Thanks

Dimitar
Telerik team
commented on 10 Jul 2023, 02:14 PM

Hello Sergei,

Could you please attach the log to your reply as a zip? The trace log should not contain any sensitive information(as long as you do not log that yourself somewhere in the application).

Also, did you check that you have installed the packages listed in Deploying on Linux?

 

Sergei
Top achievements
Rank 1
commented on 14 Jul 2023, 11:02 AM

Hi Dimitar,

>>Also, did you check that you have installed the packages listed in Deploying on Linux?

Yes

Thanks

Todor
Telerik team
commented on 19 Jul 2023, 08:04 AM

Hi Sergei,

Did you record a trace log when the problem occurred? You may check the KB article How to troubleshoot errors in ASP.NET Core projects - Telerik Reporting for details. Please, send us the log that would hopefully contain more information that would let us investigate further.

Sergei
Top achievements
Rank 1
commented on 24 Jul 2023, 12:20 PM

Hi Dimitar,

>>Did you record a trace log when the problem occurred?

No.

I'm waiting for the release of our service, after I can provide trace logs.

Thanks

Sergei
Top achievements
Rank 1
commented on 17 Aug 2023, 12:07 PM

Hi Dimitar,

Attached the log file.

Thanks

Dimitar
Telerik team
commented on 22 Aug 2023, 09:02 AM

Hello Sergei,

Thank you for the attached log!

It doesn't seem to be a trace log, or at least isn't in the usual format but in any case, the exception was present. However, the only new information that I got from it is the exception: Could not deserialize object of type ReportInstanceKey. Exception: System.Text.Json.JsonException: Cannot resolve type by type discriminator 'Int64', which is a handled exception and should not be causing this problem.

I see that your account now has a trial license and you should be able to install newer versions. Please test using our latest release and see if the issue is still present with it - Telerik Reporting - Progress® Telerik® Reporting R2 2023 SP1 (17.1.23.718).

If the issue is occurring even with it, please open a new ticket or let me know and I will open it for you, and then send me a runnable project which has this problem so that I can debug it locally.

I will be looking forward to hearing back from you.

 

Sergei
Top achievements
Rank 1
commented on 22 Aug 2023, 10:56 AM

Hello Dimitar,

Thank you

Tags
.NET Core
Asked by
Sergei
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or