2

I deployed a small servlet to a managed VM on App Engine that creates a zip archive with files from Google Cloud Storage. The same code works fine in App Engine instance, but when deployed to a managed VM the client gets 502 Bad gateway response.

When I replace code in this servlet with a simple:

resp.getWriter().println("Testing empty servlet");

it works as expected. Also, my log statements show that the original code is executed correctly: it reads entities from the Datastore, retrieves files from Cloud storage, and writes their content to response's OutputStream. So, everything works, except the browser gets this 502 error.

Anyone knows how to resolve this?

enter image description here

Andrei Volgin
  • 40,755
  • 6
  • 49
  • 58
  • Are you getting anything else out of cloud logging? http://i.imgur.com/fxWXIfd.png – Justin Beckwith Jan 20 '16 at 00:18
  • Cloud logging shows 502 response, which, surprisingly, is not marked as error or warning. There is no body in this log record. I added screenshot of the log message to my question. – Andrei Volgin Jan 20 '16 at 02:08
  • Yeah - logging is confusing :/ Which logs do you have available? I added an image link up there with a dropdown. Do you see a stderr, or a crash.log? – Justin Beckwith Jan 20 '16 at 03:03
  • `request` log shows response 200 with the content length set by my code - so my code does what it is supposed to do. `request_log` log (???) shows code 502. Nothing in stderr or stdout since deploy. – Andrei Volgin Jan 20 '16 at 03:16
  • Out of curiosity are you using OAuth2? I have the same issue with NodejS and App Engine Flexible environment. – raz3r Apr 04 '16 at 07:58
  • I was using default credentials. I had to abandon this approach, because managed VMs (aka flexible environment now) do not support file streaming. – Andrei Volgin Apr 04 '16 at 16:07
  • Hey, have a look at this group post, the last answer may be what you are looking for: https://groups.google.com/forum/#!topic/google-appengine/HEH9pjbuvog – Flame_Phoenix Apr 06 '17 at 10:59

0 Answers0