Using the gcloud console for Google App Engine results in a runtime error from metrics

I am trying to use the gcloud console through a browser. When I clone my repository and start the dev server, I get a runtime error from the indicators:

$ dev_appserver.py $PWD Traceback (most recent call last): File "/google/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 101, in <module> _run_file(__file__, globals()) File "/google/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 97, in _run_file execfile(_PATHS.script_file(script_name), globals_) File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1041, in <module> main() File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1037, in main dev_server.stop() File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 845, in stop metrics.GetMetricsLogger().Stop() File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/metrics.py", line 117, in Stop total_run_time = int((Now() - self._start_time).total_seconds()) TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType' 

I do not call the metric module directly or use it in any other way. How to disable it in the console or in the code so that I can run the application normally?

It works fine locally through the SDK.

+5
source share
2 answers
Indicators

dev_appserver.py was recently added to the Cloud SDK version 144.0.0 for users who refused to install https://console.cloud.google.com , is also used to use these indicators.

In response to this message, we added additional logic to prevent this erroneous error message in the future. This update will appear in a future release.

+9
source

I got this working by resolving the problem in my app.yaml file, one of my routes was not specified correctly.

Fixing this route with a leading slash and avoiding the dot in the route regex also seems to fix the error:

 diff --git a/app.yaml b/app.yaml index 8a165a0..39c68b3 100644 --- a/app.yaml +++ b/app.yaml @@ -13,7 +13,7 @@ handlers: - url: /ui static_dir: ui -- url: robots.txt +- url: /robots\.txt$ static_files: robots.txt upload: robots.txt 
+2
source

Source: https://habr.com/ru/post/1264803/


All Articles