Google App engine standard environment /_ah/upload/ is failing with HTTP 503 - google-app-engine

Our production App engine standard environment Java 8 application is facing error when uploading files. This used to work until yesterday but started seeing HTTP 503 error in response to https://.appspot.com/_ah/upload/<upload_key>
Is there any service down specific to _ah/upload ??
Our file upload process.
String uploadUrl = com.google.appengine.api.blobstore.BlobstoreServiceFactory.getBlobstoreService().createUploadUrl(uploadCallBackUrl); // returns an upload url of the form https://.appspot.com/_ah/upload/AMmfu6aRaNw4HRDt9eS1d6crhKjxyEZ6aPCUrBE-0O8MftAY5BMzRw3kZkkCsqq5MJLDBfhWdZlVTKdfKuxBuD3QZDgZsRbUlx6QTD-B6MbJfTslohO7vcbBQet2I3kVUC4qAPwDSMHuI3lW6fvfbdehpz1pLYA88vlepiWgpHYEXtG8tqx5_MI/ALBNUaYAAAAAYEHvj10qLujApjnqp16MCEdnZecmQh1F/
File upload from browser to the url returned in step#1
I know we are using blobstore api, but this is legacy application which used to successfully upload files until yesterday.
Any help in this regard is highly appreciated.
Update Moments later the service is working normally again. This must be a blip internal to GCP.

Best thing to do is to check if Google set a deprecation date for usig Blobstore API and whether that date has been reached.

Related

ReactS3Client library 403 forbidden error on post to S3 bucket

I am using the ReactS3Client and I am having issues with uploading to a bucket. I have all the config files ready. I am using a 3rd party library that allows a user to upload media to a designated cloud server, that being S3. Everything works good on iOS side for the configuration and I am able to upload accordingly. For that, I am using AmplifyCLI.
The error I am getting is: POST BUCKETURL 403 (Forbidden)
On the S3 side, I configured the following -- S3 bucket policy config
I know the error stems from the S3 CORS policy. Ive tried making the bucket public and editing the policy to allow all sorts of requests, but I'm still receiving the 403 forbidden error.
Any help would be really appreciated.

HTTP Error 500 when upload file to Google Drive via API V3

I have a production app that running almost one year to regularly upload file from Google App Engine (python) to Google Drive using Google Drive API v3.
but today I received lots of error HTTP Error 500.
here's my app engine log:
12:44:44.296 Refreshing access_token
12:44:44.985 An error occurred: <HttpError 500 when requesting https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&alt=json returned "Internal Error">
12:44:45.054 URL being requested: POST https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&alt=json (/base/data/home/apps/s~xxx/1.zzz/lib/python2.7/site-packages/googleapiclient/discovery.py:863)
any clue how to fix this error?
is the problem on my side or on Google Drive API side?
any help appreciated. thank you.
the problem in this error is on Google Drive side. i had the same error . but when i reduce my file size , the error does not appear again.

Is it possible to delete data from Firebase by invoking servlets using Google App Engine cron jobs?

I have developed a simple chat application using AngularJs and Firebase. I have hosted this application on the Google app engine platform. Now, I want to delete the Firebase database containing chat messages on a schedule (every night).
Is there any way to achieve this using a servlet, so that it can be invoked as a cron job? Thanks.
PS: The firebase documentation has been given only for Android and I am new to this. SO, specifically looking for servlet code.
It's not entirely clear from your question or description what you need assistance with. This answer assumes you'd like a daily cron job to send a request to an App Engine handler which then deletes data from a Firebase database.
From the documentation, Firebase has a REST API. Therefore, data can be added, removed and updated using standard HTTP requests (GET, PUT, POST, PATCH, DELETE). Any application capable of issuing HTTP requests can make changes to the data when properly authenticated and authorized.
Given your request to use a cron job and Java servlet on App Engine, I'd advise the following:
Define a cron job that issues requests to a specific URL in your cron.xml
<cron>
<url>/firebase_cleanup</url>
<description>Delete all chat messages of the day</description>
<schedule>every day 23:00</schedule>
</cron>
Deploy a servlet that will handle such requests and issue the appropriate HTTP request to Firebase. In your case, it should issue a DELETE request. This can be done using HttpURLConnection.
URL url = new URL("firebase-url-formatted-for-delete-request");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("DELETE");
int responseCode = connection.getResponseCode();
// Act upon responseCode accordingly
Note that the above servlet code does not include the authentication you'll need to issue the DELETE request. That will require your Firebase secret or a generated token. As I do not have a Firebase account, I cannot test the above so it will likely require some modifications.

GAE cloud endpoints - Api not updating after deploy

I'm starting to use cloud endpoints in my GAE project but have been running into issues with the api not updating on the server.
localhost:8888/_ah/api/explorer is ok.
But when I deploy, nothing changes.
myapp.appspot.com:8888/_ah/api/explorer is bad
Further investigation shows the url end points update
example: https://myapp.appspot.com/_ah/api/myapp/v1/foo/list
But the loaded client api is still incorrect.
example: gapi.client.load('myapp', 'v1', callback, url);
gapi.client.myapp.foo.list();
If I changed the call from foo/list to foo/list2, the rest url would update, the api package would not.
I'll try to cover the two cases people could run into:
Client Side:
The Google APIs Explorer web app aggressively caches, so you'll need to clear your cache or force a refresh when you update your API server side to see the changes in the client.
Server Side (In Deployed Production App Engine App):
If you're having deployment issues, there are two places to look when debugging:
Check your Admin Logs (https://appengine.google.com/adminlogs?&app_id=s~YOUR-APP-ID) after deployment. After a successful deployment of your application code, you should see the message:
Completed update of a new default version
and shortly after that you should see:
Successfully updated API configuration
If you this message indicates the API configuration update failed, you should deploy again. If said error is persistent, you should notify us of a bug. If you don't see any message about your API configuration, you should check that the path /_ah/spi/.* is explicitly named in your routing config (app.yaml for Python, web.xml for Java).
Check your Application Logs (https://appengine.google.com/logs?&app_id=s~YOUR-APP-ID) after deployment. After the deployment finishes, Google's API infrastructure makes a request to /_ah/spi/BackendService.getApiConfigs in your application so that your API configuration (as JSON) can be registered with Google's API infrastructure and all the discovery-related configs can be created. If this request does not complete with a 200, then your API changes will not show up since Google's API infrastructure will have nothing to register.
If you are consistently getting a 302 redirect for requests to /_ah/spi/BackendService.getApiConfigs, it is because you (or your generated API config) have specified a "bns adapter" that uses http: as the protocol in your API root, but your web.xml (Java) or app.yaml (Python) is required that paths through /_ah/spi are secure. This will make requests using http: as the protocol be redirected (using 302) to the same page with https: as the protocol. This was discussed on the Trusted Tester forum before going to Experimental.
This is what happened to me.
I tested my endpoint on localhost and it worked fine.
I deployed my endpoint on appspot and when I made requests to it I received in the browser the message 'Not found'.
So I looked in the logs and when I made requests to the endpoint I saw a 404 http error code on favicon file. And in effects I forgot to put that file in my deploy.
So I redeployed my war with the favicon file, the 404 http code disappeared and the endpoint worked fine on appspot too!
I realize that this may sound silly, but it is what I experienced. (I apologize for my poor english)
I noticed that if you upload your app for the first time without the following in your web.xml:
<security-constraint>
<web-resource-collection>
<url-pattern>/_ah/spi/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Then your bns adapter will be set as http going forward. When I add the above afterwards, I get 302 http code on /_ah/spi/BackendService.getApiConfigs and the endpoints never update.
So now I have reverted to not use https on /_ah/spi and my endpoints are updating. I guess for those that see their endpoints not being updated revert back to the first configuration they had for ssl on /_ah/spi/.
Yaw.
I had the same error Not Found (the 404 error code) when I was calling my API using this URL
https: // MY_APP_ID.appspot.com / _ah / api / MY_SERVICE / v1 / user
I tried everything and finally fixed it by removing the discovery files from WEB-INF and kept only MY_SERVICE-v1.api and then redeployed the API. It works fine now.
I was also getting stale API discovery doc after deploying new version, it took a couple of minutes for GAE to start serving the new one to me.
I had the same problem, and I checked the admin logs, other logs etc... but still my API wasn't updating to the latest version.
So I decided to check in the API code for the last method I had written (I am writing in Java 7). And I found out that GAE doesn't like statements like:
if (!blocked){ .... }
I switched that to:
if (blocked == false) { ... }
And it worked like a charm. So by the looks of it, GAE scans the new API methods and doesn't accept some shortcuts.

Why is urlfetch throwing Download Errors when calling some Google services?

I've noticed that some Google services are blocking requests from App Engine servers, resulting in a urlfetch DownloadError. An example would be a feedproxy.google.com url (http://feedproxy.google.com/~r/blabbermouth/~3/cAk78LX4gJE/news.aspx, for example).
This occurs on all the apps I've tried it on, including app IDs I've never used for any kind of url fetching before. This behavior also doesn't occur on the local SDK. This leads me to believe that this is a result of using any GAE IP address when making the request.
The weird thing is that it results in the throwing of a DownloadError, instead of an error status_code in the successfully retrieved response. Using urlfetch or httplib locally works just fine, so this DownloadError I don't yet grok, or it's just a bug, in which case I'll file a ticket.
Without having a look at your code I will be guessing but since the URL that you are following is a going to redirect are you allowing redirects in your call? Note the follow_redirects=True
e.g. urlfetch.fetch(url, payload=None, method=GET, headers={}, allow_truncated=False, follow_redirects=True, deadline=None)
http://code.google.com/appengine/docs/python/urlfetch/fetchfunction.html

Resources