Trying to get basic Nodejs example working on GAE - node.js

I'm using Windows 7x64, gcloud installed version
Google Cloud SDK 0.9.71
app 2015.07.24
app-engine-java 1.9.24
app-engine-python 1.9.24
app-engine-python-extras 1.9.21
bq 2.0.18
bq-win 2.0.18
core 2015.07.24
core-win 2015.07.24
gcloud 2015.07.24
gsutil 4.13
gsutil-win 4.13
preview 2015.07.24
windows-ssh-tools 2015.06.02
I'm trying to run on preview and deploy the tutorial example from here. Note that app.yaml from this example has "nodejs" set as runtime.
After running command
gcloud preview app run --host localhost:8080 app.yaml
I get
RuntimeError: Unknown runtime 'nodejs'; supported runtimes are 'custom', 'go', 'java', 'java7', 'php', 'php55', 'python, 'python27', 'vm'.
If I put "vm" for runtime it wants to use docker, which doesn't work for me either and I wanted to use the option to do this without docker anyhow.
If I put "custom" for runtime in yaml file I get:
ValueError: The --custom_entrypoint flag must be set for custom runtimes
Example given in the help output for this switch is the following
--custom_entrypoint="gunicorn -b localhost:{port} mymodule:application"
I tried with this, best guess
gcloud preview app run --custom_entrypoint="nodejs -b localhost:{8080} mymodule:application" app.yaml
and got this
ERROR: Argument [--custom_entrypoint=nodejs -b localhost:{8080} mymodule:application] is not a valid deployable file.
ERROR: (gcloud.preview.app.run) Errors occurred while parsing the App Engine app configuration.
Thanks for your time.

The gcloud command seems to be undergoing some changes, so this question seems no longer valid, since we're meant to run dev_appserver.py instead of gcloud to run devserver processes; you can also just straight-up run the node server, or even use docker to build the image from your dockerfile and run that as a container.
If running from dev_appserver.py, make sure you have runtime: custom and a Dockerfile sourcing FROMgcr.io/google_appengine/nodejs, since dev_appserver.py currently raises:
RuntimeError: Unknown runtime 'nodejs'; supported runtimes are 'custom', 'go', 'java', 'java-compat', 'java7', 'php55', 'python', 'python-compat', 'python27'.

Related

ERROR: (gcloud.run.deploy) Error parsing [service]. The [service] resource is not properly specified. Failed to find attribute [service]

I am trying to deploy my nodejs application to cloud run using the following command
gcloud run deploy --image gcr.io/[project-id]/helloworld --platform managed
Before running this command I built two cloud build images and trying to deploy the latest build using above command. But getting the following error
ERROR: (gcloud.run.deploy) Error parsing [service].
The [service] resource is not properly specified.
Failed to find attribute [service]. The attribute can be set in the following ways:
- provide the argument [SERVICE] on the command line
- specify the service name from an interactive prompt
I don't know which is causing error. Can anybody help me with this? Thank you
Try specifying the Service ID as an argument, replacing my-service with the desired name:
gcloud run deploy my-service --image gcr.io/[project-id]/helloworld --platform managed
Also, make sure you're using the latest Cloud SDK with gcloud components update.
$ gcloud run deploy --image gcr.io/cloudrun/hello --platform managed should prompt you to pick a platform, pick a region and a service name. Please try with this command.
In your command, make sure to replace [project-id] with you GCP project ID.

gcloud app deploy failed with error - gcloud crashed FileNotFoundError - python3 app

I am trying to deploy a sample python app which I got from another tutorial. However, the deployment fails as below:
gcloud app deploy Beginning deployment of service [default]... ERROR:
gcloud crashed (FileNotFoundError): [Errno 2] No such file or
directory:
'/Users/nileshdeshmukh/Desktop/Training/Python/FlaskIntroduction-master/env/.Python'
My app.yaml file is as below:
runtime: python3
env: standard
runtime_config:
python_version: 3
I have all dependencies copied in env/bin but the build process is looking for env only..
I think the problem would be solved if the deployment process looks at env/bin, but don't know how to force it to look at given path
The runtime_config setting is for App Engine flex only and isn't needed for App Engine Standard. You can safely remove it.
As per the error, you should ensure that all your dependencies are self-contained and shipped with your app or listed in your requirements.txt file.
Be careful, some gcloud commands use .gitignore file to prevent sending useless file to Cloud for building your app.
You can override this behavior by creating a .gcloudignore file. Same syntax as git ignore but take into account only by gcloud commands and not by git. By the way you can differentiate the file to send to the cloud and file to send to git

node.js app fails to deploy in appengine: gcloud app deploy to appengine fails, issues with cached base image and node cache

Folks
I am trying to deploy a simple node.js app onto appengine. Every time I deploy the same using gcloud deploy, I get these warning and errors in the logs. I am using the config module in node.js also to load some general environment variables I need. Any pointers apprecaited if others have come across similar runtime issues? here is log when I execute the command:
gcloud app deploy app.yaml
No cached base image found for entry
us.gcr.io/.../app-engine-build-cache/node-cache:f0sdafsadasdfsadfasfasdfasdf
Step #1 - "builder": INFO Cache miss on local cache for us.gcr.io/.../app-engine-build-cache/node-cache:f0sdafsadasdfsadfasfasdfasdf
....
later....
...
Step #1 - "builder": ERROR Error during upload of: us.gcr.io/.../app-engine-build-cache/node-cache:f0sdafsadasdfsadfasfasdfasdf
Finally my deploy fails
File upload done.
Updating service [myservice name]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build <number> status: FAILURE. Check the build log for errors: https://console.cloud.google.com/gcr/builds/<my build number>
I am using
$gcloud version
Google Cloud SDK 214.0.0
bq 2.0.34
core 2018.08.24
gsutil 4.33
$ npm --version
6.3.0
thanks for any pointers where things might be going wrong.

ERROR: (gcloud.deployment-manager.deployments.create) ResponseError: code=412, message=Unknown top level field in manifest: runtime

I get error when running
gcloud deployment-manager deployments create my-deployment --config app.yaml
Content of app.yaml:
runtime: nodejs
env: flex
You're using the command to deploy to Google Cloud Deployment Manager but with a configuration file for the App Engine Flexible Environment. You need to (depending on what you're trying to do) either use the gcloud app deploy command, or create a Deployment Manager configuration file.

where are the build logs created when gcloud app deploy fails

Quick: where can I find the deployment logs for a node deploy which fails?
Setup: windows 10 box developing a node.js website. the website runs locally, and has deployed successfully with the same package stack (body-parser, express, firebase, firebase-tools, path, pug)
Google Cloud SDK 134.0.0
app-engine-python 1.9.40
bq 2.0.24
bq-win 2.0.24
core 2016.11.07
core-win 2016.11.07
gcloud
gsutil 4.22
gsutil-win 4.20
windows-ssh-tools 2016.05.13
The last few lines of the deploy output shows a core dump and timeout ends the deploy and how the latest gcloud update gacked up the logging output.
[91mnpm[0m[91m WARN using --force I sure hope you know what you are doing.
[0m
> group-coms#0.0.1 install /app
> npm install --force
[91mAborted (core dumped)
ERROR: (gcloud.app.deploy) Error Response: [4] DEADLINE_EXCEEDED
Oh yes, when it failed earlier today, I moved the folder to the root of the drive testing the 'too long a path' theory and it deployed successfully a couple of times. I haven't added or renamed any files since then, I have tried reloading all the node_modules to no avail.
# [START app_yaml]
runtime: nodejs
vm: true
# [END app_yaml]
I changed the yamal file to comply with upgrading#appyaml_changes and the deploy completed successfuly... I would still like to know more about how I can monitor the build process..

Resources