Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..

cancel
Showing results for 
Search instead for 
Did you mean: 
No ratings
KB-Sync1
Archer Employee
Archer Employee

Article Number

000017597


Applies To


Product(s): Archer
Version(s): All Versions
Primary Deployment: On Premises/AWS Hosted/AWS SaaS

Description


While trying to generate a Package, it fails with the below error:
Package <package name> export failed. Please review the error log.
However, other packages work fine in the environment.

The below errors are found in the Archer logs:
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
    <ApplicationData>
        <TraceData>
            <DataItem>
                <TraceRecord Severity="Error" xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord">
                    <TraceIdentifier>Archer.Packaging</TraceIdentifier>
                    <UserId>183</UserId>
                    <Description>Unable to cast object of type 'ArcherTech.Common.Domain.SearchStatisticReport' to type 'ArcherTech.Common.Domain.SearchReport'.</Description>
                    <AppDomain>ArcherTech.JobFramework.Job.exe</AppDomain>
                    <Exception>
                        <ExceptionType>System.InvalidCastException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
                        <Message>Unable to cast object of type 'ArcherTech.Common.Domain.SearchStatisticReport' to type 'ArcherTech.Common.Domain.SearchReport'.</Message>
                        <Source>ArcherTech.Kernel</Source>
                        <StackTrace>
   at ArcherTech.Kernel.DataSource.Db.SearchReportDataSource.Get(Int32 reportId, SearchReportBase&amp; reportBase, Nullable`1&amp; filterId)
   at ArcherTech.Kernel.Brokers.SearchReportBroker.GetSearchReport(Int32 reportId, SearchReportBase&amp; searchReportBase, Nullable`1&amp; filterId)
   at ArcherTech.Kernel.Brokers.SearchReportBroker.Get(Int32 reportId, Boolean checkPermissioning)
   at ArcherTech.Kernel.Managers.SearchReportManager.Get(SessionContext sessionContext, Int32 reportId)
   at ArcherTech.Packaging.Actions.Generation.GeneratePackage.&lt;&gt;c__DisplayClass132.&lt;GenerateReports&gt;b__12d(GenerateContext context, ExecuteActions`1 ignored)
   at ArcherTech.Packaging.Actions.ActionExecutor`1.ActionExecutorLoop(IEnumerable`1 actions)
   at ArcherTech.Packaging.Actions.Generation.GeneratePackage.&lt;&gt;c__DisplayClassa.&lt;GetGenerateActions&gt;b__1(GenerateContext executeContext, ExecuteActions`1 executor)</StackTrace>
                    </Exception>
                </TraceRecord>
            </DataItem>
        </TraceData>
    </ApplicationData>
</E2ETraceEvent>

Cause


This error typically occurs due to a broken Report in one of the modules being packaged.

Resolution


Identify the broken Report and delete it using the following scripts. Follow the steps below:
Kindly note that necessary measures such as, but not limited to, taking a database backup should be done before executing any SQL queries or applying any changes in the Database.
  1. Perform a SQL backup of the Instance database.
  2. Run the below script to identify the broken Report:
    SELECT  rbt.report_base_id parentReportID
          , rbt.report_name parentReportName
          , rbt2.report_base_id childReportID
          , rbt2.report_name ChildStatsReportName
          , rt.report_type_desc ReportType
          , u.user_display_name CreatedBy
    FROM    dbo.tblReportBase rb
    JOIN    dbo.tblReportBaseTranslation rbt ON rbt.report_base_id = rb.report_base_id
    JOIN    dbo.tblReportBase rb2 ON rb.drill_in_report_base_id = rb2.report_base_id
    JOIN    dbo.tblReportBaseTranslation rbt2 ON rbt2.report_base_id = rb2.report_base_id
    JOIN    dbo.tblReportType rt ON rt.report_type_id = rb.report_type_id
    JOIN    dbo.tblUser u ON u.user_id = rb.create_login
    WHERE   rb.drill_in_report_base_id IS NOT NULL
            AND rb2.drill_in_report_base_id IS NOT NULL;
    
  3. Once the Report is identified, try deleting it manually.
  4. If the Report cannot be deleted in the UI, then delete the report using the following script. Make sure to replace the 0 in the first statement with the parentReportID from the query above.
    DECLARE @reportID INT = 0;
    
    DECLARE @reportBaseXML XML;
    DECLARE @userToken NVARCHAR(128);
    SET @reportBaseXML = '<ROOT><V a="' + CAST(@reportID AS VARCHAR(20)) + '"/></ROOT>';
    SELECT TOP ( 1 )
    @userToken = s.sessionId
    FROM dbo.tblSession s;
    
    BEGIN TRAN;
    BEGIN TRY
    
    EXEC dbo.usp_delete_report_base @userToken =@userToken , @reportBaseXML = @reportBaseXML;
    
    END TRY
    
    BEGIN CATCH
    ROLLBACK;
    SELECT 'Delete Failed';
    RETURN;
    END CATCH;
    
    
    SELECT 'Delete Successful'
    COMMIT;
  5. After the Report is deleted, try to generate the package. The package generation should work fine now.

Version history
Last update:
‎2024-09-21 06:40 AM
Updated by: