CRIT Server ‘unix_http_server‘ running without any HTTP authentication checking 排查

有同事反馈有个项目因为有人调整过底层镜像,导致服务无法启动,容器报错信息如下

2022-07-04 15:21:03,883 CRIT Server 'unix_http_server' running without any HTTP authentication checking

到网上搜这个报错信息,虽然没有帖子很明确的指出报错原因,但是基本上可以确定是和 supervisor 相关,

于是将 supervisor 源码下载下来后,用错误中的关键字进行搜索

git clone git@github.com:Supervisor/supervisor.git
cd supervisor

grep "authentication checking" -rn *
// 结果如下
docs/logging.rst:32:   2007-09-08 14:43:22,961 CRIT Running without any HTTP authentication checking
supervisor/http.py:855:                'authentication checking' % config['section'])

vim supervisor/http.py +855 查看代码如下

if username:
    # wrap the xmlrpc handler and tailhandler in an authentication
    # handler
    users = {username:password}
    xmlrpchandler = supervisor_auth_handler(users, xmlrpchandler)
    tailhandler = supervisor_auth_handler(users, tailhandler)
    maintailhandler = supervisor_auth_handler(users, maintailhandler)
    uihandler = supervisor_auth_handler(users, uihandler)
    defaulthandler = supervisor_auth_handler(users, defaulthandler)
else:
    options.logger.critical(
        'Server %r running without any HTTP '
        'authentication checking' % config['section'])

可以发现如果没有用户名,就会报这里遇到的critical错误。
接下来 排查镜像dockerfile,找到supervisord.conf 配置文件,其中 unix_http_server 配置如下,

[unix_http_server]
file=/mnt/supervisor.sock   ; the path to the socket file
;chmod=0700                 ; socket file mode (default 0700)
;chown=nobody:nogroup       ; socket file uid:gid owner
;username=user              ; default is no username (open server)
;password=123               ; default is no password (open server)

发现用户名和密码都被注释掉了,于是让业务同学设定新的用户名和密码,通过挂载的方式覆盖老的配置,经测试服务可以正常启动。

查看 supervisor版本命令
supervisord -v
4.2.2

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值