Python Flask server crashing on GET request to specific endpoint:

非 Y 不嫁゛ 提交于 2019-12-06 14:05:39

Stupid mistake. There was an error in my nginx config. It was pointing to a non-existent socket.

server {
    listen   80;
          server_name scholarly;
      # crowdscholar endpoint
        location /crowdscholar {
            uwsgi_pass unix:///tmp/crowdscholar.sock;
        include uwsgi_params;
        # strip path before handing it to app
        uwsgi_param SCRIPT_NAME /crowdscholar;
        uwsgi_modifier1 30;
    }
    # citelet endpoint
        location /citelet {
            uwsgi_pass unix:///tmp/citelet.sock;
        include uwsgi_params;
        # strip path before handing it to app
        uwsgi_param SCRIPT_NAME /citelet;
        uwsgi_modifier1 30;
    }
}

just for reference: I was getting the same error, and realized I'd forgotten to add include uwsgi_params; as in user1558914's answer.

then it still wasn't working after make restart because I had my uwsgi restart rule, which was failing, ahead of the nginx restart. once I manually restarted nginx with /etc/init.d/nginx restart, the KeyError ceased.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!