我该如何解决该错误?在svn电子邮件通知中?

我该如何解决该错误?在svn电子邮件通知中?

我已经通过 svn 电子邮件通知进行工作,但出现错误,你能帮我吗?

(该命令为我的邮件执行自动发送文件,但现在不发送。)

svn commit -m "[1] add some text in this file"

错误:

Sending        test/test.txt
Transmitting file data .

我去系统日志:

tail -f /var/log/syslog 

Sep  4 13:16:42 dmayavanlo1 logger: Going to execute the email notification command
Sep  4 13:16:42 dmayavanlo1 sSMTP[3116]: Unable to locate smtp.gmail.com
Sep  4 13:16:42 dmayavanlo1 logger: sendmail: Cannot open smtp.gmail.com:587
Sep  4 13:16:42 dmayavanlo1 sSMTP[3116]: Cannot open smtp.gmail.com:587
Sep  4 13:16:42 dmayavanlo1 logger: Traceback (most recent call last):
Sep  4 13:16:42 dmayavanlo1 logger:   File "/home/bugzilla/mysvn/hooks
/mailer.py", line 1348, in <module>
Sep  4 13:16:42 dmayavanlo1 logger:     sys.argv[3:3+expected_args])
Sep  4 13:16:42 dmayavanlo1 logger:   File "/usr/lib/python2.7/dist-packages/svn/core.py", line 281, in run_app
Sep  4 13:16:42 dmayavanlo1 logger:     return func(application_pool, *args, 
**kw)
Sep  4 13:16:42 dmayavanlo1 logger:   File "/home/bugzilla/mysvn/hooks/mailer.py", line 105, in main
Sep  4 13:16:42 dmayavanlo1 logger:     messenger.generate()
Sep  4 13:16:42 dmayavanlo1 logger:   File "/home/bugzilla/mysvn/hooks/mailer.py", line 383, in generate
Sep  4 13:16:42 dmayavanlo1 logger:     group, params, paths, subpool)
Sep  4 13:16:42 dmayavanlo1 logger:   File "/home/bugzilla/mysvn/hooks/mailer.py", line 653, in generate_content
Sep  4 13:16:42 dmayavanlo1 logger:     renderer.render(data)
Sep  4 13:16:42 dmayavanlo1 logger:   File "/home/bugzilla/mysvn/hooks/mailer.py", line 963, in render
Sep  4 13:16:42 dmayavanlo1 logger:     self._render_diffs(data.diffs, '')
Sep  4 13:16:42 dmayavanlo1 logger:   File "/home/bugzilla/mysvn/hooks/mailer.py", line 1042, in _render_diffs
Sep  4 13:16:42 dmayavanlo1 logger:     w(line.raw)
Sep  4 13:16:42 dmayavanlo1 logger: IOError: [Errno 32] Broken pipe

2)tail -f /var/log/apache2/error.log

[Thu Sep 04 12:34:11 2014] [error] [client 192.168.1.12] Could not fetch resource information.  [301, #0]
[Thu Sep 04 12:34:11 2014] [error] [client 192.168.1.12] Requests for a collection must have a trailing slash on the URI.  [301, #0]

答案1

根据您的日志文件,第一个错误是:

9 月 4 日 13:16:42 dmayavanlo1 sSMTP[3116]:无法找到 smtp.gmail.com

(所有其他错误都是结果)。我认为原因是暂时的网络问题。尝试

ping smtp.gmail.com

看看你现在是否能达到它。为了避免将来出现此类问题,您应该安装本地 SMTP 服务器(例如 postfix),以便在临时网络问题时邮件可以排队。

答案2

解决错误:

我要去编辑 mailer.py 的行,所以我收到了这个错误

一切删除mailer.py:

1)sudo rm -r /usr/share/subversion。

2)sudo rm -r /myrepository/hooks/mailer.py。

3)sudo dpkg --purge 删除颠覆。

通常你在 subversion 中重新安装:

4)sudo apt-get install subversion-tools

5)sudo cp /usr/share/subversion/hook-scripts/mailer/ mailer.py /myrepository/hooks/。

更改 mailer.py 中的获胜者身份:

6)sudo chown -R www-data:www-data /myrepository/hooks/mailer.py。

您经常检查提交命令电子邮件通知是否正常工作。

相关内容