uwsgi部署flask项目的报错解决

场景

在centos7服务器上的容器里,部署uwsgi+flask的项目,uwsgi无法正常启动,报错如下

报错内容
[uWSGI] getting INI configuration from uwsgi.ini
*** WARNING: Cant find section "uwsgi" in INI configuration file uwsgi.ini ***
*** Starting uWSGI 2.0.19.1 (64bit) on [Mon May 30 11:22:35 2022] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-44) on 03 April 2022 05:31:44
os: Linux-5.10.84-10.2.al8.x86_64 #1 SMP Thu Feb 10 15:03:09 CST 2022
nodename: 775d62a05ad1
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /usr/local/nginx/conf/conf.d
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
*** WARNING: you are running uWSGI without its master process manager ***
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
The -s/--socket option is missing and stdin is not a socket.
注意看这一句

他意思说uwsgi.ini文件里面,找不到[uwsgi]这个配置头,但是我的文件里是有的,所以这是uwsgi的一个bug

解决:在原来的[uwsgi]下面重新手写一个[uwsgi],注意不要复制,复制的不行
经验分享 程序员 微信小程序 职场和发展