How to fix "--custom_entrypoint flag must be set for custom runtime"?

I get this error on appengine when I run gcloud preview app run app.yaml : The --custom_entrypoint flag must be set for custom runtimes

My app.yaml looks like this:

 version: 0-1-1 runtime: custom vm: true api_version: 1 manual_scaling: instances: 1 handlers: - url: .* script: dynamic 

My docker file is simple: FROM google/nodejs-runtime

I reinstalled gcloud to get the latest version, has something changed in yaml configuration for managed virtual machines? This makes testing my application impossible.

+7
google-app-engine gcloud managed-vm gcloud-node
source share
3 answers

It seems that an error or configuration issue with the Google Cloud SDK version 0.9.67 is causing this error. As a temporary workaround, you can revert to a previous version of the SDK that works with the following commands:

 gcloud config set component_manager/fixed_sdk_version 0.9.66 gcloud components update 

To revert to the current version of the SDK, run:

 gcloud config unset component_manager/fixed_sdk_version gcloud components update 

This problem appeared several versions ago and was discussed here: Running node.js in the Google cloud, but an error occurred while starting docker

+6
source share

You can run gcloud help preview app run to display a help page describing the launch command and its parameters. --custom-entrypoint described as:

  --custom-entrypoint CUSTOM_ENTRYPOINT Specify an entrypoint for custom runtime modules. This is required when such modules are present. Include "{port}" in the string (without quotes) to pass the port number in as an argument. For instance: --custom_entrypoint="gunicorn -b localhost:{port} mymodule:application" 

Note that the error message says --custom_entrypoint , with an underscore, but the --customer_entrypoint parameter with a dash. The correct name is --custom-entrypoint see: https://code.google.com/p/google-cloud-sdk/issues/detail?id=191

For a node node, you should use something like:

 gcloud preview app run app.yaml --project=your-project-id --custom-entrypoint "node index.js {port}" 

Depending on how you run your application. The port also seems to be available as a PORT environment variable, so you don't need to use {port} if your application does not process command line arguments.

I could not use npm start or other npm run <script> from --custom-entrypoint .

+4
source share

Comment lines 391 to 397 in

Google Cloud SDK / platform / google_appengine / Google / AppEngine / tools / devappserver2 / module.py

 # if (self._module_configuration.effective_runtime == 'custom' and # os.environ.get('GAE_LOCAL_VM_RUNTIME') != '0'): # if not self._custom_config.custom_entrypoint: # raise ValueError('The --custom_entrypoint flag must be set for ' # 'custom runtimes') # else: # runtime_config.custom_config.CopyFrom(self._custom_config) 
0
source share

All Articles