How to join Google App Engine's logging table in BigQuery with Error Reporting - google-app-engine

Google App Engine (GAE) creates a table for each day of logging with lines containing several logs information, such as "status" (e.g.: 500, 404), etc.
Yet, this table does not contain the Resolution Status for the errors in Error Reporting. E.g.:
At the moment, I would like to get how many "Acknowledged" errors happen per day. I can get which errors happen per day through the appengine_googleapis_com_request_log_* (e.g.: appengine_googleapis_com_request_log_20211130). However, I don't know how can I get if the error is Acknowledged or Open.
Does anyone know how can I combine those information, or at least if Error Reporting saves its information in any BigQuery table?

Reviewing Google documentation to help with your question, apparently, it is impossible to get the resolution status.
You can view your errors on the Error Reporting page of your GCP Console, which displays a list of all errors in the order of frequency. Errors with the same root cause are grouped together. The error reporting list provides the following information for all reported errors:
Resolution status
Occurrences
Users
Error
Seen in
First seen
Last seen
Response code
In case you would like to have more information, you can review the viewing error documentation.
Now, as I said, there is no way to get the resolution status; however, what you can try to do is a feature request.
Here is some documentation that shows what you can get with the API, it could help you with the feature request.
https://cloud.google.com/support/docs/issue-trackers
https://cloud.google.com/error-reporting/reference/rest/v1beta1/ErrorEvent
Additionally, here is a link I found regarding the Error Processing and Log Monitoring documentation using GCP.

Related

Google App Engine login fails with error 500

I have an appengine (Java) app with the ability to sign in via Google. For this I use
UserServiceFactory.getUserService().createLoginURL(...).
This has been working fine so far, and still works well locally (using mvn appengine:run) but on production it consistently throws a generic 500 while on /_ah/conflogin?state=~AJKiYcHHHXI45-... (the 5th URL of the login process, while already being logged in with Google) and I can find nothing relevant in the Logs Explorer at https://console.cloud.google.com/logs/...
I've since even updated to the latest https://mvnrepository.com/artifact/com.google.appengine/appengine-api-1.0-sdk/2.0.10 but the problem remains.
Where should I look at to solve this issue?
To find the root cause of this issue, you can find the logs for this error will be helpful.
In this documentation there is a sample query that you could try to check for logs error with status 500.
resource.type="gae_app" AND
log_id("appengine.googleapis.com/request_log") AND
httpRequest.status>=500
Alternatively you could also try running ‘gcloud app logs read’ as mentioned in this document to see if you get any logs.
The issue tracker mentioned by Rez in comment is marked as Fixed and after checking your issue I think it also relates to the same issue tracker. As it closed I suggest to get your issue resolved I recommend to raise new issue tracker by referencing the fixed one or else you may raise support ticket with google

Google Error Reporting does not correlate to parent http request

I'm using Google App Engine Standard with Python 3. When i click on an error in Google Error Reporting and then click "View Logs", I get taken to Google Logs Viewer/Explorer with something like this error_group("CObpg_HTfjskb6GA") as a search filter.
I see the individual log line with the stacktrace but not any logs for the parent request for which this occurred.
In the docs, they have a screenshot where it does look like we should be able to see the parent http request in which the error occurred: https://cloud.google.com/error-reporting/docs/viewing-errors#view_associated_log_entries
Right now when I need to look into an error, I have to do a separate search in logs explorer with part of the error message (in the case of the above example I'd search for "KeyError: 'c'") to find a duplicate log that has a trace id set. Then I'd be able to 'show all logs for trace' and be able to finally see all the logs that lead up to this error.
This feels related to this other issue from before, where logs in general in python3 were not getting correlated like they were in python2: How to group related request log entries GAE python 3.7 standard env
Logs now get grouped together via trace, but as far as I can tell, I cannot set trace on error report logs.
I have my logging setup by doing:
client = google.cloud.logging.Client()
client.setup_logging()
For error reporting I was just getting error reports from google.cloud.logging's integration with the python logger:
try:
# code where an error occurs
except Exception as exc:
logging.exception(exc)
raise
I've now started trying to use google-cloud-error-reporting to see if maybe there are some options in there that I can set to get it to correlate, but I seem to only be able to set a HttpContext & ReportingLocation. There isnt a spot for me to set trace or anything like that.

I have got "403 Forbidden" using custom search engine on payed account

I am trying to use google search engine via python script. It was working fine at the beginning but later I have got "HTTP Error 403: Forbidden". I thing it is due to 100 requests per day limitation. But I have payed account and billing support told me that everyting is ok. Is it possible somehow to solve this problesm?
Thanks, Ilia
There are lot of reasons for which API will throw Error 403. You can find them all here : GOOGLE DOC FOR 403 Forbidden
Your 403 error might indicate that the API key you are using may have lost it's permissions, or that the quota of your API requests may have been exceeded and the new quota (The one you have when you already have a billing account) might not have been updated.
I assume you are using this API; If not, don't worry, the following advice might also help you.
You first need to see if your API key is still working or you might want to generate new ones. You can do this here. Your code should make reference to the new API Key file.
If it is not the case then you should wait a little bit until your Billing account is updated and the quota gets readjusted. You can read a bit more about how to monitor the requests to your APIs here.
You can always find more help with your particular issue if you describe a little the symptoms and your attempts or hypothesis to solve it.
At last you may find more info on the community page of the API.

Realtime document permanantly unable to be loaded due to server error

Earlier today we started to see instances of server errors popping up on an old realtime document. This is a persistent error and the end result appears to be that the document is completely inaccessible using the gapi.drive.realtime.load endpoint. Not great.
However the same document is accessible through the gapi.client.drive.realtime.get endpoint. Which is great for data recovery, but not so great for actually using the document. It's possible I can 'fix' the document by doing a 'drive.realtime.update', but haven't tried as hopefully the doc can be used to track down the bug.
Document ID: 0B9I5WUIeAEJ1Y3NLQnpqQWVlX1U
App ID: 597847337936
500 Error Message: "Document was not successfully migrated to new UserKey format"
Anyone else seeing this issue? Can I provide any additional information?

Invalid and/or missing SSL certificate when using Google App Engine

UPDATE: Please, if anyone can help: Google is waiting for inputs and examples of this problem on their bug tracking tool. If you have reproducible steps for this issue, please share them on: https://code.google.com/p/googleappengine/issues/detail?id=10937
I'm trying to fetch data from the StackExchange API using a Google App Engine backend. As you may know, some of StackExchange's APIs are site-specific, requiring developers to run queries against every site the user is registered in.
So, here's my backend code for fetching timeline data from these sites. The feed_info_site variable holds the StackExchange site name (such as 'security', 'serverfault', etc.).
data = json.loads(urllib.urlopen("%sme/timeline?%s" %
(self.API_BASE_URL, urllib.urlencode({"pagesize": 100,
"fromdate": se_since_timestamp, "filter": "!9WWBR
(nmw", "site": feed_info_site, "access_token":
decrypt(self.API_ACCESS_TOKEN_SECRET, self.access_token), "key":
self.API_APP_KEY}))).read())
for item in data['items']:
... # code for parsing timeline items
When running this query on all sites except Stack Overflow, everything works OK. What's weird is, when the feed_info_site variable is set to 'stackoverflow', I get the following error from Google App Engine:
HTTPException: Invalid and/or missing SSL certificate for URL:
https://api.stackexchange.com/2.2/me/timeline?
filter=%219WWBR%28nmw&access_token=
<ACCESS_TOKEN_REMOVED>&fromdate=1&pagesize=100&key=
<API_KEY_REMOVED>&site=stackoverflow
Of course, if I run the same query in Safari, I get the JSON results I'm expecting from the API. So the problem really lies in Google's URLfetch service. I found several topics here on Stack Overflow related to similar HTTPS/SSL exceptions, but no accepted answer solved my problems. I tried removing cacerts.txt files. I also tried making the call with validate_certificate=False, with no success.
I think the problem is not strictly related to HTTPS/SSL. If so, how would you explain that changing a single API parameter would make the request to fail?
Wait for the next update to the app engine (scheduled one soon) then update.
Replace browserid.org/verify with another service (verifier.loogin.persona.org/verify is a good service hosted by Mozilla what could be used)
Make sure cacerts.txt doesnt exist (looks like you have sorted but just in-case :-) )
Attempt again
Good luck!
-Brendan
I was facing the same error, google has updated the app engine now, error resolved, please check the updated docs.

Resources