Google Cloud Datastore - Endpoint Read Failed Error - google-cloud-datastore

I keep getting below error every once in a while when I call the datastore.save method:
Error: Endpoint read failed at /user_code/node_modules/#google-cloud/datastore/node_modules/grpc/src/client.js
My code is running inside a Google Cloud Function and I am using the official Node.js client library provided by Google for Google Cloud Datastore.
Can someone help? Thanks in advance.

As mentioned in the comments, this appears to be an instance of this issue. That issue has since been closed because a change in the gRPC library should fix the problem.

Related

Unable to change location for firebase pubsub trigger

I have an App Engine app in asia-northeast1, but i could not specify the region for pubsub trigger.
This works:
functions.region("asia-northeast1").https.onRequest(async (req, res)
This does not work:
functions.region("asia-northeast1").pubsub.schedule('* 6-23 * * *')
With the following erroor message: Error: HTTP Error: 400, Location must equal asia-northeast1 because the App Engine app that is associated with this project is located in asia-northeast1
Does anyone have any experience getting pubsub trigger to work in a different region than the default us-central1? Thank you in advance
This is a known bug in the Firebase CLI version 7.1.0. Downgrade to a prior version for now (7.0.2). This will be fixed.
When you encounter unexpected problems with the Firebase CLI, you should contact Firebase support directly, and also consider filing a bug report in GitHub.
Same issue here: I've resolved setting Google Cloud Platform (GCP) resource location in Firebase Project settings, which was undefined, to eur3 (europe-west) (my AppEngine resources are in europe-west1)

AngularFire/Firestore Using maximum backoff delay to prevent overloading the backend

Today after a simple deploy for adjusts (without install new features) my angularfire application stay lot delay. When checked the console log see this message, in login screen, without any operation or request.
Somebody can give some trick?
Firestore (4.9.0) 2018-05-22T22:05:09.569Z: FirebaseError: [code=resource-exhausted]: Quota exceeded.
Firestore (4.9.0) 2018-05-22T22:04:17.606Z: Using maximum backoff delay to prevent overloading the backend.
Problem solved after unistall old unused functions
npm uninstall firabase-functions
I am also facing the same error in angularfire 2. It looks like there are two possible options to solve this issue
1) User firebase cloud functions. Move your code there and call the function from angular. Retrieve the data.
2) Write a python script and execute it using tools like PyCharm.

Google Cloud Functions with ECONNRESET errors until I redeploy

I'm using Google Cloud Functions to:
Watch for a new Firebase entry
Download a file that's referenced in the Firebase entry
Generate a thumbnail based on that file.
Upload the thumbnail to the cloud bucket.
Unfortunately I'm getting ECONNRESET errors repeatedly on step 4, and the only way to fix it seems to be to redeploy the function. Any ideas how to further debug this?
Edit:
It seems like many times when this happens, when I try to deploy the function again, it errors, and I have to run the deploy twice. Is something hanging or something?
Update May 9 2017
According to this thread, the google cloud nodejs API developers have made some changes to the defaults that are used when initializing that should solve these ECONNRESET socket issues.
From #stephen++ on github GoogleCloudPlatform/google-cloud-node issue 2254:
We have disabled the forever agent by default in Cloud Function
environments. If you un- and re-install #google-cloud/storage, you
will pick up the new behavior automatically. Thanks for all of the
helpful debugging, everyone!
Older Post Follows:
The solution for me to similar ECONNRESET issues using storage on the cloud functions platform was to use npm:promise-retry, but set up your own retry strategy because the default of 10 retries is too many.
I reported an ECONNRESET issue with cloud functions to Google Support (which you might star if you are also getting ECONNRESET in this context but not in other contexts) and they replied with a "won't fix" that the behavior is expected. Google support said the socket that the API client library uses to connect times out after a few minutes, and then when your cloud function tries to use it again you get ECONNRESET. They recommended adding autoRetry:true when initializing the storage API, but that did not help.
The ECONNRESETs happen on the read side too. In both read and write cases promise-retry helps, and most of the time with only 1 retry needed to reset the bad socket.
So I wrote npm:pipe-to-storage to return a promise to do the retries, check md5, etc., but I haven't tested it with binary data, only text, so I don't know if you could use it with image files. The calls would look like this:
const fs = require('fs');
const storage = require('#google-cloud/storage')();
const pipeToStorage = require('pipe-to-storage')(storage);
const source = ()=>(fs.createReadStream("/path/to/your/file/to/upload"));
pipeToStorage(source, bucketName, fileNameInBucket).then(//do next step);
See also How do I read the contents of a new cloud storage file of type .json from within a cloud function?
You can directly report a bug to the Firebase Support team, or open a support ticket with Firebase to troubleshoot a specific issue.
You may also report a Cloud Functions specific issue in the Google Issue Tracker, which is similar to Stack Overflow in that it is accessible by the public (but specifically used for filing issue reports).

Cloud Functions for Firebase sometimes have Invalid credential error

Not appear every time, but sometimes this error appears in the log:
FIREBASE WARNING: {"code":"app/invalid-credential","message":"Credential implementation provided to initializeApp() via the \"credential\" property failed to fetch a valid Google OAuth2 access token with the following error: \"read ECONNRESET\"."}
Is there any way to handle this kind of error like retry?
Or is it okay to ignore it?
Just ensure that your machine time auto sync. and not manualy,
And your XXX......json from firebase is the latest downloaded. (if you dont sure, download it again - and this file will be the newer one)
that what helped me.
I am also facing this issue. Looks like it retries and get the job done but cloud functions are taking time to process data.

Uncaught TypeError: n.Telemetry.PageViewPerformance.checkPageLoad is not a function

All our Microsoft Datazen servers are seeing an infine loop of client side javascript exceptions:
Uncaught TypeError: n.Telemetry.PageViewPerformance.checkPageLoad is not a function
since this script comes from http://az416426.vo.msecnd.net/scripts/a/ai.0.js the issue may be the App Insights cloud service.
As anyone experienced this?
Interesting - there was a refactoring recently where 'checkPageLoad' was split to 2 other functions (https://github.com/Microsoft/ApplicationInsights-JS/commit/da50064bfc6537fe7efe78ef1f5b048636f85070#diff-e25ffb54668c8e8794fb7224dbfadafbL112) However I don't see any issues with that - all usages of checkPageLoad were corrected accordingly.
Was it an intermittent issue or is it still reproducing? Do you have any custom code calling into AppInsights script, or it's just a snippet that you injected into your page?

Resources