503.0 error when previewing reports

17 posts, 0 answers
  1. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 07 Jun Link to this post

    I'm fairly consistently getting a 503.0 error (server has been shutdown) when working with Telerik reports. This is an ASP.NET Core application, currently with a single report with 2 sub-reports. I've published the application to a test Azure app service and that fails pretty consistently when trying to preview the report each time. On most occasions the report opens but as soon as I switch to print preview I receive a report that the service has shutdown with a 503.0 error - racing shows this to be with ASPNetCoreModuleV2.

    If I run the application in debug mode from my VS2017 on Windows 10 using IISExpress and Firefox browser, the application works fine and I can navigate around without any issues. If I then run the report it opens and displays correctly. I can switch to print preview and mostly that also shows correctly but when I try to export to PDF I get the 503.0 error. Sometimes the error will come up at print preview stage. The report runs from a SQL data source using a stored procedure. The 2 sub-reports run from separate stored procedures. They are all set to use the same application "ReportsConnection", passing 2 parameters to the report and consequent stored procedure. Can you provide some advice on what might be causing this problem or what to investigate to try to identify the issues?

  2. Todor
    Admin
    Todor avatar
    332 posts

    Posted 12 Jun Link to this post

    Hi PaulH,

    This is a new issue for us. The strange thing is that, if I understood correctly, the PDF export and Print Preview may work correctly or may fail when the application is deployed in Azure. The observed 503 error is also a new issue for us as it indicates unavailable service. Could you sent a trace log of the error - you may check how to set up a Trace Listener in .NET Core in the Troubleshooting reporting implementation into ASP.NET Core application KB article.

    Additionally, you may check the following threads for possible approaches for tackling the problem.
    Troubleshoot HTTP errors of "502 bad gateway" and "503 service unavailable" in Azure App Service
    Aspnetcore deployment to App Service targeting .net framework cause error until AspNetCoreModuleV2 is switched back to AspNetCoreModule

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 12 Jun in reply to Todor Link to this post

    I have published the application to a test Azure app service running in a fairly minimal specification and it fails pretty consistently to display the report initially, let alone preview or export. It seems that if I throw more resource and the application then I can get the report to run but some guidelines on how much resource is required for it to work in Azure or configuration settings that should be made would be useful. Having said that, it should not be a resource problem when running in IISExpress from my development machine which is a high-spec i7 machine with 32GB RAM. The rest of the application, excluding the reporting, seems to work reliably in all cases. I'll perform some monitoring and see if I can get some indicators as to why the service is crashing (which is what I can only assume is occurring) when I'm using the reporting and come back to you but any other information you can provide to do with advice for publishing to Azure would be useful if you have it.
  4. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 13 Jun Link to this post

    I've tried various things to get to the bottom of this but so far I've not made any real progress. I upscaled and outscaled my Azure test app up to approx £220/month setup (4 cores, 7GB RAM etc) and I can run the app and preview the report but any attempt to export to PDF fails with a 503 taking down the app service. When I'm running locally from IIS Express, sometimes the report will open and I can switch to preview and sometimes I can't. I've run it again this morning, launched the report which opens OK and I can scroll down it and view all the data I expect to see in it (it produces a 6 page document with 2 sub-reports included) but when clicking for print preview I get the attached screen. I'm more than willing to accept I'm doing something wrong or I'm missing some reference but I can't find what it is from the various documents you've provided or I've searched for. Given that I have issues in IISExpress locally I'm discounting Azure specific publish issues for now, making the assumption that whatever the problem is it most likely stems from the setup of the solution in some way. Any further advice?
  5. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 13 Jun Link to this post

    Sorry, hit post too soon. I setup the trace and the tail part of the log is below - note there are no errors recorded anywhere in the log file - it just ends when the app hits 503:

    Worker rendering threads count: 12
    ----------------------
    Cache cleaning started
    12/06/2019 11:39:28
    Check period: 00:05:00
     
         1 Refreshes         00:00:00.1179746
         0 ReportInstances   00:00:00.0000023
         1 Clients           00:00:00.0039295
     
    Total cache clean time: 00:00:00.1864792
    SolutionNamexxxx Information: 0 : Unit.DotsPerInch = 96
    Rendering thread 42 starts work.
     
    *** ReportProcessor.ProcessReport STARTED ***
     
    *** ProcessReport #0 STARTED ***
    *** ProcessReport #0 DONE in 00:00:00.3725415 ***
     
    *** ReportProcessor.ProcessReport DONE in 00:00:00.4198504 ***
     
     
    *** RenderReport #0 STARTED ***
    *** RenderReport #0 DONE in 00:00:00.3088494 ***
     
    Rendering thread 42 finishes work.
    Rendering thread 42 starts work.
     
    *** ReportProcessor.ProcessReport STARTED ***
     
    *** ProcessReport #0 STARTED ***
    *** ProcessReport #0 DONE in 00:00:00.0267524 ***
     
    *** ReportProcessor.ProcessReport DONE in 00:00:00.0380915 ***
     
     
    *** RenderReport #0 STARTED ***
    *** RenderReport #0 DONE in 00:00:00.4467759 ***
     
    Rendering thread 42 finishes work.
  6. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 13 Jun Link to this post

    Again, I have more information. I've changed the report viewer to print preview by default and that seems to be working better, both locally and on Azure having made some other configuration changes within the app. I've run tests on the ASP NET Core demo example locally and find that runs fine though I can't see any material differences between that solution and mine. I have found that I can export to CSV, Excel, Word and sometimes multiple exports before any failure occurs. However, export to PDF fails every time and export to PowerPoint seems not to work either.
  7. Todor
    Admin
    Todor avatar
    332 posts

    Posted 17 Jun Link to this post

    Hello PaulH,

    According to the trace log the report has been processed and rendered server-side correctly, with no issues. Therefore, I assume that the problem may indeed happen when delivering it. What is the Storage type you use for the REST Service? After rendering successfully, the response to the Get Document Info request (on the screenshots I see that it is the one that fails) should be 200 OK, and the next request should be made for the document itself or its first page - Get Document Page or Get Document. Have you overridden some of our methods in the ReportsController?

    You may check the Windows Event Viewer for additional information on the problem.
    Fiddler may also give further details. You may send us the SAZ files recorded by Fiddler for local investigation.

    Since the problem occurs also on IISExpress locally and is not specifically related to Azure, consider opening a support ticket and sending a runnable project for local investigation.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 19 Jun Link to this post

    Hi Todor.

    I'm using the default FileStorage and I can see it creating a large hierarchy of files in the path I've requested locally. I did find an issue in the Event Viewer (id 2264) relating to Static Compression and that seemed to be caused because the path it was trying to access wasn't there. I created the related folder and ensured the security was correct and the warning went away but the problem hasn't. It's still absolutely consistent that any attempt to export to PDF when running in IISExpress fails by taking down the app pool it would appear so giving a 503.0 error. I also noted that my main project assembly and namespace were not the same and that was showing a difference in places so I've been and changed everything to be absolutely consistent for namespace and assembly and that has also had no impact on the issue. I will look at Fiddler and come back once I have.

  9. Todor
    Admin
    Todor avatar
    332 posts

    Posted 24 Jun Link to this post

    Hello PaulH,

    The warning in the Event Viewer may not be related to the problem.
    I hope the information from Fiddler would shed more light on the issue.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  10. Scott
    Scott avatar
    2 posts
    Member since:
    Jan 2017

    Posted 08 Jul in reply to Todor Link to this post

    Have you made any progress resolving this?  I am having the exact same problem (error) when attempting to print from an ASP Core MVC application.
  11. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 09 Jul Link to this post

    To be honest I've had no time to delve further into it. I find that the example reports Telerik supply work OK of course but our report, while it will preview OK most of the time (we have it set to open in print preview by default) cannot be exported to PDF at all. Other exports work, some of the time. The report is to produce a multi page document, it includes 2 sub-reports, relies on a SQL database connection getting the data using stored procedures with parameters, so is not at all easy to include in any "sample project" to submit for review. The basic structure of the report matches with a similar set of reports we did in a previous ASP.NET MVC app a few years ago and they worked fine, though they were only single page reports. It does seem to relate to the .NET Core implementation but as yet I can't prove anything useful. Have you been through the steps, Fiddler etc, they suggested to me to try that I've not been able to do yet?
  12. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 22 Jul Link to this post

    I'm missing XPSRendering. When I added the Reporting Nuget package I also had to add the OpenXMLRendering package and I added the Reporting Services ASP.NET Core package. I've finally had a chance to trace on Azure and it's reporting that it can't find the XPSRendering module. I've updated to 13.1.19.618 but still XPSRendering has not been included in the solution. I can see that the demo solutions reference the XPSRendering library module. I tried referencing the module but it had no effect. Can you please advise how XPSRendering should be included in the project?
  13. Todor
    Admin
    Todor avatar
    332 posts

    Posted 25 Jul Link to this post

    Hi PaulH,

    The XPS rendering is not supported for pure .NET Core projects - check Implemented Features and Limitations. This is due to technical difficulties with the implementation in .NET Core. Adding the XPS rendering for .NET Core is not in our immediate plans for the same reason. Our Azure demo is a .NET Framework project and XPS is available there.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  14. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 25 Jul in reply to Todor Link to this post

    Hi Todor and thanks for your response. I have to say I understand that this issue is most likely documented in your Implemented Features and Limitations but considering how long I've been reporting this 503 error and the fact it's been trying to export to PDF that I'm a little surprised it has taken this long to get this particular key bit of information. That being said, we now have a .NET Core application hosted in Azure that will produce a report that can't be exported to PDF which is absolutely vital to the sign off of the project. Is there a simple change that can be made to achieve this? I have to admit this is the first .NET Core project we've done and while I've seen reference to targetting the full .NET Framework I'm not clear on what impact that would have on the rest of the project. Time is very much now of the essence so a quick response would be very much appreciated.

    Thanks in advance

  15. Todor
    Admin
    Todor avatar
    332 posts

    Posted 30 Jul Link to this post

    Hi PaulH,

    The issue with PDF export not working is not known for us and we were not able to reproduce it until now. Our demos work correctly and export successfully to PDF. You may try to adjust your project according to them.

    The best that will work for us in order to investigate the problem will be a sample demonstrating it. We may be able to see something also in the Fiddler SAZ file recorded while the issue occurs. We would do our best to find out what is causing the error and how it could be fixed if you sent us any of those.

    Note that we usually try to answer forum threads within 72 working hours. However, we do not guarantee a response in the forum.
    If you want to be sure to receive an answer within 24 working hours, you should open a Support Ticket.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  16. PaulH
    PaulH avatar
    65 posts
    Member since:
    Mar 2011

    Posted 30 Jul Link to this post

    Hi Todor.

    I think we must be getting crossed wires here. The solution we have is an ASP.NET Core 2.2 web application with a SQL Azure backend database with Entity Framework Core for data access. We have a Telerik report viewer in the front end ASP.NET Core web app which will preview the report and from there we can export to Word and Excel. If we try to export to PDF it kills the web application and results in us receiving a 503.0 error and we have to restart the app service in the Azure management portal. Having delved deeper into what was going on via an Azure trace I picked up an entry telling me that we were missing the XPSRendering library - presumably used to produce the PDF export file. When I reported that I couldn't get the XPSRendering library into our solution you told me that XPSRendering is not supported "for pure .NET Core projects" and requires a full .NET Framework. So, what I'm simply trying to establish now is what is the easiest way to be able to retain all the development effort that's been expended on this project (and the cost of the Telerik licence of course) with the Telerik Reporting for producing the required reports and be able to export those reports to PDF? This project is in beta with the client testing all basic functionality and currently the only thing that doesn't work is the ability to export reports to PDF. How do we resolve this?

    I will log a separate support ticket but if the answer will just be that XPSRendering is not support on pure .NET Framework projects then I'm not sure how much benefit that will be to anyone.

  17. Todor
    Admin
    Todor avatar
    332 posts

    Posted 31 Jul Link to this post

    Hi PaulH,

    I have replied to the support ticket you opened on the topic. I will include the relevant part of my answer also here :

    The XPS rendering is an extra functionality that requires Telerik.Reporting.XpsRendering.dll file that should be added manually to the project, e.g. our Visual Studio item templates do not add it automatically. The Reporting engine, when called, checks for the available external resources that are necessary for all the supported rendering formats. If an assembly that is required for any of the formats (e.g. Telerik.Reporting.XpsRendering.dll, Telerik.Reporting.OpenXmlRendering.dll) is missing, the engine will throw a first chance exception (i.e. passed to the debugger but not passed back to the application), which will be logged just to notify that the assembly is missing. This error will not distort in any way the workflow for the other renderings. Hence, PDF rendering does not depend on Telerik.Reporting.XpsRendering.dll file and the absence of this assembly cannot interfere with PDF rendering. In other words, the two problems are not related.

    The PDF rendering logic is part of our main Telerik.Reporting assembly and does not require any additional assemblies, i.e. it is enabled by default with the installation of the product. PDF format is based on the IMAGE format - check PDF Rendering. Note that some Azure plans have restrictions related to the GDI+ that we use in IMAGE rendering - check GDI+ error or OutOfMemoryException on exporting or printing Telerik report from Azure WebSites KB article.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top