How can we help you today? How can we help you today?

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,
JanusGjesager
0

Comments

15 comments

  • Russell D
    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.
    Russell D
    0
  • JanusGjesager
    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
    JanusGjesager
    0
  • JanusGjesager
    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
    JanusGjesager
    0
  • Coops
    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>....


    Coops
    0
  • Russell D
    Can you attach or send in the file as generated please?
    Russell D
    0
  • JanusGjesager
    attached is a PDF that doen't work
    JanusGjesager
    0
  • Coops
    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>



    Coops
    0
  • Russell D
    I don't think that is related; but you see this every time you generate a report?
    Russell D
    0
  • Coops
    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()


    Coops
    0
  • Russell D
    I haven't forgotten about this; it's taking time and I'll be honest we don't yet know whats causing it.
    Russell D
    0
  • Coops
    Anything we can do to help debug this?
    Coops
    0
  • Coops
    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.
    Coops
    0
  • Russell D
    Are you using an SSL?
    Russell D
    0
  • Coops
    No this is internal only and is running over HTTP. I can setup SSL if you think it might fix things?
    Coops
    0
  • Russell D
    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?
    Russell D
    0

Add comment

Please sign in to leave a comment.