Dataset already exists error : Please help urgently

552 views
Skip to first unread message

Ilzemie

unread,
Aug 13, 2020, 8:34:57 AM8/13/20
to Google Ads Scripts Forum
Hi 

I've been using a Google Ads script to run Adgroup and Ad performance reports and inserting the raw data into Big Query in tables. The script that I've been using can be found here : 


The script uses the BigQuery advanced API to export the report data into BigQuery. The scripts have been working for a long time and then 2 days ago it just stopped working. 
I received the following error in the logs :

API call to bigquery.datasets.insert failed with error: Already Exists: Dataset name

This is not supposed to happen as I specified the following variables at the begining of the script:

// Truncate existing data, otherwise will append.
    TRUNCATE_EXISTING_DATASET: false,
    TRUNCATE_EXISTING_TABLES: true,
  
If then tried to change the BigQuery project id to rather use another project and then the script ran fine.... this is super weird. 
Why would the script not be working in the current BigQuery Project that it always worked on ? And why would it not see the truncate variable that is specified as 'false' ? 

I did not change anything in the scripts the past few days, so I don't understand why it just stopped working. 

Please advise :)

Kind Regards
Ilzemie 

Sigurd

unread,
Aug 13, 2020, 8:51:45 AM8/13/20
to Google Ads Scripts Forum
Cannot help with your issue.

however, why transfer reports via scripts rather than just schedule data transfer to bigQuery?

Google Ads Scripts Forum Advisor

unread,
Aug 13, 2020, 1:24:28 PM8/13/20
to adwords-scripts+apn2wqevinbbivog...@googlegroups.com, adwords...@googlegroups.com
Hi Ilzemie,

Can you please privately reply with your CID and script name so we can take a closer look at this?

Thanks,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5004Q23JuHO:ref

Robbert Smit

unread,
Sep 11, 2020, 5:46:51 AM9/11/20
to Google Ads Scripts Forum
I have the exact same issue as Ilzemie, any update on this?

Google Ads Scripts Forum Advisor

unread,
Sep 11, 2020, 6:36:23 AM9/11/20
to adwords...@googlegroups.com
Hi Robert,

Thank you for the reply.

So that our team can investigate your issue, could you provide the customer ID and the name of the script via Reply privately to author option?

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q23JuHO:ref

Robbert Smit

unread,
Sep 11, 2020, 7:30:53 AM9/11/20
to Google Ads Scripts Forum
Hi Ernie,

Thanks for the swift reply. It seems that I can't do that, the Reply to author button is greyed out for me (see screenshot below). When I hover over the button I get the message "You don't have permission to reply to the author of this group". 

1.PNG

Any other way to contact you?

Thanks in advance :)

Google Ads Scripts Forum Advisor

unread,
Sep 11, 2020, 1:50:23 PM9/11/20
to adwords...@googlegroups.com
Hi Robbert,

Can you please reach out to googleadsscr...@google.com and provide this forum link in your email for context?

Thanks,
Matt

Google Ads Scripts Forum Advisor

unread,
Sep 14, 2020, 5:52:25 AM9/14/20
to adwords...@googlegroups.com
Hi Robbert,

Thank you for providing the requested details privately.

Let me discuss the issue with our team and rest assured that we will update you on this forum thread.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q23JuHO:ref

Google Ads Scripts Forum Advisor

unread,
Sep 14, 2020, 9:02:16 AM9/14/20
to adwords...@googlegroups.com
Hello,

This case has been escalated to me.

Can you add a logging statement right before the return value of the "datasetExists" function, outputting the value of "datasetExists" (something like Logger.log(datasetExists))? It looks like for some reason the lookup to see whether or not the dataset exists may be returning false even though it does exist, so I want to confirm that suspicion before I look into that code more deeply to see what the issue might be.

Unfortunately, since I don't have access to your BigQuery instance (nor should I), we might need to go back and forth a few times to figure out the ultimate root cause.

Regards,
Mike, Google Ads Scripts Team

ref:_00D1U1174p._5004Q23JuHO:ref

Robbert Smit

unread,
Sep 14, 2020, 9:29:36 AM9/14/20
to Google Ads Scripts Forum
Hey Mike,

Thanks for your swift reply. I've added the logging statement here:

1.PNG

Running the logs again, I get the following output:

2.PNG

So it seems indeed that the lookup function returns false.

Let me know what's next :)

Google Ads Scripts Forum Advisor

unread,
Sep 14, 2020, 11:51:44 AM9/14/20
to adwords...@googlegroups.com
Hello,

Unfortunately, I'm not really familiar with the BigQuery API, since this support alias is primarily for Google Ads Scripts. I think that in your case, since you know the data set does exist, it should be safe to skip the checks in that method and just return true. The script is written in a generic way that should work regardless of state, but since you're in a known state you can use a shortcut.

Let me know if that helps. In the meanwhile, I'm still going to take a look at the solution itself to try to understand what might be going wrong.
Reply all
Reply to author
Forward
0 new messages