Script fails in new envorinment

440 views
Skip to first unread message

Luuk

unread,
Apr 13, 2022, 3:06:00 PM4/13/22
to Google Ads Scripts Forum
Hi,

We are running a script in CID 293-243-6676 and the script is named Zoekwoorduitsluitingen search.

To prepare for the deprecation of the old ads scripts environment I tried to enable the new environment and ran it as preview. The script doesn't have any issues when ran in the old ads script environment. After a minute and a bit I got an internal error:

Exception: Call to GoogleAdsService.Search failed: An internal error has occurred. at adsapp_compiled:18060:138 at adsapp_compiled:18071:9 at sa (adsapp_compiled:228:15) at Object.search (adsapp_compiled:236:20) at bI.search (adsapp_compiled:18186:36) at LH.search (adsapp_compiled:17763:19) at MH.search (adsapp_compiled:17858:20) at TH.search (adsapp_compiled:17950:19) at id (adsapp_compiled:1055:32) at id.next (<anonymous>)


I tried to see if we were using the AdsApp.search functionality, but we aren't. Since I couldn't relate any parts of the error message to the script I tried to narrow down the issue. The issue appears to be in the function addNegativeKeywordListToRelevantCampaigns (called on line 62).

Even more specific: I commented out lines 124, 125 and 126 and then ran the script again, this time without any errors.

The original code on these lines is:

while (campaignIterator.hasNext()) {
    campaignIterator.next().addNegativeKeywordList(negativeKeywordList);
  }

If I change that to this, the error still occurs:

while (campaignIterator.hasNext()) {
    campaignIterator.next();
    //.addNegativeKeywordList(negativeKeywordList);
  }


So I think something is wrong with the campaignIterator?

Best,
Luuk

Google Ads Scripts Forum Advisor

unread,
Apr 19, 2022, 1:03:00 AM4/19/22
to adwords...@googlegroups.com

Hello Luuk,

I’m James, a member of the Google Ads Scripts support team. Thank you for reaching out to us.

I tried replicating the error on my end using the new script experience but I wasn’t able to encounter the same issue of yours. However, `internal errors` are usually transient in nature and retrying of execution or recreating the script should work. Having said that, can you please try to re-execute or recreate the script and let me know if the issue will persist?

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2zYI:ref
Message has been deleted

Luuk

unread,
Apr 19, 2022, 5:24:38 AM4/19/22
to Google Ads Scripts Forum
Hi James,

I ran the script again but the same issue showed up. Then I copied the code, created a new script and ran it: same error shows up. The full error is below, but it doesn't give me any useful information for debugging:

19-4-2022 11:21:54    Getting data from speadsheet
19-4-2022 11:21:55    Started processing verticals in selected account.
19-4-2022 11:22:20    Exception: Call to GoogleAdsService.Search failed: An internal error has occurred. at adsapp_compiled:18060:138 at adsapp_compiled:18071:9 at sa (adsapp_compiled:228:15) at Object.search (adsapp_compiled:236:20) at bI.search (adsapp_compiled:18186:36) at LH.search (adsapp_compiled:17763:19) at MH.search (adsapp_compiled:17858:20) at TH.search (adsapp_compiled:17950:19) at id (adsapp_compiled:1055:32) at id.next (<anonymous>)

Best,
Luuk
Op dinsdag 19 april 2022 om 07:03:00 UTC+2 schreef adsscripts:

Google Ads Scripts Forum Advisor

unread,
Apr 21, 2022, 2:19:52 AM4/21/22
to adwords...@googlegroups.com
Hi Luuk,

I work along with James. Allow me to assist you in this.

I've tried the script in question on my end, and can confirm that it works fine (please see attached file). I also checked your script history and it seems that the reported issue does not occur anymore. With this, I would recommend to monitor your script history once again, then ping us back if the issue occurs once more, so we could check.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2zYI:ref
Av4WGLyMfzWcywq.png

Luuk

unread,
Apr 21, 2022, 3:51:26 AM4/21/22
to Google Ads Scripts Forum
Hi,

I have added a two logging lines to see where the issue appears. The script gets a few verticals from a spreadsheet and should process each vertical in the accounts listed in the accountIds array. Therefore we are looping over the verticals and per vertical we process each account.

I have added a console log at the beginning of the vertical loop (line 37) so the vertical that is being processed will be logged. I have also added a console log on line 49 inside the forEach loop that loops over the accounts. The expected output would be:

Vertical A
Account 1
Account 2
Account 3
Account 4

And then go on to the next vertical with each account:

Account B
Account 1
Account 2
Account 3
Account 4

But the actual output is:

Vertical A
Account 1
Vertical B
Account 1

Previously this worked fine in the old script environment. Now the order is changed and the script throws an internal error.

If you look at the script history and search for this script, you will also see the error. For example look at the run from 21 apr. 2022 05:20:45 (GMT+02:00) Nederland-tijd. You will see 462 succeeded and 3 log lines. The third log line shows the internal error.

Best,
Luuk



Op donderdag 21 april 2022 om 08:19:52 UTC+2 schreef adsscripts:
old script runs fine.png
Naamloos.png

Google Ads Scripts Forum Advisor

unread,
Apr 28, 2022, 5:16:28 AM4/28/22
to adwords...@googlegroups.com

Hello Luuk,

Can you please share with us the shareable link of the involved spreadsheet within your script named `Zoekwoorduitsluitingen search` via `Reply privately to author` option so that we can include this in our investigation? 

If the said option is unavailable on your end, then you may send the requested item through this alias <googleadsscr...@google.com> instead.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2zYI:ref

Luuk

unread,
Apr 28, 2022, 6:08:53 AM4/28/22
to Google Ads Scripts Forum
Hi,

I have added the email address you mentioned to the spreadsheet. You will find the invitation in the inbox or you can use the url in the script to get access to it. Please let me know if you need any additional information for the investigation.

Op donderdag 28 april 2022 om 11:16:28 UTC+2 schreef adsscripts:

Hello Luuk,

Can you please share with us the shareable link of the involved spreadsheet within your script named `Zoekwoorduitsluitingen search` via `Reply privately to author` option so that we can include this in our investigation? 

If the said option is unavailable on your end, then you may send the requested item through this alias <googleadsscripts-support@google.com> instead.

Regards,

Google Ads Scripts Forum Advisor

unread,
May 3, 2022, 1:18:29 AM5/3/22
to adwords...@googlegroups.com
Hi Luuk,

Thank you for getting back to us. However, I'm afraid that we don't have an access to the email alias where you've provided the spreadsheet. With this, we would recommend providing the shareable link of the spreadsheet instead. You may get it by navigating to the spreadsheet, click the Share button on upper right corner, then click the "copy link" under the Get link screen. Also, kindly make sure the "Anyone with this link" option were set to viewer or editor.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2zYI:ref

Luuk

unread,
May 3, 2022, 2:59:09 AM5/3/22
to Google Ads Scripts Forum
Hi,

Since I'm unable to use the "Reply privately to author" options, I have now shared the spreadsheet with a view permissions: https://docs.google.com/spreadsheets/d/1cLKD_DzqVmoSjLpOBXgHmd4KLAzsoOSu6Q2KmBIHERU/.

Op dinsdag 3 mei 2022 om 07:18:29 UTC+2 schreef adsscripts:

Google Ads Scripts Forum Advisor

unread,
May 5, 2022, 3:41:31 AM5/5/22
to adwords...@googlegroups.com
Hi Luuk,

I've updated your script following the Ads Manager Scripts guide. Please see attached file.
Zoekwoorduitsluitingen search - UPDATEDv1.txt

Luuk

unread,
May 6, 2022, 10:03:21 AM5/6/22
to Google Ads Scripts Forum
Hi,

Thanks I have used your updated script and copied over the changes. However, when enabling the new version. It still gives me an internal error.

Exception: Call to GoogleAdsService.Search failed: An internal error has occurred. at adsapp_compiled:18069:138 at adsapp_compiled:18080:9 at sa (adsapp_compiled:228:15) at Object.search (adsapp_compiled:236:20) at cI.search (adsapp_compiled:18195:36) at MH.search (adsapp_compiled:17772:19) at NH.search (adsapp_compiled:17867:20) at UH.search (adsapp_compiled:17959:19) at hd (adsapp_compiled:1055:32) at hd.next (<anonymous>)

The issue still appears to be in the function addNegativeKeywordListToRelevantCampaigns (now called on line 74 for each account). If I comment out that line, it runs just fine. Unfortunately I don't see anything strange in the code itself so I do think it's an internal ads script issue, but solving that is out of my control. Could you confirm this is an internal ads script issue?

Best,
Luuk

Op donderdag 5 mei 2022 om 09:41:31 UTC+2 schreef adsscripts:

Google Ads Scripts Forum Advisor

unread,
May 13, 2022, 1:12:47 AM5/13/22
to adwords...@googlegroups.com
Hi Luuk,

It's odd that I wasn't able to reproduce the issue on my end upon previewing the updated script. Would it be possible for you to provide a screenshot of the issue as well? Once provided, I'll sharing this to a wider team for further investigation.

Luuk

unread,
May 13, 2022, 1:23:07 AM5/13/22
to Google Ads Scripts Forum
Hi,

I understand that debugging will be hard if you aren't able to reproduce the issue. Attached you will find a screenshot of the issue.

Running the script in Firefox (instead of Chrome) doesn't help and gives the same error. Looking at the error message I didn't really think changing to Firefox would solve the issue, but trying was the least I could do. To me it really looks like an internal Ads script issue because of the "compiled" messages in the error message.

I hope the screenshot helps. If you would like to schedule a meeting so I can share my full screen with you at the time of running the script, please let me know.

Best,
Luuk

Op vrijdag 13 mei 2022 om 07:12:47 UTC+2 schreef adsscripts:
Script fails.png

Google Ads Scripts Forum Advisor

unread,
May 16, 2022, 6:46:01 AM5/16/22
to adwords...@googlegroups.com
Hi Luuk,

I checked the execution history of the script in question, and find that it finally work fine. Could you confirm it on your end? Also, It appears that I've lost an access to the spreadsheet being used in the script. Could you please provide the shareable link once again?

Luuk

unread,
May 17, 2022, 8:40:49 AM5/17/22
to Google Ads Scripts Forum
Hi,


The reason the script works fine in the execution history is because I set it back to use the old script environment after testing and sending you the screenshot. If I would keep it on the new environment, the script fails, but since we want to run this script daily, we can't keep it on the new environment. To show you the issue also appears while running it in live mode, I enabled the new ads script environment, ran the script and took a screenshot of the execution history. Attached you will find the screenshot. It's the script execution of 17 May 2022, 14:34:30 (time in GMT+2 / CEST). As you can see it still fails.

I have set the script back to the old environment now, since we want to run this script every hour. Please let me what you need from me to debug the issue on your end :)

Best,
Luuk
Op maandag 16 mei 2022 om 12:46:01 UTC+2 schreef adsscripts:
Script still fails - even in live mode.png

Google Ads Scripts Forum Advisor

unread,
May 19, 2022, 3:50:42 AM5/19/22
to adwords...@googlegroups.com
Hi Luuk,

Thank you for pointing this out.

I've tried once again the updated script, and I'm now able to reproduce the reported error on my end which is odd that I didn't encounter it before. Let me share this to the rest of the team for further investigation. In the meantime, you may continue to execute your script on legacy version.

Luuk

unread,
Jul 20, 2022, 2:23:53 AM7/20/22
to Google Ads Scripts Forum
Hi Teejay,

Do you have any updates about this issue?

Furthermore I opened this other issue as well, but I didn't see anyone from Google there yet: https://groups.google.com/g/adwords-scripts/c/IYkAEHtSPqc/m/q7uw6IoGAgAJ. I'm not sure if you are currently busy with all open topics or that the team might have missed it, so that's why I'm mentioning it in here as well :)

Best,
Luuk

Op donderdag 19 mei 2022 om 09:50:42 UTC+2 schreef adsscripts:

Google Ads Scripts Forum Advisor

unread,
Jul 20, 2022, 3:21:56 AM7/20/22
to adwords...@googlegroups.com

Hi Luuk,

 

This is Yasmin, I'm a colleague of Teejay in the Google Ads Scripts team.

 

It appears that there aren't any updates yet, but I'll be sure to request for a follow up from the team with regard to this issue. We'll keep you posted once we hear anything.

 

That being said, it appears that your other concern did not appear in our tracker. We will check the forum thread and respond to you there. Thank you so much for flagging this.

 

Regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2zYI:ref

Luuk

unread,
Aug 16, 2022, 7:48:20 AM8/16/22
to Google Ads Scripts Forum
Hi,

It appears that this script got somewhat stable. It doesn't throw the  adsapp_compiled error anymore. However, now the logging still doesn't make sense. It doesn't log all required log lines, so I'm not sure if everything is being processed as planned.

In the script we are processing a number of business verticals (currently 12) in a number of accounts (currently 4). Each vertical should be process in each account. The outer loop loops over the verticals. In there, we loop over the accounts and make some adjustments to the keyword exclusion lists. For each vertical that is processed we want to log the name of the vertical. After that, the script jumps into the loop of processing the 4 accounts. In that loop we log the account currently being processed and the name of the vertical. So you will get something like:

>>>>> Current vertical: Vertical=A
Current account: account_1 for vertical: Vertical=A
Current account: account_2 for vertical: Vertical=A
Current account: account_3 for vertical: Vertical=A
Current account: account_4 for vertical: Vertical=A

And then it goes on to the next vertical, using the same idea for logging, but now the vertical is B instead of A.

This works perfectly fine in the old experience, but in the new experience, some lines don't get logged. Attached you fill find logs when running the script in the old and new environment. As you can see, the new log has fewer lines. Furthermore, the new log only contains 8 lines with the text >>>>> Current vertical: but this should be 12 lines since we have 12 verticals. It also just contains 28 lines with the text: Current account: but this should be 48 lines, since we log a line with that text in each vertical and we have 12 verticals * 4 accounts = 48 log lines.

Could you please forward this to the team? The CID and script name are unchanged from the first message in this thread.

Kind regards,
Luuk

Op woensdag 20 juli 2022 om 09:21:56 UTC+2 schreef adsscripts:
Old.txt
new.txt

Google Ads Scripts Forum Advisor

unread,
Aug 17, 2022, 3:35:06 AM8/17/22
to adwords...@googlegroups.com

Hello Luuk,

Thank you for getting back to us. I’ll also raise this new issue of yours to our internal team for further investigation. I assure that someone from our team will get back to you with an update.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2zYI:ref

Luuk

unread,
Oct 12, 2022, 1:59:33 AM10/12/22
to Google Ads Scripts Forum
Hi,

Since we are required to move to the new ads script experience by the end of this month, I was wondering if would be able to give an update on this issue? Do you expect any updates before the end of this month?

Best,
Luuk

Op woensdag 17 augustus 2022 om 09:35:06 UTC+2 schreef adsscripts:

Google Ads Scripts Forum Advisor

unread,
Oct 12, 2022, 4:14:55 AM10/12/22
to adwords...@googlegroups.com
Hi Luuk,

In this regard, the team has yet to conclude on an update of your concern. Thus, your continued patience is highly appreciated. Rest assured that the team is meticulously observing and investigating the New Script experience issues.

Best Regards,
Google Logo
Angel Maia
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2zYI:ref

Luuk

unread,
Oct 26, 2022, 2:20:35 AM10/26/22
to Google Ads Scripts Forum
Hi there,

I understand that we need patience, but there is only four working days left before the migration is expected to take place. I really would like to express my support for this idea ( https://groups.google.com/g/adwords-scripts/c/CyehoVQF8ys ) to extend the migration period. As with all software, bugs appear, but since many of these bugs appeared on the Google Ads side, we weren't able to solve them ourselves because our code was actually valid.

I would really like to express the urge to extend the migration with at least 1 month so your team is able to pick up the oldest / last support tickets regarding to the migration.

Best,
Luuk

Op woensdag 12 oktober 2022 om 10:14:55 UTC+2 schreef adsscripts:

Google Ads Scripts Forum Advisor

unread,
Oct 26, 2022, 6:40:19 AM10/26/22
to adwords...@googlegroups.com

Hello Luuk,

I believe that our team has already considered having extensions to avoid disruption for our advertisers during the holiday season. The migration will be paused from early November until the end of the year and will pick up again in early January. Advertisers are advised to manually migrate their scripts before then if they do not want them to be automatically migrated and potentially paused. For the official announcements regarding this, I suggest that you keep an eye to our blog. As for the existing issue, rest assured that we will do everything in our abilities to resolve the pending issues in our end.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2a2zYI:ref

Aarthi Ilangovan

unread,
Oct 27, 2022, 8:20:52 AM10/27/22
to Google Ads Scripts Forum
Hi James, 

Does this mean our old scripts will continue to work without migration as usual until end of this year. 
And is there already an official announcement regarding this? 

Thanks, 
Aarthi 

Reply all
Reply to author
Forward
0 new messages