{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/801","repository_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/801/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/801/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/801/events","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/801","id":364063562,"node_id":"MDU6SXNzdWUzNjQwNjM1NjI=","number":801,"title":"Hidden failure when issuing `flask run` in production environment?","user":{"login":"owalerys","id":8883074,"node_id":"MDQ6VXNlcjg4ODMwNzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8883074?v=4","gravatar_id":"","url":"https://api.github.com/users/owalerys","html_url":"https://github.com/owalerys","followers_url":"https://api.github.com/users/owalerys/followers","following_url":"https://api.github.com/users/owalerys/following{/other_user}","gists_url":"https://api.github.com/users/owalerys/gists{/gist_id}","starred_url":"https://api.github.com/users/owalerys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owalerys/subscriptions","organizations_url":"https://api.github.com/users/owalerys/orgs","repos_url":"https://api.github.com/users/owalerys/repos","events_url":"https://api.github.com/users/owalerys/events{/privacy}","received_events_url":"https://api.github.com/users/owalerys/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-26T14:37:19Z","updated_at":"2018-09-26T15:13:47Z","closed_at":null,"author_association":"NONE","body":"**development**\r\n\r\n```\r\n(venv) pi@raspberrypi:~/garden-server $ export FLASK_APP=garden\r\n(venv) pi@raspberrypi:~/garden-server $ export FLASK_ENV=development\r\n(venv) pi@raspberrypi:~/garden-server $ flask run\r\n * Serving Flask-SocketIO app \"garden\"\r\n * Forcing debug mode on\r\n * Restarting with stat\r\n * Debugger is active!\r\n * Debugger PIN: 340-696-311\r\n(23236) wsgi starting up on http://127.0.0.1:5000\r\n```\r\n\r\n**production**\r\n\r\n```\r\n(venv) pi@raspberrypi:~/garden-server $ export FLASK_APP=garden\r\n(venv) pi@raspberrypi:~/garden-server $ export FLASK_ENV=production\r\n(venv) pi@raspberrypi:~/garden-server $ flask run\r\n * Serving Flask-SocketIO app \"garden\"\r\n * Forcing debug mode off\r\n```\r\n\r\nThe last time that I ran `flask run` and had details cut off like this it was because `eventlet` was not installed and everything started failing silently without any warning. Is this also a known issue? The thing is is that I'm able to `curl http://127.0.0.1:5000` but even with a `prod.py` script I am seemingly unable to change ports or hosts to use the production server, and I am seriously questioning the missing console loggine.\r\n\r\nBoth of the above outputs are from using an app factory in `garden/__init__.py` but I will also paste a `prod.py` script that I tried to use to fix the problem but did not appear to make a difference.\r\n\r\n**garden/__init__.py**\r\n\r\n```\r\nimport os\r\n\r\nfrom flask import Flask\r\nfrom flask_socketio import SocketIO\r\n\r\nsocketio = SocketIO()\r\n\r\ndef create_app(test_config=None):\r\n    # create and configure the app\r\n    app = Flask(__name__, instance_relative_config=True)\r\n    app.config.from_mapping(\r\n        SECRET_KEY='dev',\r\n        DATABASE=os.path.join(app.instance_path, 'garden.sqlite'),\r\n    )\r\n\r\n    if test_config is None:\r\n        # load the instance config, if it exists, when not testing\r\n        app.config.from_pyfile('config.py', silent=True)\r\n    else:\r\n        # load the test config if passed in\r\n        app.config.from_mapping(test_config)\r\n\r\n    # ensure the instance folder exists\r\n    try:\r\n        os.makedirs(app.instance_path)\r\n    except OSError:\r\n        pass\r\n\r\n    from . import db\r\n    db.init_app(app)\r\n\r\n    from . import auth\r\n    app.register_blueprint(auth.bp)\r\n   \r\n    from . import manager\r\n    manager.init_app(app)\r\n\r\n    socketio.init_app(app)\r\n    return app\r\n```\r\n\r\n**prod.py**\r\n\r\n```\r\nfrom garden import create_app, socketio\r\n\r\nif __name__ == \"__main__\":\r\n    app = create_app()\r\n    socketio.run(app, host='0.0.0.0', port=8080)\r\n```\r\n\r\n**pip freeze**\r\n\r\n```\r\n(venv) pi@raspberrypi:~/garden-server $ pip freeze\r\nclick==6.7\r\ndnspython==1.15.0\r\neventlet==0.24.1\r\nFlask==1.0.2\r\nFlask-SocketIO==3.0.2\r\ngreenlet==0.4.15\r\ngunicorn==19.9.0\r\nitsdangerous==0.24\r\nJinja2==2.10\r\nMarkupSafe==1.0\r\nmonotonic==1.5\r\npkg-resources==0.0.0\r\nPyCmdMessenger==0.2.4\r\npyserial==3.4\r\npython-engineio==2.2.0\r\npython-socketio==2.0.0\r\nsix==1.11.0\r\nWerkzeug==0.14.1\r\n```\r\n\r\n_Even removing gunicorn did not seem to change anything. It was left over from my testing of various production environments._"},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/comments/424754015","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/801#issuecomment-424754015","issue_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/801","id":424754015,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDc1NDAxNQ==","user":{"login":"owalerys","id":8883074,"node_id":"MDQ6VXNlcjg4ODMwNzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8883074?v=4","gravatar_id":"","url":"https://api.github.com/users/owalerys","html_url":"https://github.com/owalerys","followers_url":"https://api.github.com/users/owalerys/followers","following_url":"https://api.github.com/users/owalerys/following{/other_user}","gists_url":"https://api.github.com/users/owalerys/gists{/gist_id}","starred_url":"https://api.github.com/users/owalerys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owalerys/subscriptions","organizations_url":"https://api.github.com/users/owalerys/orgs","repos_url":"https://api.github.com/users/owalerys/repos","events_url":"https://api.github.com/users/owalerys/events{/privacy}","received_events_url":"https://api.github.com/users/owalerys/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T15:13:47Z","updated_at":"2018-09-26T15:13:47Z","author_association":"NONE","body":"@miguelgrinberg I saw your PR in the Flask repository in reference to my last Flask issue which seems to be related. Is there an alternate way for me to launch the application and work around the `flask run` issues without having to downgrade my app to `Flask==0.12.4`?"}}
{"actor":{"display_login":"owalerys"}}