3

I try to download the logs from my Google App Engines with the command:

appcfg.py request_logs [directory]  mylogs.txt

However, I encountered the server error as below:

C:\Program Files (x86)\Google\google_appengine>appcfg.py request_logs E:\PhD\cod
e\python\webDevelop\similarAPI\similarAPI/  mylogs.txt
05:22 PM Application: similarapi
05:22 PM Host: appengine.google.com
05:22 PM Downloading request logs for app similarapi version 1.
Error 500: --- begin server output ---


Server Error (500)

A server error has occurred.
--- end server output ---

I have looked at the official document and related Stack Overflow questions, but no clues are found. Actually I can get the logs in Dec, 2016 but not now. And I tried it for one week without the success, so it should not be the error of Google's infrastructure.

Does anyone know how to solve that problem? Thanks in advance.

Community
  • 1
  • 1
ccy
  • 1,735
  • 16
  • 19

2 Answers2

1

Just a workaround, not a direct answer.

The GAE SDK might be getting a bit less attention compared to the cloud SDK (which is the recommended one lately). I, for one, can't even get as far as you got since appcfg.py request_logs can't properly detect my multi-service app from its directory and was not happy with any syntax attempt I made to specify it via args.

But I have the cloud SDK installed as well and I was able to get the logs for my app using gcloud app logs read (after setting up the gcloud context for my app)

FWIW, this isn't yet enough to make me switch, I'm still primarily a GAE SDK user. YMMV.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • Thanks for your answer. I tried to download the gcloud SDK and when running "gcloud app logs read --logs=request_log", it works. But the log is not detailed i.e., there is no IP address of the request log. Do you know how to get the IP address of the request log? In addition, it seems that it can only download the lastest 22739 logs. How to download more? Thanks in advance. – ccy Apr 06 '17 at 08:32
  • Only via the developer console, from the Stackdriver log viewer. Or by reading them programmatically https://cloud.google.com/appengine/docs/standard/python/logs/#reading_logs_via_api. Or by exporting them to a processing unit: https://cloud.google.com/logging/docs/export/configure_export_v2 – Dan Cornilescu Apr 06 '17 at 12:34
0

Finally, it has be proved that it is a bug of Google's infrastructure from 22 Mar to 10 Apr, 2017. Three related bug reports can be seen in the Google Issue Tracker 36637246, 37192011, 36969442.

Now the command appcfg.py request_logs [directory] mylogs.txt works well.

ccy
  • 1,735
  • 16
  • 19