Cannot deploy an example Node8 application to AppEngine standard: An internal error occurred

1,480 views
Skip to first unread message

Ernesto Alejo

unread,
Jul 30, 2018, 4:23:36 PM7/30/18
to Google App Engine
I am trying to deploy a hello world example to App Engine Standard to try Node 8 and it fails every time with an internal error.

The full code (a simple hello world copied from the getting started) is here:

When I run gcloud app deploy it returns an error: Error Response: [13] An internal error occurred.

I have tried the following things from GitHub issues and documents:
- Adding node_modules to skip_files: not supported, gcloud asks to remove them and move the code to the .gcloudignore.
- Running: gcloud config set app/use_deprecated_preparation True
- Removing any other file: I have only the files you see in the repository.
- I am the only person with access to it, and I have Owner permissions.
- I am logged in with my account in gcloud.

The project is completely new and has a billing account active for other projects.

What can I try to fix the issue? Or should I open a ticket in the issue tracker?


The verbose logging (with my personal data redacted for this forum) does not say anything useful either:

 ✗ gcloud app deploy --project=MY_PROJECT_CODE_HERE --verbosity debug
DEBUG: Running [gcloud.app.deploy] with arguments: [--project: "MY_PROJECT_CODE_HERE", --verbosity: "debug"]
DEBUG: API endpoint: [https://appengine.googleapis.com/], API version: [v1]
Services to deploy:

descriptor:      [MY_DIRECTORY_HERE/app.yaml]
source:          [MY_DIRECTORY_HERE]
target project:  [MY_PROJECT_CODE_HERE]
target service:  [default]
target version:  [20180730t220515]


Do you want to continue (Y/n)?  

DEBUG: No bucket specified, retrieving default bucket.
DEBUG: Using bucket [gs://staging.MY_PROJECT_CODE_HERE.appspot.com].
Beginning deployment of service [default]...
INFO: Using .gcloudignore file at [MY_DIRECTORY_HERE/.gcloudignore].
DEBUG: Skipping file [.gcloudignore]
DEBUG: Skipping file [node_modules]
DEBUG: Could not call git with args ('config', '--get-regexp', 'remote\\.(.*)\\.url'): Command '['git', 'config', '--get-regexp', 'remote\\.(.*)\\.url']' returned non-zero exit status 1
INFO: Could not find any remote repositories associated with [MY_DIRECTORY_HERE]. Cloud diagnostic tools may not be able to display the correct source code for this deployment.
DEBUG: Skipping upload of [app.yaml]
INFO: Incremental upload skipped 0.12% of data
DEBUG: Uploading 3 files to Google Cloud Storage
DEBUG: Using [16] threads
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 3 files to Google Cloud Storage                ═╣
╚INFO: Uploading [MY_DIRECTORY_HERE/package.json] to [e797836ead99bb17d904f095d47bb8fc898d6b0b]
INFO: Uploading [MY_DIRECTORY_HERE/package-lock.json] to [31b9da26f964547405a99396be8344d874510485]
INFO: Uploading [MY_DIRECTORY_HERE/index.js] to [36b22d58849f14aeba64a7de65c97a24d3635c09]
════════════════════════════════════════════════════════════╝
File upload done.
INFO: Manifest: [{u'package.json': {u'sourceUrl': u'https://storage.googleapis.com/staging.MY_PROJECT_CODE_HERE.appspot.com/e797836ead99bb17d904f095d47bb8fc898d6b0b', u'sha1Sum': 'e797836ead99bb17d904f095d47bb8fc898d6b0b'}, u'app.yaml': {u'sourceUrl': u'https://storage.googleapis.com/staging.MY_PROJECT_CODE_HERE.appspot.com/0194d0bc89622e761091db0d4222785fb5073d57', u'sha1Sum': '0194d0bc89622e761091db0d4222785fb5073d57'}, u'package-lock.json': {u'sourceUrl': u'https://storage.googleapis.com/staging.MY_PROJECT_CODE_HERE.appspot.com/31b9da26f964547405a99396be8344d874510485', u'sha1Sum': '31b9da26f964547405a99396be8344d874510485'}, u'index.js': {u'sourceUrl': u'https://storage.googleapis.com/staging.MY_PROJECT_CODE_HERE.appspot.com/36b22d58849f14aeba64a7de65c97a24d3635c09', u'sha1Sum': '36b22d58849f14aeba64a7de65c97a24d3635c09'}}]
DEBUG: Converted YAML to JSON: "{
  "runtime": "nodejs8"
}"
DEBUG: Operation [apps/MY_PROJECT_CODE_HERE/operations/a71ec693-f953-4c19-891d-2cb027419f94] not complete. Waiting to retry.
Updating service [default]...⠛DEBUG: Operation [apps/MY_PROJECT_CODE_HERE/operations/a71ec693-f953-4c19-891d-2cb027419f94] not complete. Waiting to retry.                                                                                                   
Updating service [default]...⠹DEBUG: Operation [apps/MY_PROJECT_CODE_HERE/operations/a71ec693-f953-4c19-891d-2cb027419f94] complete. Result: {                                                                                                               
    "metadata": {
        "target": "apps/MY_PROJECT_CODE_HERE/services/default/versions/20180730t220515", 
        "method": "google.appengine.v1.Versions.CreateVersion", 
        "user": "MY_EMAIL_HERE", 
        "insertTime": "2018-07-30T20:05:20.408Z", 
        "endTime": "2018-07-30T20:05:23.049Z", 
    }, 
    "done": true, 
    "name": "apps/MY_PROJECT_CODE_HERE/operations/a71ec693-f953-4c19-891d-2cb027419f94", 
    "error": {
        "message": "An internal error occurred.", 
        "code": 13
    }
}
Updating service [default]...failed.                                                                                                                                                                                                                          
DEBUG: (gcloud.app.deploy) Error Response: [13] An internal error occurred.
Traceback (most recent call last):
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 848, in Execute
    resources = calliope_command.Run(cli=self, args=args)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 770, in Run
    resources = command_instance.Run(args)
  File "/usr/lib/google-cloud-sdk/lib/surface/app/deploy.py", line 90, in Run
    parallel_build=False)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 598, in RunDeploy
    flex_image_build_option=flex_image_build_option)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 407, in Deploy
    extra_config_settings)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/appengine_api_client.py", line 206, in DeployService
    poller=done_poller)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 315, in WaitForOperation
    sleep_ms=retry_interval)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 254, in WaitFor
    sleep_ms, _StatusUpdate)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 316, in PollUntilDone
    sleep_ms=sleep_ms)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/util/retry.py", line 229, in RetryOnResult
    if not should_retry(result, state):
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/util/waiter.py", line 310, in _IsNotDone
    return not poller.IsDone(operation)
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/operations_util.py", line 184, in IsDone
    encoding.MessageToPyValue(operation.error)))
OperationError: Error Response: [13] An internal error occurred.
ERROR: (gcloud.app.deploy) Error Response: [13] An internal error occurred.


Steren Giannini

unread,
Jul 30, 2018, 8:25:09 PM7/30/18
to google-a...@googlegroups.com
Thanks for the feedback.

I do not see what is wrong with your code, so I will open an internal bug for investigation. We should at least provide a better error message.

I will keep this thread up to date when I learn more.

Steren
Product Manager

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/a4d16b02-6e64-4f99-9e20-09be2f16466a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steren Giannini

unread,
Jul 30, 2018, 8:30:26 PM7/30/18
to google-a...@googlegroups.com
I can successfully deploy your app to my project.

Would you mind sending me privately your project ID ?

Giacomo Graziosi

unread,
Jul 31, 2018, 10:44:21 AM7/31/18
to Google App Engine
I have the same problem and other people are reporting it on GitHub https://github.com/GoogleCloudPlatform/nodejs-getting-started/issues/172

Steren Giannini

unread,
Jul 31, 2018, 11:27:39 AM7/31/18
to google-a...@googlegroups.com
Thanks for the report. 
We can reproduce the issue when creating new projects and we are actively investigating the issue.

On Tue, Jul 31, 2018 at 7:44 AM Giacomo Graziosi <g.gra...@gmail.com> wrote:
I have the same problem and other people are reporting it on GitHub https://github.com/GoogleCloudPlatform/nodejs-getting-started/issues/172

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.

Jason Collins

unread,
Jul 31, 2018, 5:55:02 PM7/31/18
to Google App Engine
This issue should be fixed now. We apologize for any inconvenience and will make adjustments to avoid this problem in the future.

Ernesto Alejo

unread,
Jul 31, 2018, 6:06:22 PM7/31/18
to Google App Engine
I can deploy the hello world application now, but when I try to access it a 500 error is returned and this error is logged in Stackdriver:


"Error: Cannot find module '/srv/server.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3"

Steren Giannini

unread,
Jul 31, 2018, 6:09:40 PM7/31/18
to google-a...@googlegroups.com
Can you confirm that you did not modify the hello world sample? 
I personally just deployed the hello world twice in new projects

Ernesto Alejo

unread,
Jul 31, 2018, 6:16:31 PM7/31/18
to Google App Engine
I am deploying these files except the README:

This is the manifest the gcloud CLI logs in verbose mode, formatted to make it easier to read it, with the checksums:

[
  {
    "package.json": {
      "sha1Sum": "d08bd3f852ad0bcadbd02a251ad9cf403bd46a2a"
    },
    "app.yaml": {
      "sha1Sum": "8edb3cc262217cbeef5e3538ed42e6adbcadd46d"
    },
    "source-context.json": {
      "sha1Sum": "570820d5c715c0365680c0d7d122f2eb10ca8829"
    },
    "index.js": {
      "sha1Sum": "019951bfec2488911cdd719aec263aabbeaf9fc6"
    }
  }
]


Ernesto Alejo

unread,
Jul 31, 2018, 6:22:06 PM7/31/18
to Google App Engine
Also the error changed now:

Error: Cannot find module '/srv/app.js'
at Function.Module._resolveFilename (module.js:547)
at Function.Module._load (module.js:474)
at Function.Module.runMain (module.js:693)
at startup (bootstrap_node.js:191)
at (bootstrap_node.js:612)

Steren Giannini

unread,
Jul 31, 2018, 6:25:30 PM7/31/18
to google-a...@googlegroups.com
You probably renamed a file:
the sample uses app.js, but you are uploading index.js.

Ernesto Alejo

unread,
Jul 31, 2018, 6:34:47 PM7/31/18
to Google App Engine
Thank you very much! It's working now. It would probably be better to document it somewhere though; I tried changing the main field in the package.json file too and it didn't work so I suppose it is a requirement to have a file called app.js in the root of your project.

Steren Giannini

unread,
Jul 31, 2018, 7:23:42 PM7/31/18
to google-a...@googlegroups.com
We are using the start script defined in package.json.
You can see that in the sample, the start script is "node app.js" 

Ernesto Alejo

unread,
Jul 31, 2018, 7:28:16 PM7/31/18
to Google App Engine
I just discovered it too. Also for future readers: if you don't have a start script in your package.json it uses "node server.js" by default.

Gerardo Lima

unread,
Jan 21, 2019, 9:56:19 AM1/21/19
to Google App Engine
It would've been great if this information was provided on the error message, @Steren ... I was not submitting my package.json by mistake (on .gcloudignore); the app could not start with and the only log error I had was this unrelated message. 

Omair (Cloud Platform Support)

unread,
Jan 21, 2019, 11:00:34 AM1/21/19
to Google App Engine
Hi Gerardo,

You can create a feature request for better error reporting on issue tracker by following the this link. 

Gerardo Barbosa Lima

unread,
Jan 21, 2019, 12:17:38 PM1/21/19
to google-a...@googlegroups.com
I don't think so ... it seems to be exclusive top google employees ...

Omair (Cloud Platform Support)

unread,
Jan 21, 2019, 12:58:00 PM1/21/19
to Google App Engine
Hi,

My apologies, here is the correct link.

On Monday, January 21, 2019 at 12:17:38 PM UTC-5, Gerardo Lima wrote:
I don't think so ... it seems to be exclusive top google employees ...

To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscribe@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages