Google Apps Script Error: Service using too much computer time for one day











up vote
0
down vote

favorite












I wrote a small script that grabs a range of four cells from one sheet and copies that range to the last row (about 1K rows down) of a different sheet in the same file. This script copies and pastes three times in total, it's not complicated. There is a daily trigger attached, and I'm getting regular, but not constant, failures showing the "too much computer time exception."



How do I tell which quota my script is exceeding? I know there is the 6 hour per day quota, but assuming the day resets around midnight in my time zone, I've only used about one hour by the time this trigger fires. Also, if it is due to the 6 hours/day limit, why do other scripts that I have triggering around the same time and very soon after this trigger execute without any problems? If I have exceeded the quota, shouldn't all other scripts be disabled until the quota resets?



The script runs manually in 5 secs, so it shouldn't be hitting the 30 min max either. What can I do to troubleshoot?



Update added actual script below:



function copyrevtotal() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var adw = ss.getSheetByName("adw");
var revenue = ss.getSheetByName("revenue");
var bing = ss.getSheetByName("bing");
var yahoo = ss.getSheetByName("yahoo");

revenue.getRange("B8:E8").copyTo(adw.getRange(adw.getLastRow()+0,6),
{contentsOnly:true});
revenue.getRange("B3:E3").copyTo(bing.getRange(bing.getLastRow()+0,6),
{contentsOnly:true});
revenue.getRange("B15:E15").copyTo(yahoo.getRange(yahoo.getLastRow()+0,6),
{contentsOnly:true});

}









share|improve this question




























    up vote
    0
    down vote

    favorite












    I wrote a small script that grabs a range of four cells from one sheet and copies that range to the last row (about 1K rows down) of a different sheet in the same file. This script copies and pastes three times in total, it's not complicated. There is a daily trigger attached, and I'm getting regular, but not constant, failures showing the "too much computer time exception."



    How do I tell which quota my script is exceeding? I know there is the 6 hour per day quota, but assuming the day resets around midnight in my time zone, I've only used about one hour by the time this trigger fires. Also, if it is due to the 6 hours/day limit, why do other scripts that I have triggering around the same time and very soon after this trigger execute without any problems? If I have exceeded the quota, shouldn't all other scripts be disabled until the quota resets?



    The script runs manually in 5 secs, so it shouldn't be hitting the 30 min max either. What can I do to troubleshoot?



    Update added actual script below:



    function copyrevtotal() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var adw = ss.getSheetByName("adw");
    var revenue = ss.getSheetByName("revenue");
    var bing = ss.getSheetByName("bing");
    var yahoo = ss.getSheetByName("yahoo");

    revenue.getRange("B8:E8").copyTo(adw.getRange(adw.getLastRow()+0,6),
    {contentsOnly:true});
    revenue.getRange("B3:E3").copyTo(bing.getRange(bing.getLastRow()+0,6),
    {contentsOnly:true});
    revenue.getRange("B15:E15").copyTo(yahoo.getRange(yahoo.getLastRow()+0,6),
    {contentsOnly:true});

    }









    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I wrote a small script that grabs a range of four cells from one sheet and copies that range to the last row (about 1K rows down) of a different sheet in the same file. This script copies and pastes three times in total, it's not complicated. There is a daily trigger attached, and I'm getting regular, but not constant, failures showing the "too much computer time exception."



      How do I tell which quota my script is exceeding? I know there is the 6 hour per day quota, but assuming the day resets around midnight in my time zone, I've only used about one hour by the time this trigger fires. Also, if it is due to the 6 hours/day limit, why do other scripts that I have triggering around the same time and very soon after this trigger execute without any problems? If I have exceeded the quota, shouldn't all other scripts be disabled until the quota resets?



      The script runs manually in 5 secs, so it shouldn't be hitting the 30 min max either. What can I do to troubleshoot?



      Update added actual script below:



      function copyrevtotal() {
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var adw = ss.getSheetByName("adw");
      var revenue = ss.getSheetByName("revenue");
      var bing = ss.getSheetByName("bing");
      var yahoo = ss.getSheetByName("yahoo");

      revenue.getRange("B8:E8").copyTo(adw.getRange(adw.getLastRow()+0,6),
      {contentsOnly:true});
      revenue.getRange("B3:E3").copyTo(bing.getRange(bing.getLastRow()+0,6),
      {contentsOnly:true});
      revenue.getRange("B15:E15").copyTo(yahoo.getRange(yahoo.getLastRow()+0,6),
      {contentsOnly:true});

      }









      share|improve this question















      I wrote a small script that grabs a range of four cells from one sheet and copies that range to the last row (about 1K rows down) of a different sheet in the same file. This script copies and pastes three times in total, it's not complicated. There is a daily trigger attached, and I'm getting regular, but not constant, failures showing the "too much computer time exception."



      How do I tell which quota my script is exceeding? I know there is the 6 hour per day quota, but assuming the day resets around midnight in my time zone, I've only used about one hour by the time this trigger fires. Also, if it is due to the 6 hours/day limit, why do other scripts that I have triggering around the same time and very soon after this trigger execute without any problems? If I have exceeded the quota, shouldn't all other scripts be disabled until the quota resets?



      The script runs manually in 5 secs, so it shouldn't be hitting the 30 min max either. What can I do to troubleshoot?



      Update added actual script below:



      function copyrevtotal() {
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var adw = ss.getSheetByName("adw");
      var revenue = ss.getSheetByName("revenue");
      var bing = ss.getSheetByName("bing");
      var yahoo = ss.getSheetByName("yahoo");

      revenue.getRange("B8:E8").copyTo(adw.getRange(adw.getLastRow()+0,6),
      {contentsOnly:true});
      revenue.getRange("B3:E3").copyTo(bing.getRange(bing.getLastRow()+0,6),
      {contentsOnly:true});
      revenue.getRange("B15:E15").copyTo(yahoo.getRange(yahoo.getLastRow()+0,6),
      {contentsOnly:true});

      }






      google-apps-script google-sheets google-sheets-api






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 28 at 20:35

























      asked Nov 20 at 14:52









      Evan Levy

      11




      11
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          The exception message should be telling you which quota or limitation you reached. That exception is not limited to only reaching the quota. It may also be possible that you are reaching a certain limit. You can check the table that lists the hard limitations. For example:




          Script runtime:





          • Consumer (e.g., gmail.com): 6 min / execution


          • G Suite Business / Enterprise / EDU: 30 min / execution


          Custom function runtime:





          • Consumer (e.g., gmail.com): 30 sec / execution


          • G Suite Business / Enterprise / EDU: 30 sec / execution







          share|improve this answer





















          • The documentation isn't clear here, which is why I don't know what the problem is. The exception is "Service using too much computer time for one day." The documentation points me to "triggers total runtime", which says 6 hours per day. However, I'm pretty sure I haven't used 6 hrs when this script runs (early morning) and there are other scripts running at the same time that don't fail, which makes me wonder how only one script could exceed a daily quota.
            – Evan Levy
            Nov 26 at 15:50










          • Time is not the only factor for exception. The current limitations guide states that the usage of triggers per script per user is limited to 20 (20 triggers/user/script). Perhaps this script which throws the exception has more than that?
            – Jacque
            Nov 26 at 22:52










          • @jaque I added the actual script to the original post. It has only one trigger, time based to run once every day.
            – Evan Levy
            Nov 28 at 20:36











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53395635%2fgoogle-apps-script-error-service-using-too-much-computer-time-for-one-day%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          The exception message should be telling you which quota or limitation you reached. That exception is not limited to only reaching the quota. It may also be possible that you are reaching a certain limit. You can check the table that lists the hard limitations. For example:




          Script runtime:





          • Consumer (e.g., gmail.com): 6 min / execution


          • G Suite Business / Enterprise / EDU: 30 min / execution


          Custom function runtime:





          • Consumer (e.g., gmail.com): 30 sec / execution


          • G Suite Business / Enterprise / EDU: 30 sec / execution







          share|improve this answer





















          • The documentation isn't clear here, which is why I don't know what the problem is. The exception is "Service using too much computer time for one day." The documentation points me to "triggers total runtime", which says 6 hours per day. However, I'm pretty sure I haven't used 6 hrs when this script runs (early morning) and there are other scripts running at the same time that don't fail, which makes me wonder how only one script could exceed a daily quota.
            – Evan Levy
            Nov 26 at 15:50










          • Time is not the only factor for exception. The current limitations guide states that the usage of triggers per script per user is limited to 20 (20 triggers/user/script). Perhaps this script which throws the exception has more than that?
            – Jacque
            Nov 26 at 22:52










          • @jaque I added the actual script to the original post. It has only one trigger, time based to run once every day.
            – Evan Levy
            Nov 28 at 20:36















          up vote
          0
          down vote













          The exception message should be telling you which quota or limitation you reached. That exception is not limited to only reaching the quota. It may also be possible that you are reaching a certain limit. You can check the table that lists the hard limitations. For example:




          Script runtime:





          • Consumer (e.g., gmail.com): 6 min / execution


          • G Suite Business / Enterprise / EDU: 30 min / execution


          Custom function runtime:





          • Consumer (e.g., gmail.com): 30 sec / execution


          • G Suite Business / Enterprise / EDU: 30 sec / execution







          share|improve this answer





















          • The documentation isn't clear here, which is why I don't know what the problem is. The exception is "Service using too much computer time for one day." The documentation points me to "triggers total runtime", which says 6 hours per day. However, I'm pretty sure I haven't used 6 hrs when this script runs (early morning) and there are other scripts running at the same time that don't fail, which makes me wonder how only one script could exceed a daily quota.
            – Evan Levy
            Nov 26 at 15:50










          • Time is not the only factor for exception. The current limitations guide states that the usage of triggers per script per user is limited to 20 (20 triggers/user/script). Perhaps this script which throws the exception has more than that?
            – Jacque
            Nov 26 at 22:52










          • @jaque I added the actual script to the original post. It has only one trigger, time based to run once every day.
            – Evan Levy
            Nov 28 at 20:36













          up vote
          0
          down vote










          up vote
          0
          down vote









          The exception message should be telling you which quota or limitation you reached. That exception is not limited to only reaching the quota. It may also be possible that you are reaching a certain limit. You can check the table that lists the hard limitations. For example:




          Script runtime:





          • Consumer (e.g., gmail.com): 6 min / execution


          • G Suite Business / Enterprise / EDU: 30 min / execution


          Custom function runtime:





          • Consumer (e.g., gmail.com): 30 sec / execution


          • G Suite Business / Enterprise / EDU: 30 sec / execution







          share|improve this answer












          The exception message should be telling you which quota or limitation you reached. That exception is not limited to only reaching the quota. It may also be possible that you are reaching a certain limit. You can check the table that lists the hard limitations. For example:




          Script runtime:





          • Consumer (e.g., gmail.com): 6 min / execution


          • G Suite Business / Enterprise / EDU: 30 min / execution


          Custom function runtime:





          • Consumer (e.g., gmail.com): 30 sec / execution


          • G Suite Business / Enterprise / EDU: 30 sec / execution








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 at 5:14









          Jacque

          2736




          2736












          • The documentation isn't clear here, which is why I don't know what the problem is. The exception is "Service using too much computer time for one day." The documentation points me to "triggers total runtime", which says 6 hours per day. However, I'm pretty sure I haven't used 6 hrs when this script runs (early morning) and there are other scripts running at the same time that don't fail, which makes me wonder how only one script could exceed a daily quota.
            – Evan Levy
            Nov 26 at 15:50










          • Time is not the only factor for exception. The current limitations guide states that the usage of triggers per script per user is limited to 20 (20 triggers/user/script). Perhaps this script which throws the exception has more than that?
            – Jacque
            Nov 26 at 22:52










          • @jaque I added the actual script to the original post. It has only one trigger, time based to run once every day.
            – Evan Levy
            Nov 28 at 20:36


















          • The documentation isn't clear here, which is why I don't know what the problem is. The exception is "Service using too much computer time for one day." The documentation points me to "triggers total runtime", which says 6 hours per day. However, I'm pretty sure I haven't used 6 hrs when this script runs (early morning) and there are other scripts running at the same time that don't fail, which makes me wonder how only one script could exceed a daily quota.
            – Evan Levy
            Nov 26 at 15:50










          • Time is not the only factor for exception. The current limitations guide states that the usage of triggers per script per user is limited to 20 (20 triggers/user/script). Perhaps this script which throws the exception has more than that?
            – Jacque
            Nov 26 at 22:52










          • @jaque I added the actual script to the original post. It has only one trigger, time based to run once every day.
            – Evan Levy
            Nov 28 at 20:36
















          The documentation isn't clear here, which is why I don't know what the problem is. The exception is "Service using too much computer time for one day." The documentation points me to "triggers total runtime", which says 6 hours per day. However, I'm pretty sure I haven't used 6 hrs when this script runs (early morning) and there are other scripts running at the same time that don't fail, which makes me wonder how only one script could exceed a daily quota.
          – Evan Levy
          Nov 26 at 15:50




          The documentation isn't clear here, which is why I don't know what the problem is. The exception is "Service using too much computer time for one day." The documentation points me to "triggers total runtime", which says 6 hours per day. However, I'm pretty sure I haven't used 6 hrs when this script runs (early morning) and there are other scripts running at the same time that don't fail, which makes me wonder how only one script could exceed a daily quota.
          – Evan Levy
          Nov 26 at 15:50












          Time is not the only factor for exception. The current limitations guide states that the usage of triggers per script per user is limited to 20 (20 triggers/user/script). Perhaps this script which throws the exception has more than that?
          – Jacque
          Nov 26 at 22:52




          Time is not the only factor for exception. The current limitations guide states that the usage of triggers per script per user is limited to 20 (20 triggers/user/script). Perhaps this script which throws the exception has more than that?
          – Jacque
          Nov 26 at 22:52












          @jaque I added the actual script to the original post. It has only one trigger, time based to run once every day.
          – Evan Levy
          Nov 28 at 20:36




          @jaque I added the actual script to the original post. It has only one trigger, time based to run once every day.
          – Evan Levy
          Nov 28 at 20:36


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53395635%2fgoogle-apps-script-error-service-using-too-much-computer-time-for-one-day%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wiesbaden

          Marschland

          Dieringhausen