Cloud Functions: Functions finished with 'load error' - google-cloud-functions

I have a http triggered cloud function that is throwing this error, albeit very rarely. This error is particularly difficult to replicate.
I have searched around Stack Overflow but yielded no results. I have also attempted to trigger it manually from the Google Cloud console and it all works fine.
Would anyone be able to advice what does this error point to?
EDIT: Fully expanded log

Related

Google Workspace Add-on bug - "JavaScript engine reported an unexpected error. Error code INTERNAL."

I have developed a Google Workspace Add-on for Google Sheets that has been available on the Google Workspace Marketplace for about 1.5 years with a lot of active users.
I recently updated some features and 2 new errors have begun popping up that I can't seem to debug. They show in my Google Cloud Console logs and error reports as follows:
We're sorry, the JavaScript engine reported an unexpected error. Error code INTERNAL.
0[unknown file]([unknown function])
and
Exceeded maximum execution time
0[unknown file]([unknown function])
From what I understand from the small amount of information available about this online is that something is timing-out in one of my custom functions. The issue is these bugs won't give me any useful information, such as a specific line in my code and I can't seem to see any point at which the functions could hang. Is it possible that this error occurs when a large number of users are accessing the add-on at once?
Has anyone here experienced the same issue that could explain how to get more information on the issue to even begin debuggint the root cause. Or if there is a specific technical assistance support line I could use for Google Developers I'm all ears, there just doesn't seem to be one available that I could find.
Thanks!

Cloud Functions - Unknown error while fetching the archive

I've been unable to access the source code for any of my Cloud Functions across multiple Google Cloud Projects for well over a week. When clicking through to the Source tab of a function I see a greyed out area with the message "Unknown error while fetching the archive".
On clicking Edit I'm met with "We can't display source code of this function." The error persists even if I try to set up a new Cloud Function. Then I get an error with no accompanying message.
There doesn't seem to be any issue with billing, I've tried logging in as a different user and I'm unable to find any documentation online. Has anyone been able to resolve this successfully?
In most scenarios, this error arises due to billing issues related to the account. However, since you confirm your case is not so, I suggest you try logging in with an incognito window once.
If it doesn't help, make sure to try out the steps mentioned in here.

Is there a way to run Google Lighthouse tests headlessly?

So I'm trying to programmatically conduct Google Lighthouse audits on several webpages, and I'm running into an issue. After installing Chrome and node/npm/lighthouse on an Amazon Linux 2 EC2 instance, I am able to successfully run LightHouse tests when I initiate a GUI session and run a command from a terminal within the GUI (this launches chrome and conducts the test as usual) but I am unable to do the same thing from the command line. This is the error I get when launching lighthouse.
ChromeLauncher:error [42565:42565:0516/170626.787500:ERROR:brower_main_loop.cc (1386) Unable to open X display.
While there are a couple of other errors, I believe this is the one I should be paying attention to, because when I try to just launch Google Chrome, that is the exact error I get, so I am inclined to believe it is an issue with trying to launch on a display.
I've also tried the "--headless" option when launching chrome and get
[0516/171128.450564:WARNING:headless_browser_main_parts.cc(83)] Cannot create Pref Service with no user data dir. [0516/171128.521499:ERROR:vaapi_wrapper.cc(594)] Could not get a valid VA display [0516/171128.524992:ERROR:gpu_init.cc(426)] Passthrough is not supported, GL is egl
Another user with a similar question decided to use the Google Pagespeeds API, which will not a be a solution for me-- it needs to be done locally.
Because this works fine on a GUI session with the same server, I really think it's just a display rendering issue, but I don't know how to solve this. Maybe "simulating" a display? I've also tried entering export DISPLAY=1:0, which apparently worked for some users and caused me to stop seeing the error, but the functionality was still broken when running the audit.
Any help would be so useful!!
Information found in this stackoverflow question was infinitely helpful. Although I still get a slew of errors when I try to launch the browser, I can successfully run LightHouse and audit the pages I want to without any errors.

Follow official steps to Generate Google Map API for new project, fail to load into Google Cloud Platform

I am trying to add a map into my website marking the location of a place.
So I read that I have to generate API from Official google map API page.
I created a project, setup billing as required.
Then when loading into the Google Cloud Platform, it always throw me an error saying something went wrong:
How am I going to fix this?
There are a number of reasons why this error could have been thrown. Often times further evaluation of the error would be required by reviewing the Stackdriver logs as the rootcause cannot immediately be determined just being viewing the Console error message displayed.
For this type of issues, the recommendation is that you contact the Google Cloud Platform support team or you can create a Public issue on the general Cloud Platform Public Issue Tracker. There is relatively little that can be done on Stack Overflow to help you debug this.

Google Apps Script randomly produces error message "Unexpected error occurred" after adding more code

I have written a Google Apps Script UiApp application with close to 1000 lines of code and a fair amount of handlers and callbacks. The app was working fine, but as the code grew the app suddenly got a lot of "unexpected error occurred" messages. The error messages occur as the app is loading and are intermittent. I can try the app one minute and get the error. Then refresh and the error goes away. Refresh again and the error may very well appear again. They occur in both the test and production url.
Because the error is random I can't trace it to any particular line of code, Are there processing limits that might cause this? Does Google Apps have limits on lines, widgets or handlers? If so, could those be causing these errors and are there ways to get the limits increased? Is there anything I can do to trace this problem?
Frequently, the "unexpected error occurred" message is attributed to your handlers trying to work with elements that have not yet been created and added to your app. For example, if you try to run a handler on a panel that may very well exist in your code in a function some where, you will get an unexpected error if the panel has not yet been created.
Follow the flow of operations and functions in your code to see if something is trying to execute on an element that may exist in a function somewhere, but hasn't been added to your app yet.
Additionally, if you are trying to handle elements that have Id's through ".forTargets(app.getElementById('myElement'))", check the names of your Id's very closely. If the name is wrong, you will get that error as well.
Bug squashing can be a time consuming, hair-pulling experience! When your code starts becoming spaghetti code, these errors tend to crop up. You may have to go back and re-design and re-write to clean things up.
Yes, the engine for Google Apps Script has all kind of limitations in terms of the number of callbacks you can make, the amount of time that can be spent on executing your script, etc. Our experience is that you should keep your code as small as possible and modularize things that might take a long time. If you're using your code in combination with a spreadsheet, use the spreadsheet as a container for storing the result of intermediate steps, and break your code into multiple scripts that will call each other once they're done. It will make your code more complex, but it will work a lot more reliably. And if your code is doing things which Google Apps Script was never designed for, move the code outside, to Google App Engine or another container (especially if you need server-side JavaScript).