Certbot: 0.9.1 在非交互使用中失败(pythondialog,错误打开终端)

创建于 2016-10-19  ·  3评论  ·  资料来源: certbot/certbot

使用自动更新脚本的 Debian8 自动更新框,我有一个 shell 脚本 + cronjob 来更新我的证书 @weekly
10 月 2 日成功运行,10 月 9 日更新 0.8.1 -> 0.9.1 并死亡。

Upgrading certbot-auto 0.8.1 to 0.9.1...
Replacing certbot-auto...
Creating virtual environment...
Installing Python packages...
Installation succeeded.
An unexpected error occurred:
Bug in pythondialog: expected an empty output from u'infobox', but got: u'Error opening terminal: unknown.\n'Please see the logfile 'certbot.log' for more details.

日志文件输出:

2016-10-15 21:01:18,381:DEBUG:certbot.main:Root logging level set at 20
2016-10-15 21:01:18,420:DEBUG:certbot.main:Exiting abnormally:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 749, in main
    setup_logging(config)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 653, in setup_logging
    logger.info("Saving debug log to %s", log_file_path)
  File "/usr/lib/python2.7/logging/__init__.py", line 1160, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1279, in _log
    self.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1289, in handle
    self.callHandlers(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 1329, in callHandlers
    hdlr.handle(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 757, in handle
    self.emit(record)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/log.py", line 64, in emit
    self.width + self.PADDING_WIDTH)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/dialog.py", line 2675, in infobox
    kwargs)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/dialog.py", line 1765, in _widget_with_no_output
    widget_name, output))
PythonDialogBug

我的主机箱使用的是 Debian 提供的二进制包(0.8.1),所以它仍然可以使用,但是我的主机箱受到了打击,因为我之前实现了它(在 Debian 提供包之前) - 我想其他用户可能也会受到影响,但他们可能没有注意到。 我当然没有超过一个星期。

有问题的外壳脚本:

#!/bin/sh
/letsencrypt/letsencrypt-auto certonly --webroot --renew-by-default -w /var/www/git-ssl-proof/ -d git.nikomo.eu
systemctl reload nginx

我懒得真正解决这个问题,所以我打算切换到 Debian 软件包,但我认为其他人也可能会被这个问题所困扰。

最有用的评论

您可以通过在命令行中添加-n/--noninteractive/--non-interactive-q/--quiet来解决此问题。 在我们的文档中,我们建议在使用 systemd 或 cron 以非交互方式运行命令时使用--quiet

所有3条评论

您可以通过在命令行中添加-n/--noninteractive/--non-interactive-q/--quiet来解决此问题。 在我们的文档中,我们建议在使用 systemd 或 cron 以非交互方式运行命令时使用--quiet

由于此类问题(以及其他激励因素),我们已从项目中完全删除dialog ,因此在我们未来的版本中不会出现此类错误。

好吧,它与 armhf/Alpine 的 certbot-0.9.3-r0 一起出现。

certbot certonly \
    --domain $DOMAIN  \
    --email $EMAIL  \
    --authenticator standalone  \
    --agree-tos

--non-interactive修复问题,但它不应该崩溃。

此页面是否有帮助?
0 / 5 - 0 等级