2

I have a project build with PY3 with Quart. I run it with hypercorn. I have deployed a new version, but when I post a request I get old response.

I did a simple test, and wrote a static response in one of my routes to see the change. Nothing. I have killed all my process and restarted them. I have restarted the server. Noting.

Started the app with python3 app.py, Same. What am I missing?

Here is a code example:

app.py

__package__ = 'nini'

from .setups import create_app

if __name__ == '__main__':
    app = create_app()
    app.run(host='127.0.0.1', debug=True)

test.py

from quart import jsonify, app, current_app
from quart_openapi import PintBlueprint
from datetime import datetime


results = PintBlueprint('test', __name__)


@results.route('/test/test')
async def get_tests():
    t = get_float_t(get_user_t())
    return jsonify(t), 200 

I have changed the function result of get_user_t function. After deploy I looked and the code was changed but I keep getting the old result. I cleaned all the pycache folders, build folders and egg files and run sudo pip3 install -e .

To test what's heppening I changed get_user_t route to this:

@results.route('/test/test')
async def get_tests():
    t = get_float_t(get_user_t())
    return jsonify('9999'), 200 

I still Get the old result.

Also cleared all

matisa
  • 497
  • 3
  • 25

1 Answers1

2

So it was permissions problem. For some reason the service was unable to create __pycache__ folders and files. It worked after I ran it as root.

I know it's not a good idea to run a service as root, so I will work out the permissions problem.

matisa
  • 497
  • 3
  • 25
  • 1
    Instead of running something as `root`, you may try using `chmod` and/or `chown` to set up directory access permissions and ownership correctly. – Arthur Khazbs Jul 05 '21 at 09:25
  • 2
    Yes, sure... I know it. Thing is that is already ran under the user that had permissions on the project dir. That is why I didn't think permissions right away. As this is a dev env I didn't want to waist any more time on this at this time. But I saw that others did have the same problem, and wanted to answer for future reference. – matisa Jul 05 '21 at 09:32