why google app engine doesn't delete my version? - google-app-engine

I have a problem deleting app engine version.
In my Google app engine console, under the section "app engine"->"Version" I have different version of the same project. I delete one of these, i.e. test.myapp.appspot.com. and I can't see this version anymore in the list of the versions.
But if I try to make a call to an API of this version I have a response like this is still alive.
How can I completely delete this version? Like I never deploy it...

App Engine automatically redirects to the default version if the version you're navigating to isn't known (or has been deleted).
E.g.
If you're default version is:
https://1-0-0-dot-yourapp.appspot.com/
And you navigate to:
https://foo-dot-yourapp.appspot.com/
It'll automatically load the default version of the app (and not render a 500 error), despite the url showing https://foo-dot-yourapp.appspot.com/

Related

Is there a URL for the latest version of a google cloud app engine deploy?

I've recently done a UI update for my website, the backend is all identical. I want to access the latest deploy (with the no-promote flag) from 'beta.my-website.com' but still access the 'normal' site from 'my-website.com'. Ideally this would dynamically serve the latest version, but if not could I set it statically to the URL with project ID? I have bought my domain from 123reg. Is there a way to direct to the latest version regardless of it's traffic serving status?
TL;DR Can you set up a 'beta' site at beta.mywebsite.com while still being able to access the live version on www.mywebsite.com on google cloud?
Any help would be greatly appreciated.
Thanks!
I don't think that can be done like that.
You could deploy to a different appengine project by putting a different project id and then have beta.mywebsite.com route to that project instead. The nice thing about this option is everything else would be isolated (i.e. no chance of your beta changes causing bad data in your production database, or tasks in your queues)
Another option would be to deploy to a different service within your project and use your dispatch.yaml to route beta.mywebsite.com to it https://cloud.google.com/appengine/docs/standard/python3/reference/dispatch-yaml
A third option would be to put beta as your version-id, and have your DNS redirect beta.mywebsite.com to beta-dot-your_project_id.appspot.com. However, when the user goes to beta.mywebsite.com they would ultimately see beta-dot-your_project_id.appspot.com in the URL bar. Also, when you're ready to go live, you would want to redeploy and promote that new version id and not promote the beta version-id.

google app engine: how to run different version

Suppose I uploaded another version (say, "version: 2" in file app.yaml ) of my Google App Engine application. Version 1 is still the default and version 2 is for testing. How do I run it then?
Once you upload a version on Appengine, you can switch between them easily.
Say that your app name is myapp, currently running version 1. You also have uploaded a version called 2-testing. Your default app (with version 1) can be reached by accessing myapp.appspot.com
If you wanted to access your versions explicitly, you joust need to access <version_name>-dot-myapp.appspot.com. Following the example it would be:
1-dot-myapp.appspot.com or 2-testing-dot-myapp.appspot.com
The -dot- is equivalent to <version>.<appname> but allows you to correctly serve a secure application with SSL
You can mark any version you want as default (serving myapp.appspot.com) using the admin console
edit: this is the official documentation page talking about domains and subdomains in Appengine
Under versions in your admin console you can find the live uri of a version, if you select the version.
And you can use traffic splitting, where you can use your own client ip or a cookie to test a version.
Docs: https://developers.google.com/appengine/docs/adminconsole/trafficsplitting

Google App Engine not updating deployed files

I'm getting some strange issues with google app engine serving old versions of files. I have included some logging in one of my servlets and deployed to google app engine several times over the last 24 hours. However, instead of seeing the logging i added, I'm seeing logs from a previous version of the file every time the servlet runs.
I've tried changing versions and redeploying but this doesnt seem to fix the problem.
I'm using Eclipse Juno with the app engine plugin if that makes a difference.
Any ideas what I can try or what I might be doing wrong?
I had a similar problem recently, and that I fixed by logging into appengine.google.com>MyAppIdentifier>(Main)>Versions and selecting the current version as the default.
This should not only serve your latest version, but also use the latest version for log viewing and other administrative tasks.
In the logs, make sure that you're checking the correct version:
Otherwise redeploy to a brand new version and check that version explicitly directly from the version url that can be found under the Versions section.
Make sure that before redeploying your APP after making changes you Remove Launch and Remove All Terminated launches by pressing the double cross buttons next to the "clear console" buttons on the console window in Eclipse...I hope this solve your problem.
December 2020 Answer
Not sure if this is an account or billing specific setting, but I found that App Engine started not updating to my latest app deploy once I reached 50 Versions in my App Engine list.
After deleting a bunch of old versions (taking down to 30) on next deploy it picked up my latest changes immediately.
It could be due to caching issue. Try reloading the website by adding a query parameter . Eg <website-url>?q=1 and see if changes are reflected
Open the url -> latest-version-number-dot-website-url . Latest version number can be obtained by clicking on version menu item on the side bar as seen below
If you have app.yaml file in your source code. Try removing headers related to caching and deploy and check to confirm its a caching issue. Caching headers could be of below form
Cache-Control: public, max-age=604800, immutable
Also make sure your project compiles correctly and doesn't contain any errors. I had this problem basically because I was deploying old compiled code, while it gave me an error "you have errors in your project, are you sure you want to deploy?"
I tried all the suggestions on SO, but ultimately, I found the best fix.
Because I transferred domain names and web hosting, I neglected to change my Domain's Resource Records. After making sure my code worked properly with the application (appname.appspot.com), I created a Custom Domain found in Console menu > App Engine > Settings > Custom domains
After you add the custom domain, make sure you change your Domain setting's CNAME www alias to the prescribed value (for me it was ghs.googlehosted.com).
Since changing that CNAME value, all of my subsequent deploys updated immediately. Hope this works for you and all others. Happy coding!
The gcloud (at list in python) has problem with line 'skip_files' in app.yaml,
So you can try the old method of deploying app with app engine,
use appcfg.py instead of gcloud.
see how in https://cloud.google.com/appengine/docs/standard/python/tools/uploadinganapp

What is the difference between version.myappid.appspot.com and version.latest.myappid.appspot.com?

The Google App Engine documentation says that the URL to access a specific version of an app deployed is .latest..appspot.com. The GAE admin webpage however links to ..appspot.com in the Versions tab and omits the 'latest'.
Any idea what that 'latest' is for? Is it actually not needed? Is omitting it not taking you the latest code deployed for that specific version?
References:
https://developers.google.com/appengine/docs/java/config/appconfig
The *.latest.app.appspot.com convention was originally the only way to access a specific version of your app. This was changed to simply accessing them directly as subdomains a while ago; latest was kept as a special case so as not to break old URLs.

Google AppEngine only deploys first version

I just changed my app.yaml to a new version number before deploying to AppEngine. Everything appeared to be working fine, but when I visit the website on appspot.com it still shows the old version, and https://appengine.google.com/ shows that version 1 is still the live version. What do I do to make it deploy my new version?
You need to set the default version in the application's Dashboard.
To see a non-default version the URL is http://<version>.latest.<appname>.appspot.com/.
Also, you can (and probably should) use text names for version labels instead of numbers.
Changing the version in your deployment descriptor (app.yaml) only uploads this new version, it does not set it as the default version. You set the default version in your Dashboard.
Go to your dashboard and make that particular version your default version. Feed the in this url to go to your dashboard: https://appengine.google.com/dashboard?&app_id=s~

Resources