Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Script Deploy as Web App stuck at Fetching Data

I am working on a internal app for my company in G Suite. I have a modal dialog that I am using in the spreadsheet app. I can not find a way to do this on Drive for mobile so I decided to Deploy as a web app. I have never used this feature in app script so I decided to set up a new project to mess around with before I applied it to my active project. I have two files in the project; Code.gs

    function doGet(e) {
  return HtmlService
    .createHtmlOutputFromFile('mainPage')
    .setSandboxMode(HtmlService.SandboxMode.IFRAME);
}

and mainPage.html

<!DOCTYPE html>

<head>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
</head>

<body>
    <!-- Reference: http://getbootstrap.com/javascript/#tabs -->
    <div role="tabpanel">
        <!-- Nav tabs -->
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a role="tab" data-toggle="tab" aria-controls="home" href="#home">Home</a>
            </li>
            <li role="presentation"><a role="tab" data-toggle="tab" aria-controls="profile" href="#profile">Profile</a>
            </li>
            <li role="presentation"><a role="tab" data-toggle="tab" aria-controls="messages" href="#messages">Messages</a>
            </li>
            <li role="presentation"><a role="tab" data-toggle="tab" aria-controls="settings" href="#settings">Settings</a>
            </li>
        </ul>
        <!-- Tab panes -->
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane active" id="home">Lorem ipsum dolor sit amet</div>
            <div role="tabpanel" class="tab-pane" id="profile">consectetur adipiscing elit,</div>
            <div role="tabpanel" class="tab-pane" id="messages">sed do eiusmod tempor incididun</div>
            <div role="tabpanel" class="tab-pane" id="settings">ut labore et dolore magna aliqua</div>
        </div>
    </div>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</body>

</html>

I click "File>Manage Version" and create a version. Then "Publish>Deploy As WebApp" and get this Fetching Data

I have let this sit for more than 30 minutes with no change. I restarted my system and went through the steps again and still no change. Any suggestions on what is going on?

like image 955
J Cham Avatar asked Mar 22 '19 16:03

J Cham


People also ask

How do I Deploy a Google script to the web app?

Save a new version of the script by selecting File > Manage Versions, then Save New Version. Select Publish > Deploy as web app. Under Project version, select the version you just saved.

Why is my Google script not working?

There are a few possible causes for these errors: A Google server or system is temporarily unavailable. Wait for a few moments and try running the script again. There is an error in your script that doesn't have a corresponding error message.

How do I speed up a Google app script?

To speed up a script, read all data into an array with one command, perform any operations on the data in the array, and write the data out with one command.

What is Deploy in Appscript?

An Apps Script project deployment is a version of the script that is made available for use as a web app, add-on, or API executable. By creating and managing deployments, you can iterate on your code, keep track of your changes, and control the exact code version your users have access to.


2 Answers

Any suggestions on what is going on?

Fetching data...

To figure out what's going on, look at the underlying Google request via browser tools.

For Chrome:

  1. Open Developer tools
  2. Click the Network tab
  3. Re-run "Deploy as web app"
  4. Look for "sharingService" in the Network tab
  5. Click on it and review the underlying message

enter image description here

In my case, I was attempting to deploy from an account outside the organization:

Only users in the organization may deploy this script.

View the specifics for your case and decide what the next appropriate action is.

like image 139
Mike Avatar answered Oct 13 '22 10:10

Mike


To complete Ahmed answer:

you might not be part of the group or the owner of the script.

It's also true if you try to deploy a script from a file you have the right to edit without being the owner.

To change the owner: open the sheet with the owner account, go to share> advance> click on the arrow that triggers the dropdown> set as the owner.

like image 3
JinSnow Avatar answered Oct 13 '22 09:10

JinSnow