Python flask Dockerized Web application api not return response ERROR:BrokenFilesystemWarning

11/23/2017

I am using python 2.7 and flask that returns a complete response to my local setup. Now the application is dockerized the and deployed in Google kubernetes container. This is a sample API of POST method which takes inputs as application/json, currently the internal function able to fetch the data in JSON format but its not return to the client end.

Python part:

from flask import Flask, render_template, request, jsonify
from flask_cors import CORS, cross_origin
import sys
from runmodel import run
reload(sys)  # Reload is a hack
sys.setdefaultencoding('UTF8')

app = Flask(__name__, static_url_path='/static')
CORS(app)

@app.route("/modelrun", methods=['POST'])
def modelrun():
   """TO run the model and get data to populate"""
   req_data = request.json
   res = run(req_data) #another function return the data it will return json format
   return jsonify(res)

My current problem is I am not getting the complete response, its return the ValueError: View function did not return a response// Werkzeug Debugger in the web browser.

Here are the logs and Traceback:

labels{
 container.googleapis.com/stream:  "stderr" 
}
BrokenFilesystemWarning)
severity:  "ERROR"   
textPayload:  "  BrokenFilesystemWarning)
-- Abhilash
docker
flask-restful
kubernetes
python

0 Answers