4

I've deployed newer versions of a google appengine app but they always return HTTP status code 500, 'The server encountered an error and could not complete your request.

Please try again in 30 seconds.' Needless to say I've waited much more than that and it still does the same thing. There is nothing in the logs to indicate what might be the issue, and I've put logging statements in my doGet, doPost, etc. methods and they don't appear in the logs, so I don't think it's getting as far as my servlet.

I could deploy it to a whole new app, but my existing app has data that I want to keep and I can't see a way of backing it up en masse and restoring it to the new app, or transferring it, or giving permissions to it. All google's documentation about inter-app backing up and restoring of data refers to the Data Store, not Cloud Storage.

Any help much appreciated.

BenTaylor
  • 191
  • 1
  • 6
  • You could give permission to the bucket of the "broken" app to another app and upload there? – Patrice Jul 08 '15 at 20:48
  • You would have thought so wouldn't you but I couldn't see a way to "give permissions" of one app's data to another. I got round it in the end by simply using new versions of the app, the existing client could still use the old version. – BenTaylor Jul 09 '15 at 07:50
  • You can with a bit of code and ACLS, using the service account associated with your new app : https://cloud.google.com/storage/docs/access-control#Signing-Strings – Patrice Jul 09 '15 at 14:02
  • ok, interesting. Cheers. – BenTaylor Jul 10 '15 at 07:02

2 Answers2

2

I just had the same problem yesterday.

I contacted Google support and this is what they told me:

These types of errors can come from many places. Such as a local firewall or proxy on your system. The issue could also be caused by a Google Server.

In my case it came from Google because we experience the same error from different computers located in different parts of the world.

The solution that Google suggests is to implement a retry. That is what I will do. However, I'm not very happy with GAE, they should prevent this kind of errors and others that I am experiencing.

  • I think the 'Try again in 30 seconds' is basically just their standard error message if a servlet returns a 500 error status if they don't know what else is the problem. I don't think you can take it as read that they have any reason to believe it will actually be ok in 30 seconds. I now know for a fact that it still shows that 'wait 30 seconds' message when it has actually made it into my servlet and it was my code that threw an exception. It's just choosing (for security reasons presumably) not to report the actual text/call stack of the exception. – BenTaylor Jul 10 '15 at 07:09
  • @BenTaylor then my problem is completely different. My API was working perfectly and suddenly, during a period of time of around an hour we started to get these kind of errors. If wasn't all the time though – Cookie Monster Jul 10 '15 at 07:11
  • FWIW as a coder some of the things I love about GAE is that you get authentication, https, etc for free, ease of deployment and its automatic versioning (once you've realised the correct syntax that is.) These things somewhat offset the fact in my view the administration page is a bit annoying and it can be quite hard to fathom out how to do some administrative tasks. I've found it is actually quite reliable - in this instance I was convinced the exception was coming from the infrastructure initially but it turns out it wasn't. Try posting other errors you've been having in another post? – BenTaylor Jul 10 '15 at 07:16
  • Oh, I see - intermittent errors after not changing anything I'd be more suspicious of it being the infrastructure. – BenTaylor Jul 10 '15 at 07:19
  • I posted several errors, like this one http://stackoverflow.com/questions/31324393/google-app-engine-gets-a-502-error-in-the-client or this one http://stackoverflow.com/questions/31287695/big-spikes-in-google-app-engine-caused-by-idle-time-between-internal-gae-calls or this one http://stackoverflow.com/questions/31066265/high-latency-in-urlfetch-with-google-app-engine. We just saw two more errors – Cookie Monster Jul 10 '15 at 07:41
  • I have the same error. Google support asked me to increase the size of my gAE instance. But then I dont understand why it works sometimes and doesnt work other times – Aseem Sep 15 '19 at 05:40
2

I've discovered the actual reason it was throwing a 500 error was because I was requesting a non-default version in the wrong way. e.g. I was trying to access version 5 using: http://5.myapp.appspot.com whereas this is not the right way to do it, the correct way should be: http://5-dot-myapp.appspot.com

the former URL was simply being handled by the existing version rather than throwing a not found error or giving a meaningful description.

BenTaylor
  • 191
  • 1
  • 6