景观服务器/cron 作业出现多个错误

景观服务器/cron 作业出现多个错误

塞巴斯蒂安在这里,正在寻找有关景观服务器的一些答案。

我设置了 Ubuntu Server 18.04.4 LTS 并安装了 Landscape Server 19.10。一段时间内,系统运行良好,但几天后,在运行 Landscape 的 cron 作业时,系统不断遇到连接错误等。

以下脚本无法正常工作并不断向我发送电子邮件:/opt/canonical/landscape/scripts/meta_releases.sh /opt/canonical/landscape/scripts/report_anonymous_metrics.sh /opt/canonical/landscape/scripts/update_security_db.sh

我正在尝试自己解决这些问题,但找不到解决方案......这有点烦人;-)

以下是错误报告:

  • meta_releases.sh
<11>Jun 10 00:30:05 meta-releases: Failed to fetch http://changelogs.ubuntu.com/meta-release: 'Error 35: gnutls_handshake() failed: The TLS connection was non-properly terminated.'
  • 报告匿名指标
<11>Jun 10 00:55:01 report-anonymous-metrics: Error running /opt/canonical/landscape/scripts/report_anonymous_metrics.sh: 0 <11>Jun 10 00:55:09 report-anonymous-metrics: Check out the syslog output for script report-anonymous-metrics.
  • 更新安全数据库
<11>Jun 10 06:42:33 update-security-db: Traceback (most recent call last):
<11>Jun 10 06:42:45 update-security-db:   File "./process-usns", line 7, in <module>
<11>Jun 10 06:42:45 update-security-db:     canonical.landscape.scripts.usn.run()
<11>Jun 10 06:42:45 update-security-db:   File "/opt/canonical/landscape/canonical/landscape/scripts/batch.py", line 76, in __call__
<11>Jun 10 06:42:45 update-security-db:     self.setup()
<11>Jun 10 06:42:45 update-security-db:   File "/opt/canonical/landscape/canonical/landscape/scripts/batch.py", line 121, in setup
<11>Jun 10 06:42:45 update-security-db:     self._add_cleanup_callback(self.run_amqp_client_in_thread(config))
<11>Jun 10 06:42:45 update-security-db:   File "/opt/canonical/landscape/canonical/landscape/setup.py", line 336, in run_amqp_client_in_thread
<11>Jun 10 06:42:45 update-security-db:     blockingCallFromThread(reactor, lambda: started)
<11>Jun 10 06:42:45 update-security-db:   File "/usr/lib/python2.7/dist-packages/twisted/internet/threads.py", line 122, in blockingCallFromThread
<11>Jun 10 06:42:45 update-security-db:     result.raiseException()
<11>Jun 10 06:42:45 update-security-db:   File "<string>", line 2, in raiseException
<11>Jun 10 06:42:45 update-security-db: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.
Error running /opt/canonical/landscape/scripts/update_security_db.sh: 0 Check out the syslog output for script update_security_db.sh.

由于我的服务器在代理后面运行,我仔细检查了(三重检查)我的配置文件和所有内容似乎没问题。手动运行 curl 下载元版本也很好。

我很高兴听到任何见解。

2020.06.15更新:

感谢您的意见!

我之前阅读了有关 cron 和代理的信息,并相应地设置了我的变量。

这是我的 /etc/environment:

LANG=de_DE.UTF-8
LANGUAGE=de
LC_ALL=de_DE.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
export http_proxy=http://{proxy-fqdn-here}:3128
export https_proxy=http://{proxy-fqdn-here}:3128
export ftp_proxy=http://{proxy-fqdn-here}:21
export no_proxy=localhost,{hostname-here},{hostname-fqdn-here}
#export HTTP_PROXY=$http_proxy
#export HTTPS_PROXY=$https_proxy
#export FTP_PROXY=$ftp_proxy
#export NO_PROXY=$no_proxy

这是 /etc/crontab,相同的配置:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
http_proxy=http://{proxy-fqdn-here}:3128
https_proxy=http://{proxy-fqdn-here}:3128
ftp_proxy=http://{proxy-fqdn-here}:21
no_proxy=localhost,{hostname-here},{hostname-fqdn-here}
#HTTP_PROXY=$http_proxy
#HTTPS_PROXY=$https_proxy
#FTP_PROXY=$ftp_proxy
#NO_PROXY=$no_proxy

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

我甚至在 /etc/profile 和 /etc/security/pam_env.conf 中输入了我的代理配置,但它没有帮助。

来自德国索林根的问候

塞巴斯蒂安

相关内容