How do you use cloud databases? Take the survey.

Reports by email is not working

Hi

I have an issue with scheduled PDF-reports sent by email.
When I receive the email, the PDF files are "damaged". 

I can log in to SQL monitor, and generate the report manually with no problems. But I just can't schedule the reports.
(SQL Monitor is running on an IIS server)


How can I find out what's going wrong?

thanks,
Tagged:

Answers

  • Russell DRussell D Posts: 1,324 Diamond 5
    edited February 27, 2019 10:38AM
    Corrupted pdfs is one problem, but you won't be able to schedule reports unless you've enabled application initialisation within IIS. See https://documentation.red-gate.com/sm9/reports/scheduling-emailed-reports. Get that working first then look at the pdfs.
    Have you visited our Help Centre?
  • JanusGjesagerJanusGjesager Posts: 6 New member
    I have checked, and we have Application initialisation installed and configured.
    - I can schedule reports (have been able to do that the whole time - sorry if that wasn't clear), but I can't open the pdf I receive, because it is damaged/corrupted
  • JanusGjesagerJanusGjesager Posts: 6 New member
    I have checked, and we have Application initialisation installed and configured.
    - I can schedule reports (have been able to do that the whole time - sorry if that wasn't clear), but I can't open the pdf I receive, because it is damaged/corrupted
  • CoopsCoops Posts: 7 New member
    Having the same issue here. Reports are emailed OK on a schedule but the attached PDF is actually just a web page when opened in a text editor :

    <div><!DOCTYPE html><br><html class="csstransforms3d csstransforms csstransitions background-color--grey--1"><br><br><head runat="server"><br>&nbsp;&nbsp;&nbsp; <title><br>&nbsp;&nbsp;&nbsp; Log in<br></title></div>....


  • Can you attach or send in the file as generated please?
    Have you visited our Help Centre?
  • JanusGjesagerJanusGjesager Posts: 6 New member
    attached is a PDF that doen't work
  • CoopsCoops Posts: 7 New member
    Don't know if it's related but I am seeing the following in the logs around the same time the report is generated:
    <div><br></div><div>2019-04-09 13:16:18,760 [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 83] WARN&nbsp; RedGate.SqlMonitor.Common.Utilities.UserAccountHelper - Error asking Active Directory for current user's principal name<br>System.InvalidCastException: Unable to cast object of type 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type 'System.DirectoryServices.AccountManagement.UserPrincipal'.<br>&nbsp;&nbsp; at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, IdentityType identityType, String identityValue)<br>&nbsp;&nbsp; at System.DirectoryServices.AccountManagement.UserPrincipal.get_Current()<br>&nbsp;&nbsp; at RedGate.SqlMonitor.Common.Utilities.UserAccountHelper.GetUsernameFromAd()System.InvalidCastException: Unable to cast object of type 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type 'System.DirectoryServices.AccountManagement.UserPrincipal'.<br>&nbsp;&nbsp; at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, IdentityType identityType, String identityValue)<br>&nbsp;&nbsp; at System.DirectoryServices.AccountManagement.UserPrincipal.get_Current()<br>&nbsp;&nbsp; at RedGate.SqlMonitor.Common.Utilities.UserAccountHelper.GetUsernameFromAd()</div>



  • Russell DRussell D Posts: 1,324 Diamond 5
    I don't think that is related; but you see this every time you generate a report?
    Have you visited our Help Centre?
  • CoopsCoops Posts: 7 New member
    edited April 9, 2019 1:57PM
    I see it around the time a report is generated by the schedule - I don't recall seeing it when manually generating a report. I will test that later today.

    Yes i see it even if generating via the "Save as PDF" menu

    2019-04-09 13:54:30,083 [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60] WARN&nbsp; RedGate.SqlMonitor.UI.Website.Areas.Reports.Controllers.ReportController - Phantom JS info: New URL: http://localhost:19600/Reports/Report/PrintReport?Report=AG%20Performance%20v1&EndDate=1554818058970&Period=86400000<br>2019-04-09 13:54:30,520 [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 118] WARN&nbsp; RedGate.SqlMonitor.UI.Website.Areas.Reports.Controllers.ReportController - Phantom JS info: CONSOLE: JQMIGRATE: Migrate is installed, version 1.4.1 (from line # in "")<br>2019-04-09 13:54:32,422 [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 118] WARN&nbsp; RedGate.SqlMonitor.UI.Website.Areas.Reports.Controllers.ReportController - Phantom JS info: New URL: about:blank<br>2019-04-09 13:54:40,016 [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60] WARN&nbsp; RedGate.SqlMonitor.Common.Utilities.UserAccountHelper - Error asking Active Directory for current user's principal name<br>System.InvalidCastException: Unable to cast object of type 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type 'System.DirectoryServices.AccountManagement.UserPrincipal'.<br>&nbsp;&nbsp; at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, IdentityType identityType, String identityValue)<br>&nbsp;&nbsp; at System.DirectoryServices.AccountManagement.UserPrincipal.get_Current()<br>&nbsp;&nbsp; at RedGate.SqlMonitor.Common.Utilities.UserAccountHelper.GetUsernameFromAd()System.InvalidCastException: Unable to cast object of type 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type 'System.DirectoryServices.AccountManagement.UserPrincipal'.<br>&nbsp;&nbsp; at System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, IdentityType identityType, String identityValue)<br>&nbsp;&nbsp; at System.DirectoryServices.AccountManagement.UserPrincipal.get_Current()<br>&nbsp;&nbsp; at RedGate.SqlMonitor.Common.Utilities.UserAccountHelper.GetUsernameFromAd()


  • Russell DRussell D Posts: 1,324 Diamond 5
    I haven't forgotten about this; it's taking time and I'll be honest we don't yet know whats causing it.
    Have you visited our Help Centre?
  • CoopsCoops Posts: 7 New member
    Anything we can do to help debug this?
  • CoopsCoops Posts: 7 New member
    Any update on this? It's still happening on 9.0.14 will install 9.0.18 today and see if it's any better.
  • Russell DRussell D Posts: 1,324 Diamond 5
    Are you using an SSL?
    Have you visited our Help Centre?
  • CoopsCoops Posts: 7 New member
    No this is internal only and is running over HTTP. I can setup SSL if you think it might fix things?
  • Russell DRussell D Posts: 1,324 Diamond 5
    No if you're not using SSL then I don't think we'll have fixed things for you. We were getting corrupted reports (or failed entirely) when using SSL and we fixed that behaviour; we've had no luck reproducing this for non-SSL cases unfortunately. Can you get in touch via support?
    Have you visited our Help Centre?
Sign In or Register to comment.