Report XXXXXXXX must be completed before downloading. It is currently: FAILED

166 views
Skip to first unread message

dlef....@gmail.com

unread,
Oct 11, 2016, 8:38:25 AM10/11/16
to Google's DoubleClick for Publishers API Forum
Hello all !

First, i'm french so sorry for my bad english.

I searched for a solution on this forum :
Each time it's recommended to "reducing the date range on your report, or refactoring it to use fewer dimensions".

But my report is simple ! And there are very few result with the DFP reports tools.
Based on this sample :
        // Create statement to filter
       
StatementBuilder statementBuilder = new StatementBuilder().where(""
               
+ "where (((ad_unit_id in (50029494) "
               
+ "and custom_targeting_value_id in (141830612934)) "
               
+ "and device_category_id in (30001)) "
               
+ "and placement_name like 'WEB_%')");


       
// Create report query.
       
ReportQuery reportQuery = new ReportQuery();
        reportQuery
.setDimensions(new Dimension[]{
           
Dimension.PLACEMENT_ID,
           
Dimension.CUSTOM_CRITERIA,
           
Dimension.DATE
       
});
        reportQuery
.setColumns(new Column[]{
           
Column.AD_SERVER_IMPRESSIONS
       
});


       
// Set the filter statement.
        reportQuery
.setStatement(statementBuilder.toStatement());


       
// Set the dynamic date range type or a custom start and end date.
        reportQuery
.setDateRangeType(DateRangeType.YESTERDAY);


       
// Create report job.
       
ReportJob reportJob = new ReportJob();
        reportJob
.setReportQuery(reportQuery);


       
// Run report job.
        reportJob
= reportService.runReportJob(reportJob);


       
// Create report downloader.
       
ReportDownloader reportDownloader = new ReportDownloader(reportService, reportJob.getId());


       
// Wait for the report to be ready.
        reportDownloader
.waitForReportReady();


       
// Change to your file location.
       
File file = File.createTempFile("inventory-report-", ".csv.gz");


       
System.out.printf("Downloading report to %s ...", file.toString());


       
// Download the report.
       
ReportDownloadOptions options = new ReportDownloadOptions();
        options
.setExportFormat(ExportFormat.CSV_DUMP);
        options
.setUseGzipCompression(true);
        URL url
= reportDownloader.getDownloadUrl(options);
       
Resources.asByteSource(url).copyTo(Files.asByteSink(file));


       
System.out.println("done.");
And i get :
Report XXXXXXX must be completed before downloading. It is currently: FAILED

What is the problem ? My network id is 49926454.

Thanks in advance,

Tesfamichael Hailegeorgis(DFP API Team)

unread,
Oct 11, 2016, 10:08:22 AM10/11/16
to Google's DoubleClick for Publishers API Forum
Hi,

No worries :)

A couple of points to understand what is going on in this particular scenario:
  1. I am curious if you're able to recreate this same report on the UI. This will help us narrow down the problem if it is API specific or not. You can fetch the device category information from the Device_Category PQL table. Please try to recreate the report on the UI and see if you can retrieve any data. If you did, please share the screenshot of the filter statement you are using.
  2. There is a syntax issue for the filter statement in the API report. The correct syntax should be something like this in Java : .where("AD_UNIT_ID IN (50029494) AND CUSTOM_TARGETING_VALUE_ID IN (141830612934) AND DEVICE_CATEGORY_ID IN (30001) AND PLACEMENT_NAME = 'WEB_%'"); However, this filter has no syntax issues but it doesn't seem to retrieve any data. It looks like there is no data matching this filter.
So, you can include the dimension PLACEMENT_NAME in the API report breakdown and do a post-processing on your end to filter the placement names matching the pattern 'WEB_%' that you're interested in. Here is the report breakdown in Java for this option:

     Dimension.PLACEMENT_ID,Dimension.PLACEMENT_NAME,
             Dimension.CUSTOM_CRITERIA,
             Dimension.DATE

           Column.AD_SERVER_IMPRESSIONS

        .where("AD_UNIT_ID IN (50029494) AND CUSTOM_TARGETING_VALUE_ID IN (141830612934) AND DEVICE_CATEGORY_ID IN (30001)");

Please feel free to let me know how this goes.

Thanks,
Tesfamichael Hailegeorgis, DFP API Team
Message has been deleted

dlef....@gmail.com

unread,
Oct 12, 2016, 4:46:09 AM10/12/16
to Google's DoubleClick for Publishers API Forum
Thanks for the answer,

The same report works on my DFP UI and have results.
I replaced the old .where(...) by : .where("AD_UNIT_ID IN (50029494) AND CUSTOM_TARGETING_VALUE_ID IN (141830612934) AND DEVICE_CATEGORY_ID IN (30001) AND PLACEMENT_NAME = 'WEB_%'");
(Don't know why my query had multiple useless parenthesis !)
And my reports have no results with API...

After, i removed the PLACEMENT_NAME filter on the query and all it's ok : report generation and downloading. Except i have WEB and other Placements.

Then, i tried with :
PLACEMENT_NAME = 'WEB_%' -> Works but no data in my downloaded report.
PLACEMENT_NAME LIKE \"WEB_%\" -> java.lang.NullPointerException at com.sun.org.apache.xerces.internal.dom.ElementNSImpl.getPrefix(ElementNSImpl.java:271)
PLACEMENT_NAME LIKE \"WEB%\" -> Unable to parse query (now, i suspect the '_' as the source of the problem)
PLACEMENT_NAME LIKE 'WEB%' -> Works but no data in my downloaded report (so is not the '_').
PLACEMENT_NAME = 'WEB%' -> Works but no data in my downloaded report.

Is there no possibilities to filter with the Placement name ?

Because my original sample is just a isolation problem sample. After, i will have more results because of an other date range.

Thanks,

Tesfamichael Hailegeorgis(DFP API Team)

unread,
Oct 12, 2016, 11:15:11 AM10/12/16
to Google's DoubleClick for Publishers API Forum
Hi,

I am not able to retrieve data using the same filter statement and report parameter for the UI report as well.  As I mentioned, it sounds like this particular query doesn't match any data in your network. Can you please share the screenshot of the UI report breakdown along with the UI filter that gives you a report data?

That being said, string/text filtering with the LIKE operation is not supported via the API. Please try to use the suggested workaround in my response on this thread. Do a post-processing on your end to filter the placements that have the pattern 'WEB%' in their names.

Thanks,
Tesfamichael Hailegeorgis, DFP API Team

dlef....@gmail.com

unread,
Nov 3, 2016, 9:50:56 AM11/3/16
to Google's DoubleClick for Publishers API Forum
Hi thanks for the answer,

Problem solved when i removed LIKE operation. I used a post-processing instead.

But, where we can see which is compatible and which is not with the report API ? (except ask on forum)

Tesfamichael Hailegeorgis(DFP API Team)

unread,
Nov 3, 2016, 10:59:13 AM11/3/16
to Google's DoubleClick for Publishers API Forum
Hi,

Great!

Yeah, you can post here if you come across a similar issue in the future and we'll take a look from our end.

Thanks,
Tesfamichael Hailegeorgis, DFP API Team
Reply all
Reply to author
Forward
0 new messages