google-appengine-node

updating a deployment - uploaded images gets deleted after redeployment to google cloud

社会主义新天地 提交于 2021-01-29 11:42:06
问题 So I have a node js web app, this web app has a folder to store images uploaded by users from a mobile app. How I upload the image to the folder is by using the image's base64 string, and using fs.writeFile to save the image to the folder, like this: fs.writeFile(__dirname + '/../images/complaintImg/complaintcase_' + data.cID + '.jpg', Buffer.from(data.complaintImage, 'base64'), function (err) { if (err) { console.log(err); } else { console.log("success"); } }); The problem is, whenever the

Use private npm registry for Google App Engine Standard

邮差的信 提交于 2020-12-12 11:36:35
问题 For all the other stackoverflow questions, it seems like people are asking either about a private npm git repository or about a different technology stack. I'm pretty sure I can use a private npm registry with GAE Flexible, but I was wondering if it was possible with the Standard version? From the GAE standard docs, doesn't seem like it is possible. Anyone else figure out otherwise? 回答1: Google Cloud Functions allow you to access private NPM modules by providing credentials for the npm

How to fix google cloud ssl issue

喜夏-厌秋 提交于 2020-01-03 04:48:13
问题 I pointed a new custom domain to a Google App Engine Standard Environment project and edited the DNS records per Google's instructions, and it seems to be redirected properly. When I go to www.mydomain.com with its supposedly activated certificate, I still get connection is not secure in the browser. If I go to mydomain.com it gets redirected to www.mydomain.com with the same result. But when I directly enter https ://www.mydomain.com it display the website and with connection is secure. Let

App Engine Node.js: how to link app logs and requests logs

夙愿已清 提交于 2020-01-02 09:53:57
问题 I am using Node.js on App Engine Standard and Flexible. In the logs viewer, is it possible to display application logs nested inside request logs? 回答1: Yes it is possible to correlate application logs and request logs. This is the end result in the Logs Viewer: To achieve this you can either: Use both the @google-cloud/trace-agent and @google-cloud/logging-bunyan modules in your application . When you do so, your logs are automatically annotated with the correct Trace ID (see docs for Bunyan)

App Engine Node.js: how to link app logs and requests logs

半城伤御伤魂 提交于 2020-01-02 09:53:19
问题 I am using Node.js on App Engine Standard and Flexible. In the logs viewer, is it possible to display application logs nested inside request logs? 回答1: Yes it is possible to correlate application logs and request logs. This is the end result in the Logs Viewer: To achieve this you can either: Use both the @google-cloud/trace-agent and @google-cloud/logging-bunyan modules in your application . When you do so, your logs are automatically annotated with the correct Trace ID (see docs for Bunyan)

Google Cloud Platform App Engine Node Flexible Instance Ruby sitting at 50% RAM usage

自作多情 提交于 2020-01-01 00:21:29
问题 There's a ruby process that always sits at 50% RAM utilization regardless of how much RAM the instance is allocated. I'm running Node in a flex environment with a simple express app that connects to a Cloud SQL instance through sequelize. I've tried increasing the RAM to 4GB and it continue to sit at 50% usage. It looks like the process is /opt/google-fluentd/embedded/bin/ruby -Eascii-8bit:ascii-8bit /usr/sbin/google-fluentd --log /var/log/google-fluentd/google-fluentd.log --under-supervisor

How to use private, self hosted NPM package with Google App Engine node, standard environment

烂漫一生 提交于 2019-12-12 12:16:45
问题 I have an NPM package hosted on a private Bitbucket git repo (not in the official NPM registry). I have this in my package.json, under the "dependencies" key: "a-private-package" git+ssh://git@bitbucket.org:myusername/a-private-package.git It works when I run npm install locally as my SSH keys are used. But when I use gcloud app deploy to deploy to the app engine standard environment for node, I get a Host key verification failed from Google Cloud Build. I have tried: Adding a custom SSH key

How to fetch data via http request from Node.Js on AppEngine?

≡放荡痞女 提交于 2019-12-11 19:52:47
问题 Everything works perfect when I run locally. When I deploy my app on AppEngine, for some reason, the most simple request gets timeout errors. I even implemented retry and, while I made some progress, it still not working well. I don't think it matter since I don't have the problem running on local, but here's the code I just used for request-retry module: request({ url: url, maxAttempts: 5, retryDelay: 1000, // 1s delay }, function (error, res, body) { if (!error && res.statusCode === 200) {

Deployed a Next.js application to App Engine Standard [Nodejs] and got a 500 error

依然范特西╮ 提交于 2019-12-09 06:22:14
问题 I deployed to app engine with nodejs8 runtime and got a 500. Im deploying a next.js application, and upon reviewing StackDriver I get. It appears .next might be getting ignored. The error is as follows: throw new Error("Could not find a valid build in the '".concat(this.distDir, "' directory! Try building your app with 'next build' before starting the server.")); Error: Could not find a valid build in the '/srv/build' directory! Try building your app with 'next build' before starting the

App Engine Node.js: how to link app logs and requests logs

ぐ巨炮叔叔 提交于 2019-12-08 13:32:30
I am using Node.js on App Engine Standard and Flexible. In the logs viewer, is it possible to display application logs nested inside request logs? Yes it is possible to correlate application logs and request logs. This is the end result in the Logs Viewer: To achieve this you can either: Use both the @google-cloud/trace-agent and @google-cloud/logging-bunyan modules in your application . When you do so, your logs are automatically annotated with the correct Trace ID (see docs for Bunyan ). Extract the trace ID from the request header If you do not want to use the Trace module, you can extract