在GCP(应用程序引擎)上运行python Flask Restplus API的问题

问题描述 投票:2回答:1

我正在使用必须在GCP上运行的API Rest应用。该应用程序在本地运行良好,但是当我将其部署到GPC时无法正常工作。

[我用Python 3.7编写了Web服务,使用Flask,SQLAlchemy,Flask-SQLAlchemy,Flask-Restplus(以便使用Swagger)。

部署时我没有任何错误,但是当我要访问文档(麻烦的时候)时,出现“未提供Api定义”消息,并且当我尝试运行GET方法时,出现了(严重)工作程序超时错误。

我会很感激您能提供的任何帮助。

祝你有美好的一天!

以下是一些代码:

项目结构:

app.yaml
config.py
main.py
requirements.txt
apis/
     __init__.py
     log_resource.py
     trm_resource.py
     ...
marshal_models/
     __init__.py
     log_marshal.py
     trm_marshal.py
     ...
models/
     __init__.py
     log_model.py
     trm_model.py
     ...
res/
     __init__.py
     text_messages.py
     spa_exceptions.py

main.py

from flask import Flask, send_from_directory
from config import config_by_name

from flask_sqlalchemy import SQLAlchemy

from models import db
from apis import api

app = Flask(__name__)
app.config.from_object(config_by_name['prod'])

api.init_app(app)

db.init_app(app)

if __name__ == '__main__':
    app.run(debug=True)

requirements.txt

-i https://pypi.org/simple
aniso8601==8.0.0
attrs==19.3.0
click==7.0
flask-restplus==0.13.0
flask-sqlalchemy==2.4.1
flask-swagger-ui==3.20.9
flask==1.1.1
importlib-metadata==0.23 ; python_version < '3.8'
itsdangerous==1.1.0
jinja2==2.10.3
jsonschema==3.2.0
markupsafe==1.1.1
more-itertools==7.2.0
mysql-connector-python==8.0.18
mysqlclient==1.4.4
protobuf==3.10.0
pyrsistent==0.15.5
pytz==2019.3
simplejson==3.17.0
six==1.13.0
sqlalchemy==1.3.11
werkzeug==0.16.0
zipp==0.6.0
gunicorn==19.9.0

app.yaml

runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app

runtime_config:
  python_version: 3

config.py

class Config(object):
    DEBUG = False
    TESTING = False

    connection_type = 'gcp'  #tcp/ip
    DB_SERVER = 'XXX.XXX.XXX.XXX' 
    DB_USERNAME = 'XXXX' 
    DB_PASSWORD = 'XXXX' 
    DB_NAME = 'XXXXX'
    SQLALCHEMY_DATABASE_URI = f"mysql+mysqlconnector://{DB_USERNAME}:{DB_PASSWORD}@{DB_SERVER}/{DB_NAME}"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

class ProductionConfig(Config):
    pass

config_by_name = dict(
    dev = DevelopmentConfig,
    test = TestingConfig,
    prod = ProductionConfig
)

apis \ __ init __。py

from flask_restplus import Api
from .spa_system_resource import api as spa_name_space
from .stage_resource import api as stage_name_space
from .consolidated_resource import api as consolidated_name_space
from .cost_cat_resource import api as cost_cat_name_space
from .cost_resource import api as cost_name_space
from .log_resource import api as log_name_space
from .trm_resource import api as trm_name_space
from .energy_resource import api as energy_price_name_space

api = Api (
    title='API - Spa System',
    version='1.0',
    description='XXXXXX',
    contact='XXXXX',
    contact_email='XXXXXXXXXXX',
    contact_url='XXXXXXXX',
    default_mediatype='application/json',
)

api.add_namespace(spa_name_space)
api.add_namespace(stage_name_space)
api.add_namespace(consolidated_name_space)
api.add_namespace(cost_name_space)
api.add_namespace(cost_cat_name_space)
api.add_namespace(log_name_space)
api.add_namespace(trm_name_space)
api.add_namespace(energy_price_name_space)

一个资源文件的提取:apis \ log_resource.py

import datetime
from flask import current_app as app
from flask import Flask, request, jsonify, make_response
from flask_sqlalchemy import sqlalchemy

from flask_restplus import Namespace, Resource, reqparse, abort, fields
from werkzeug.exceptions import HTTPException

from res import DatabaseIntegrityError, DatabaseError, EngMsg as msg

from sqlalchemy.exc import SQLAlchemyError, IntegrityError
from models import Log, ModelList
from marshal_models import log_model_dict 

api = Namespace('logs', description=msg.API_NAMESPACE_LOG_DESCRIPTION)

log_model = api.model('log', log_model_dict)

@api.route('/<log_id>')
@api.doc(responses={ 200: msg.API_DOC_RESPONSES_200, 
                         400: msg.API_DOC_RESPONSES_400,
                         409: msg.API_DOC_RESPONSES_409, 
                         500: msg.API_DOC_RESPONSES_500 })
class LogRes(Resource):

    @api.doc(params={"log_id": msg.API_DOC_PARAMS_LOG_ID})
    @api.marshal_with(log_model, skip_none=True)
    def get(self, log_id):
        try:
            if log_id.isdigit():  
                return Log.query.get(log_id)
            else:
                app.logger.error(TypeError(msg.ERROR_TYPE_ERROR))
                return msg.API_DOC_RESPONSES_400, 400     
        except DatabaseIntegrityError as err:
            app.logger.error(err)
            return msg.API_DOC_RESPONSES_409, 409
        except HTTPException as err:
            app.logger.error(f'HTTException: {err}')
            return msg.API_DOC_RESPONSES_400, 400
        except (Exception, DatabaseError) as err:
            app.logger.error(err)
            return msg.API_DOC_RESPONSES_500, 500


    @api.doc(params={"log_id": msg.API_DOC_PARAMS_LOG_ID})
    @api.expect(log_model, validate=True)
    @api.marshal_with(log_model, skip_none=True)
    def put(self, log_id):
        try:
            if log_id.isdigit():  
                log = Log.query.get(log_id)
                if log:
                    log.update(api.payload)
                return log 
            else:
                app.logger.error(TypeError(msg.ERROR_TYPE_ERROR))
                return msg.API_DOC_RESPONSES_400, 400        
        except DatabaseIntegrityError as err:
            app.logger.error(err)
            return msg.API_DOC_RESPONSES_409, 409
        except HTTPException as err:
            app.logger.error(f'HTTException: {err}')
            return msg.API_DOC_RESPONSES_400, 400
        except (Exception, DatabaseError) as err:
            app.logger.error(err)
            return msg.API_DOC_RESPONSES_500, 500

    @api.doc(params={"log_id": msg.API_DOC_PARAMS_LOG_ID})
    @api.response(204, msg.API_DOC_RESPONSES_204)
    def delete(self, log_id):
        try:
            if log_id.isdigit():
                log = Log.query.get(log_id)
                if log:
                    log.delete()
                return msg.API_DOC_RESPONSES_204, 204
            else:
                app.logger.error(TypeError(msg.ERROR_TYPE_ERROR))
                return msg.API_DOC_RESPONSES_400, 400      
        except DatabaseIntegrityError as err:
            app.logger.error(err)
            return msg.API_DOC_RESPONSES_409, 409
        except HTTPException as err:
            app.logger.error(f'HTTException: {err}')
            return msg.API_DOC_RESPONSES_400, 400
        except (Exception, DatabaseError) as err:
            app.logger.error(err)
            return msg.API_DOC_RESPONSES_500, 500

浏览器中尝试调用GET方法的错误消息:

Error message when trying to call a GET method

gcp中的错误日志(2019年11月27日更新)

[
 {
   "textPayload": "[2019-11-27 12:45:27 +0000] [20] [INFO] Booting worker with pid: 20",
   "insertId": "5dde6fe70007e247c06a652a",
   "resource": {
     "type": "gae_app",
     "labels": {
       "version_id": "20191126t083944",
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318"
     }
   },
   "timestamp": "2019-11-27T12:45:27.516679Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T12:45:27.671289763Z"
 },
 {
   "textPayload": "[2019-11-27 12:45:26 +0000] [7] [CRITICAL] WORKER TIMEOUT (pid:19)",
   "insertId": "5dde6fe6000528928a3fd08e",
   "resource": {
     "type": "gae_app",
     "labels": {
       "version_id": "20191126t083944",
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318"
     }
   },
   "timestamp": "2019-11-27T12:45:26.338066Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T12:45:26.344938571Z"
 },
 {
   "protoPayload": {
     "@type": "type.googleapis.com/google.appengine.logging.v1.RequestLog",
     "appId": "p~maximal-beach-255318",
     "versionId": "20191126t083944",
     "requestId": "5dde6fc700ff0b4dadaec6e11e0001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "ip": "190.217.67.6",
     "startTime": "2019-11-27T12:44:55.740781Z",
     "endTime": "2019-11-27T12:45:27.355877Z",
     "latency": "31.615096s",
     "megaCycles": "662",
     "method": "GET",
     "resource": "/logs/",
     "httpVersion": "HTTP/1.1",
     "status": 502,
     "responseSize": "690",
     "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
     "urlMapEntry": "auto",
     "host": "maximal-beach-255318.appspot.com",
     "cost": 7.7113e-8,
     "instanceIndex": -1,
     "finished": true,
     "instanceId": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49",
     "appEngineRelease": "1.9.71",
     "traceId": "17ca3e3af386e29af2197260dd20ca5b",
     "first": true,
     "traceSampled": true
   },
   "insertId": "5dde6fe700056f2d0a6185c7",
   "httpRequest": {
     "status": 502
   },
   "resource": {
     "type": "gae_app",
     "labels": {
       "version_id": "20191126t083944",
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318"
     }
   },
   "timestamp": "2019-11-27T12:44:55.740781Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/appengine.googleapis.com%2Frequest_log",
   "operation": {
     "id": "5dde6fc700ff0b4dadaec6e11e0001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "producer": "appengine.googleapis.com/request_id",
     "first": true,
     "last": true
   },
   "trace": "projects/maximal-beach-255318/traces/17ca3e3af386e29af2197260dd20ca5b",
   "receiveTimestamp": "2019-11-27T12:45:27.357040172Z",
   "traceSampled": true
 },
 {
   "textPayload": "[2019-11-27 12:44:50 +0000] [19] [INFO] Booting worker with pid: 19",
   "insertId": "5dde6fc200029a6115a11cd3",
   "resource": {
     "type": "gae_app",
     "labels": {
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944",
       "module_id": "default",
       "zone": "us-east1-3"
     }
   },
   "timestamp": "2019-11-27T12:44:50.170593Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T12:44:50.177293952Z"
 },
 {
   "textPayload": "[2019-11-27 12:44:48 +0000] [7] [CRITICAL] WORKER TIMEOUT (pid:18)",
   "insertId": "5dde6fc0000ccba4ab7daec2",
   "resource": {
     "type": "gae_app",
     "labels": {
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944",
       "module_id": "default"
     }
   },
   "timestamp": "2019-11-27T12:44:48.838564Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T12:44:48.846320557Z"
 },
 {
   "protoPayload": {
     "@type": "type.googleapis.com/google.appengine.logging.v1.RequestLog",
     "appId": "p~maximal-beach-255318",
     "versionId": "20191126t083944",
     "requestId": "5dde6fa200ff00ffb6f6484c386b0001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "ip": "190.217.67.6",
     "startTime": "2019-11-27T12:44:18.046838Z",
     "endTime": "2019-11-27T12:44:49.927998Z",
     "latency": "31.881160s",
     "megaCycles": "638",
     "method": "GET",
     "resource": "/stages/",
     "httpVersion": "HTTP/1.1",
     "status": 502,
     "responseSize": "690",
     "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
     "urlMapEntry": "auto",
     "host": "maximal-beach-255318.appspot.com",
     "cost": 7.7113e-8,
     "instanceIndex": -1,
     "finished": true,
     "instanceId": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49",
     "appEngineRelease": "1.9.71",
     "traceId": "f9abbbb57697d19e094bc6a7afe46fc4",
     "first": true,
     "traceSampled": true
   },
   "insertId": "5dde6fc1000e377f4c815764",
   "httpRequest": {
     "status": 502
   },
   "resource": {
     "type": "gae_app",
     "labels": {
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944"
     }
   },
   "timestamp": "2019-11-27T12:44:18.046838Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/appengine.googleapis.com%2Frequest_log",
   "operation": {
     "id": "5dde6fa200ff00ffb6f6484c386b0001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "producer": "appengine.googleapis.com/request_id",
     "first": true,
     "last": true
   },
   "trace": "projects/maximal-beach-255318/traces/f9abbbb57697d19e094bc6a7afe46fc4",
   "receiveTimestamp": "2019-11-27T12:44:49.941671848Z",
   "traceSampled": true
 },
 {
   "protoPayload": {
     "@type": "type.googleapis.com/google.appengine.logging.v1.RequestLog",
     "appId": "p~maximal-beach-255318",
     "versionId": "20191126t083944",
     "requestId": "5dde6f9000ff09e526316e53900001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "ip": "190.217.67.6",
     "startTime": "2019-11-27T12:44:00.648486Z",
     "endTime": "2019-11-27T12:44:05.324856Z",
     "latency": "4.676370s",
     "megaCycles": "2744",
     "method": "GET",
     "resource": "/favicon.ico",
     "httpVersion": "HTTP/1.1",
     "status": 404,
     "responseSize": "385",
     "referrer": "http://maximal-beach-255318.appspot.com/stages/",
     "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
     "urlMapEntry": "auto",
     "host": "maximal-beach-255318.appspot.com",
     "cost": 4.3027e-8,
     "instanceIndex": -1,
     "finished": true,
     "instanceId": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49",
     "appEngineRelease": "1.9.71",
     "traceId": "18628020e642702bce4c2e0b3187e2ce",
     "first": true,
     "traceSampled": true
   },
   "insertId": "5dde6f9500069b4e77b19ab5",
   "httpRequest": {
     "status": 404
   },
   "resource": {
     "type": "gae_app",
     "labels": {
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944",
       "module_id": "default"
     }
   },
   "timestamp": "2019-11-27T12:44:00.648486Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/appengine.googleapis.com%2Frequest_log",
   "operation": {
     "id": "5dde6f9000ff09e526316e53900001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "producer": "appengine.googleapis.com/request_id",
     "first": true,
     "last": true
   },
   "trace": "projects/maximal-beach-255318/traces/18628020e642702bce4c2e0b3187e2ce",
   "receiveTimestamp": "2019-11-27T12:44:05.434941402Z",
   "traceSampled": true
 },
 {
   "textPayload": "[2019-11-27 12:44:00 +0000] [18] [INFO] Booting worker with pid: 18",
   "insertId": "5dde6f900009af56ce378348",
   "resource": {
     "type": "gae_app",
     "labels": {
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944",
       "module_id": "default",
       "zone": "us-east1-3"
     }
   },
   "timestamp": "2019-11-27T12:44:00.634710Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T12:44:00.697087376Z"
 },
 {
   "textPayload": "[2019-11-27 12:43:59 +0000] [7] [CRITICAL] WORKER TIMEOUT (pid:15)",
   "insertId": "5dde6f8f00057bd7123ebed3",
   "resource": {
     "type": "gae_app",
     "labels": {
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944",
       "module_id": "default"
     }
   },
   "timestamp": "2019-11-27T12:43:59.359383Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T12:43:59.367903796Z"
 },
 {
   "protoPayload": {
     "@type": "type.googleapis.com/google.appengine.logging.v1.RequestLog",
     "appId": "p~maximal-beach-255318",
     "versionId": "20191126t083944",
     "requestId": "5dde6f7100ff03b1470e1729150001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "ip": "190.217.67.6",
     "startTime": "2019-11-27T12:43:29.241991Z",
     "endTime": "2019-11-27T12:44:00.433791Z",
     "latency": "31.191800s",
     "megaCycles": "670",
     "method": "GET",
     "resource": "/stages/",
     "httpVersion": "HTTP/1.1",
     "status": 502,
     "responseSize": "690",
     "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
     "urlMapEntry": "auto",
     "host": "maximal-beach-255318.appspot.com",
     "cost": 7.7113e-8,
     "instanceIndex": -1,
     "finished": true,
     "instanceId": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49",
     "appEngineRelease": "1.9.71",
     "traceId": "2eb1e05b6e3607b82bc6eb1581f7030b",
     "first": true,
     "traceSampled": true
   },
   "insertId": "5dde6f900006aa2783948800",
   "httpRequest": {
     "status": 502
   },
   "resource": {
     "type": "gae_app",
     "labels": {
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944",
       "module_id": "default"
     }
   },
   "timestamp": "2019-11-27T12:43:29.241991Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/appengine.googleapis.com%2Frequest_log",
   "operation": {
     "id": "5dde6f7100ff03b1470e1729150001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "producer": "appengine.googleapis.com/request_id",
     "first": true,
     "last": true
   },
   "trace": "projects/maximal-beach-255318/traces/2eb1e05b6e3607b82bc6eb1581f7030b",
   "receiveTimestamp": "2019-11-27T12:44:00.443084831Z",
   "traceSampled": true
 },
 {
   "textPayload": "[2019-11-27 07:52:18 +0000] [7] [INFO] Shutting down: Master",
   "insertId": "5dde2b32000662725bdd088d",
   "resource": {
     "type": "gae_app",
     "labels": {
       "version_id": "20191126t083531",
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318"
     }
   },
   "timestamp": "2019-11-27T07:52:18.418418Z",
   "labels": {
     "clone_id": "00c61b117c8a2ff2cf91e014f80fd771ceb13ae6f293bfa1dfe53396a1fe807c93d66bb6"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T07:52:18.465138763Z"
 },
 {
   "textPayload": "[2019-11-27 07:52:17 +0000] [20] [INFO] Worker exiting (pid: 20)",
   "insertId": "5dde2b31000cbb519c6bb001",
   "resource": {
     "type": "gae_app",
     "labels": {
       "version_id": "20191126t083531",
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318"
     }
   },
   "timestamp": "2019-11-27T07:52:17.834385Z",
   "labels": {
     "clone_id": "00c61b117c8a2ff2cf91e014f80fd771ceb13ae6f293bfa1dfe53396a1fe807c93d66bb6"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T07:52:18.129370130Z"
 },
 {
   "textPayload": "[2019-11-27 07:52:17 +0000] [7] [INFO] Handling signal: term",
   "insertId": "5dde2b310009e8722b2030e5",
   "resource": {
     "type": "gae_app",
     "labels": {
       "version_id": "20191126t083531",
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318"
     }
   },
   "timestamp": "2019-11-27T07:52:17.649330Z",
   "labels": {
     "clone_id": "00c61b117c8a2ff2cf91e014f80fd771ceb13ae6f293bfa1dfe53396a1fe807c93d66bb6"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T07:52:17.795680101Z"
 },
 {
   "textPayload": "[2019-11-27 02:15:44 +0000] [15] [INFO] Booting worker with pid: 15",
   "insertId": "5ddddc5000013018cd840898",
   "resource": {
     "type": "gae_app",
     "labels": {
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944",
       "module_id": "default",
       "zone": "us-east1-3"
     }
   },
   "timestamp": "2019-11-27T02:15:44.077848Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T02:15:44.269814707Z"
 },
 {
   "textPayload": "[2019-11-27 02:15:43 +0000] [7] [INFO] Using worker: sync",
   "insertId": "5ddddc4f000e3a8221b4647f",
   "resource": {
     "type": "gae_app",
     "labels": {
       "version_id": "20191126t083944",
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318"
     }
   },
   "timestamp": "2019-11-27T02:15:43.932482Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T02:15:44.269814707Z"
 },
 {
   "textPayload": "[2019-11-27 02:15:43 +0000] [7] [INFO] Listening at: http://0.0.0.0:8081 (7)",
   "insertId": "5ddddc4f000e3a5ed3d9fe86",
   "resource": {
     "type": "gae_app",
     "labels": {
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944",
       "module_id": "default"
     }
   },
   "timestamp": "2019-11-27T02:15:43.932446Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T02:15:44.269814707Z"
 },
 {
   "textPayload": "[2019-11-27 02:15:43 +0000] [7] [INFO] Starting gunicorn 19.9.0",
   "insertId": "5ddddc4f000e32a95dc08c06",
   "resource": {
     "type": "gae_app",
     "labels": {
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944"
     }
   },
   "timestamp": "2019-11-27T02:15:43.930473Z",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/stderr",
   "receiveTimestamp": "2019-11-27T02:15:43.935820537Z"
 },
 {
   "protoPayload": {
     "@type": "type.googleapis.com/google.appengine.logging.v1.RequestLog",
     "appId": "p~maximal-beach-255318",
     "versionId": "20191126t083944",
     "requestId": "5ddddc4e00ff05cca307340a140001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "ip": "186.84.21.80",
     "startTime": "2019-11-27T02:15:42.380067Z",
     "endTime": "2019-11-27T02:15:45.795201Z",
     "latency": "3.415134s",
     "megaCycles": "4969",
     "method": "GET",
     "resource": "/favicon.ico",
     "httpVersion": "HTTP/1.1",
     "status": 404,
     "responseSize": "380",
     "referrer": "http://maximal-beach-255318.appspot.com/stages/",
     "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36",
     "urlMapEntry": "auto",
     "host": "maximal-beach-255318.appspot.com",
     "cost": 4.2468e-8,
     "wasLoadingRequest": true,
     "instanceIndex": -1,
     "finished": true,
     "instanceId": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49",
     "line": [
       {
         "time": "2019-11-27T02:15:45.794925Z",
         "severity": "INFO",
         "logMessage": "This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application."
       }
     ],
     "appEngineRelease": "1.9.71",
     "traceId": "55744f06ecd2c9f36584f78dd72858dd",
     "first": true,
     "traceSampled": true
   },
   "insertId": "5ddddc51000c22e862aa1128",
   "httpRequest": {
     "status": 404
   },
   "resource": {
     "type": "gae_app",
     "labels": {
       "module_id": "default",
       "zone": "us-east1-3",
       "project_id": "maximal-beach-255318",
       "version_id": "20191126t083944"
     }
   },
   "timestamp": "2019-11-27T02:15:42.380067Z",
   "severity": "INFO",
   "labels": {
     "clone_id": "00c61b117cdf0dc021505dc1db4b8707a84de0d2f54c6da3e7f40f65466f31153b28ae49"
   },
   "logName": "projects/maximal-beach-255318/logs/appengine.googleapis.com%2Frequest_log",
   "operation": {
     "id": "5ddddc4e00ff05cca307340a140001707e6d6178696d616c2d62656163682d3235353331380001323031393131323674303833393434000100",
     "producer": "appengine.googleapis.com/request_id",
     "first": true,
     "last": true
   },
   "trace": "projects/maximal-beach-255318/traces/55744f06ecd2c9f36584f78dd72858dd",
   "receiveTimestamp": "2019-11-27T02:15:45.804618825Z",
   "traceSampled": true
 }
]
google-app-engine google-cloud-platform swagger python-3.7 flask-restplus
1个回答
1
投票
混合内容:位于'*****'的页面是通过HTTPS加载的,但是请求了不安全的资源“ http://****/swagger.json”。这个内容也应该通过HTTPS提供。
© www.soinside.com 2019 - 2024. All rights reserved.