AppEngine Cloud EndPoint 404 Not Found with version 2 of my App - google-app-engine

I have deployed a new version of my App that contains a new cloud endpoint.
I have made the new version the default version.
I have even deleted the old version (version 1).
If I try to hit https://<myappid>.appspot.com/_ah/api/ then I get a
404 Not Found.
If I try to hit https://2-dot-<myappid>.appspot.com/_ah/api/ then
my request gets served.
It's been a full 24 hours since I uploaded version 2. And more than an hour since I marked version 2 as default and deleted version 1, but I'm still getting the 404.
I don't want to ship my client explicitly pointing to 2-dot-<myappid> as this locks the client to a particular version.
Any ideas on what is going wrong?

Cloud Console currently doesn't automatically update Endpoints when changing app versions. You need to use the old App Engine Admin Console to make it update. So, I suggest trying switching versions to another version and switching back immediately. It should fix it for you.
Upload a new major version of your app. This can be identical to your current default version, which just the version name changed.
Visit the App Engine Admin Console and select your project.
Click Versions.
Change the default version to the one you just deployed.
Change the default version back to the one it just was.
At this point, the default domain should be working for you.

how about trying "https://xandar-wordgame.appspot.com/_ah/api/explorer",it may redirect the page to api-explorer where you can explore your api.
Others:
I've also encountered the same problem. but then I realized I have not changed the javascript code that load the api client. I changed the version in java annotation , but forgot to change the gapi.client.load(_apiName, _version, _your_call_back_function,_apiRoot) in web client .
Hope it will help.

Related

Handle PWA update with API changes

I have a PWA built with ReactJS and I have the NetworkFirst policy handled by Workbox, so when I update the front, the service worker detects a new version and download it in the background and this new version is applied only in two cases: when the browser is closed and opened or after 24 hours.
The problem comes when I need to change something in the API (django), for example I change the name of an endpoint and I need to change in the front too. When that happens, I make the release in both, front and back, but with the PWA if it last one day to make the update, during this day the app will be doing calls to an "old" endpoint so it will not work.
I would like to know how to handle this, a newer version of the API when the PWA is not updated yet, or if it is posible to force an update of the PWA when required.
Thank you in advance!
Only make backwards compatible changes to the API. For example you have API v1 (example.com/api/v1/endpoint) deployed, deploy v2 (example.com/api/v2/endpoint) and new frontend that uses API v2. After some time has passed and usage of API v1 has stopped, delete it and have a new backend deploy.

Why doesn't the code on Heroku get updated after updating the code on GitHub?

I'm making a simple TODO app and want to upload it to HEROKU.
But after I updated the code on Github, heroku code remained the same.
I've tried this and this and the other answers but nothing changed.
Site Code
Code on github here. As you can see console.log() on site has not disappeared
Heroku site
I even tried to re-create the app on Heroku but it didn't work.
Heroku's GitHub integration has been disabled for over a month as part of a security response. It appears that it will remain disabled for another week or so:
Based on current progress, we plan to complete our investigation by May 30, 2022
…
We know you are waiting for us to re-enable our integration with GitHub, and we've committed to you that we will only do so following a security review. We will post more information to status.heroku.com when it is available.
You should have received emails about this from Salesforce (Heroku's parent company) on or around April 15 and May 4, 2022.
At the moment, your only option is to deploy using some other method. See this question for more details. The answers there suggest some alternative ways to deploy your code.
(Your Heroku password was also forcefully reset; if you have not yet changed it you'll need to do that when you log back in.)

Google App engine Go Runtime still serving the old code

I first deployed Go runtime Guest book application a week ago on App-engine . I replaced it with Hello-world Go app . The deployment was successfull with the log as seen in the screenshot below
. But the new code deployed hasnt yet been updated . When i visit the url (myapp-xxx.appspot.com) it still serves the old template page instead of just printing hello world . The new Routes are also not working . I uploaded the version 2 of the app and versions page of the app engine on developers console still shows the old version which i had first uploaded a week ago . Its hampering my development time , How long does it take to just update my changes in the code ??
Just to put it as an answer, here is what Jeff Deskins said :
As soon as the deploy script finishes - your app should be updated with the latest changes and ready for viewing. Go to the admin console under versions to see the versions that are uploaded. If uploading a new version number, you can prepend that value to the url. [VERSION].[APPID].appspot.com

_ah/warmup requests coming with hosts prefixed with app version

I am using the warmup service to carry out precaching/etc. The request gets called with self.request.host being prefixed with a version of the app.
All other handler requests are coming with the expected host name for the app.
So if the app name is myapp - then all requests are called with self.request.host set to myapp.appspot.com, whereas for "_ah/warmup" call it is getting set to nnn.myapp.appspot.com.
My code is expecting the self.request.host to be always 'myapp.appspot.com'. Is this by design or am I missing something.
Thanks.
I think this is by design because the warmup service is for a specific version. All other requests are going straight to your main app URL, which is just "aliased" to whatever version happens to be the default version at the time.
By the way, it is documented that you can access all deployed versions of your app by prefixing the version number to the domain name, so you should be aware that any users could access any version if they know about this, and if you haven't taken countermeasures! So you should definitely support this - it's an official feature of App Engine.

GAE data download shows datastore_errors.BadRequestError

I'm trying to download data from my Google App Engine app, using the official instructions
Remote API is set up & I call:
appcfg.py download_data --application=appname --url=http://app.address.com/_ah/remote_api --filename=alldata.csv
The connection is established, I'm being asked for my e-mail & password, and then a long trace appears ending up with this:
google.appengine.api.datastore_errors.BadRequestError: app s~appname cannot access app appname's data
Any ideas?
If using the high-replication datastore, change the value passed to --application from appname to s~appname.
Found the problem - as an URL I was giving my own app's domain name instead of the 1.appname.appspot.com.
I ran into this same issue, but when attempting to use the remote API from a custom script as opposed to appcfg.py's bulk downloader.
This issue may have been addressed in more recent GAE SDK releases, but for various reasons I'm still using the older 1.7 release. I found the answer in this bug report: https://code.google.com/p/googleappengine/issues/detail?id=4374
Basically, when calling ConfigureRemoteApi, don't specify the APP_ID argument (just pass None) and specify your app ID via the host argument, e.g. 'myapp-hrd.appspot.com'. ConfigureRemoteApi will figure out your app ID correctly and won't add the 's~' that causes this problem.

Resources