10

I have just started with GAE and I have already encountered problems on the way. When I deploy an app, it does not seem to be updating it and when I run it in the browser, it still runs the old version.

My simple code is:

import java.io.IOException;
import javax.servlet.http.*;

@SuppressWarnings("serial")
public class AppEngineProjectServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws IOException {
    resp.setContentType("text/html");
    resp.getWriter().println("<p>Hi there</p>");
}

}

I have created a new web application project in Eclipse and I got that code. I have just changed the text from 'Hello World' to 'Hi there' and when I deploy it, it still runs Hello World!

I also try changing versions of the app when deploying and setting the new version to default but nothing seems to work for me. Is there any particular reason why is that happening that I might have overlooked?

mechanical_meat
  • 163,903
  • 24
  • 228
  • 223
Adrian L
  • 443
  • 1
  • 8
  • 19
  • How are you deploying? Have you tried `CTRL+F5`? How about your Instances in your app admin panel? Are they showing the newest version? – Anthony Accioly Oct 16 '13 at 17:49
  • I'm facing the same issue. Whereas neither browser refresh nor setting the run configuration manually seems to work. Could you please help? @bernie – Balajee Venkatesh Apr 15 '18 at 17:18

2 Answers2

5

After a long chat session the OP problem has been solved.

Major points:

  1. Always test your app locally (using the Development Server) before deploying to the cloud
  2. Look out for browser caching issues (use Ctrl+F5 to refresh and discard local cache)
  3. If you want to mitigate the risk of breaking production, change the application version before deploying to the cloud
  4. After the deploy, check your application administrative console on GAE
    1. Under Administration -> Admin Logs check for a new entries like "Deployed a new version"
    2. Under Main -> Versions make sure to visit the recent deployed version Live URI [version].[app-name].appspot.com).
    3. Again, make sure that browser caching is not getting in the way (Ctrl+F5 is your friend)
  5. Also, to avoid runtime exceptions, if you updated your persistence layer in such a way that new indexes needs to be built, check Data -> Datastore Indexes to make sure that no index is still building (this can take hours or even days).
  6. When you are done testing (make sure that the Live URI version is working properly) just make the new version default (under Main -> Versions).
  7. It is advisable to do some A/B testing. GAE has a built in support for Traffic Splitting. Do not jump the gun and promote a new version to default before you are feeling 100% sure that it works as expected (200% actually). While you can always change the default version to a previous one, your users will not be happy if you rollback (trust me... been there, done that).
Community
  • 1
  • 1
Anthony Accioly
  • 21,918
  • 9
  • 70
  • 118
  • 1
    Useful, but please do say which item(s) actually answered the question: " Is there any particular reason why is that happening that I might have overlooked?" – ChrisJJ Nov 09 '16 at 15:21
  • "Administration -> Admin Logs" I don't see such an entry in/under the Google Cloud Platform menu. – ChrisJJ Nov 09 '16 at 15:26
  • "Main -> Versions" I don't see such an entry in/under the Google Cloud Platform menu. I do see App Engine -> Versions http://i.imgur.com/5vBFFDs.png – ChrisJJ Nov 09 '16 at 15:28
  • "Data -> Datastore Indexes" I don't see such an entry in/under the Google Cloud Platform menu. I do see Datastore -> Indexes http://i.imgur.com/sLgjF36.png – ChrisJJ Nov 09 '16 at 15:29
  • @ChrisJJ. This question was answered over 3 years ago and many things changed since then. If you have an specific doubt I encourage you to open a new question. – Anthony Accioly Nov 09 '16 at 21:47
4

If you want to see your changes immediately after uploading, change the application's version, then change the default in the admin console.

When you update, App Engine doesn't immediately hunt down and restart all of your instances. Such a thing would be traumatic for the users of large apps with many instances, especially when that app's instances are slow to start up.

Dave W. Smith
  • 24,318
  • 4
  • 40
  • 46