Google App Engine Nodejs Error 409 - node.js

I'm using a Node Express app with App Engine. Everything's been deploying fine, but I must have had an interrupted deployment because now when I try to deploy using this:
gcloud preview app deploy .
I get this:
Error 409: --- begin server output ---
Another transaction by user <username> is already in progress for app:
s~<appId>, version: 1. That user can undo the transaction with "appcfg
rollback".
--- end server output ---
ERROR: (gcloud.preview.app.deploy) Command failed with error code [1]
I can't find an appcfg file to rollback, nor any documentation about this issue for a node app.

You can use gcloud preview app deploy . --force
which will implicitly do a rollback (to clear the deploy lock) before attempting the deployment.

Use the appcfg.py rollback command.
Here, create a file as app.yaml and a directory WEB-INF in which there will be two files named as web.xml and appengine-web.xml.

Related

/npm/bin/npm-cli.js: not found on Azure app service - node app

I am trying to deploy the nodejs app to Azure but I am getting the below error.
2021-07-08T10:22:38.234570707Z
/home/site/wwwroot/node_modules/.bin/npm: 1:
/home/site/wwwroot/node_modules/.bin/npm: ../npm/bin/npm-cli.js: not
found
2021-07-08T10:22:38.244796509Z npm info lifecycle express-typescript-starter#0.1.0~start: Failed to exec start script
This is the output I am seeing application logs on Azure.
App Service is the free plan with Node 14 as a runtime environment running on Linux. I have verified all the files, everything looking good.
Even I checked node modules as well. The folder is there but the error-specific file i.e inside node_module npm/bin/npm-cli.js. It is not there.
But it's not on my local as well and there it's working fine.
I am deploying through Github action.

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.

Node.js cannot find mysql-database service

I'm trying to follow the tutorial noted below:
http://www.ibm.com/developerworks/cloud/library/cl-bluemix-nodejs-app/
But when I push my app, I see the following:
Using manifest file /mytests/bluemix-node-mysql-upload/manifest.yml
Updating app jea-node-mysql-upload in org jea68#gmail.com / space dev as jea68#gmail.com...
OK
Uploading jea-node-mysql-upload...
Uploading app files from: /mytests/bluemix-node-mysql-upload/app
Uploading 53.6K, 11 files
Done uploading
OK
FAILED
Could not find service mysql-database to bind to jea-node-mysql-upload
Is there a problem with the node.js buildpack or is the documentation faulty?
I've been able to push apps to Node.js without any problems this morning. The documentation assumes the user knows that the service has already been created. The manifest.yml included in the github repo of the tutorial defines a service (mysql-database) that has not been created. Run the following command to create the service:
$ cf create-service mysql 100 jea-mysql-node-upload-service
Then modify the manifest.yml to include:
services:
- jea-mysql-node-upload-service
Alternatively, since you already have an app, you can bind the application to the service by running the following:
$ cf bind-service jea-node-mysql-upload jea-mysql-node-upload-service
$ cf start jea-node-mysql-upload
It looks like a fault in the documentation. If you look at Step 2 part 3 it says to create the my-sql service using this command:
cf create-service mysql 100 mysql-node-upload
which will name the service instance as mysql-node-upload, however the manifest.yml file that you cloned from github contains the service name of just mysql-service. It is the manifest.yml file that links the app with the service instance.
The options are either the change the manifest.yml file to be the correct name of your mysql service instance or recreate the mysql service instance with the name that is in your manifest.yml.

gcloud deploy fails with "Failed to enable APIs" error

I followed this excellent tutorial on Getting Started with Node.js but get the following error when running the last command gcloud preview app deploy .:
/Users/me/Google Drive/appengine-nodejs-quickstart> gcloud preview app deploy .
Updating module [default] from file [/Users/me/Google Drive/appengine-nodejs-quickstart/app.yaml]
08:51 PM Host: appengine.google.com
Error 400: --- begin server output ---
Failed Project Preparation (app_id='s~foo-bar-123'). Failed to enable APIs.
--- end server output ---
ERROR: (gcloud.preview.app.deploy) Command failed with error code [1]
I was able to run the app locally just fine using gcloud preview app run .. I checked and I do have Billing enabled for the project and some default APIs are enabled. Here's the results from docker version if it helps:
Client version: 1.3.2
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): 39fa2fa
OS/Arch (client): darwin/amd64
Any ideas what could be the issue?
I'm an engineer on the managed vms team and have looked into the issue. I believe the problem is we have changed our terms of service and you need to accept the before you can continue to use the product. Obviously, our messaging in this case is bad and needs to be fixed.
For now you need to go to cloud.google.com/console, select your project, and accept the new terms of service.

Resources