Edgewall Software
Modify

Opened 14 years ago

Closed 11 years ago

Last modified 8 years ago

#10029 closed enhancement (fixed)

Uninformative error message in commit_updater

Reported by: team@… Owned by: Ryan J Ollos
Priority: low Milestone: 1.0.2
Component: general Version:
Severity: normal Keywords:
Cc: Jun Omae Branch:
Release Notes:

Improve error messages that are raised when [notification] smtp_server and [notification] smtp_port are invalid.

API Changes:

Avoid UnicodeDecodeError from to_unicode when socket.error contains a localized error string on Windows.

Internal Changes:

Description

This is the message I see in log:

2011-02-16 16:44:09,653 Trac[commit_updater] ERROR: Failure sending
notification on change to ticket #2: OSError: [Errno 2] No such file or directory

Would be perfect if this message includes the name of the file (or directory). Otherwise I can't understand what's going on.. This happens during changeset add operation triggered from post-commit SVN hook.

Attachments (0)

Change History (7)

comment:1 by Remy Blank, 14 years ago

Keywords: needinfo added

This happens while sending the notification. Are your ticket change notifications working correctly (when you modify a ticket in the web interface)?

Are you using the SendmailEmailSender to send notifications? Then your [notification] sendmail_path may be wrong.

Other than that, I don't see what could trigger such an error while sending notifications. Could you please post the few lines in the log before the one you posted above? Increasing the log level to DEBUG may provide more information about the cause.

comment:2 by Christian Boos, 14 years ago

Resolution: cantfix
Status: newclosed

No feedback in more than 3 months, closing.

comment:3 by maemo@…, 11 years ago

Priority: normallow
Resolution: cantfix
Status: closedreopened
Type: defectenhancement

I got a similar error message and was also confused.

Yes, I use SendmailEmailSender and the sendmail_path was sendmail. After changing it to /usr/sbin/sendmail the problem was solved.

An improved error message would be beneficial.

Last edited 11 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Ryan J Ollos, 11 years ago

Milestone: 1.0.2
Owner: set to Ryan J Ollos
Status: reopenedassigned

comment:5 by Ryan J Ollos, 11 years ago

The patch in log:rjollos.git:t10029 attempts to improve the error message for a few different scenarios:

Incorrect [notification] smtp_server or [notification] smtp_port:

close Warning: The change has been saved, but an error occurred while sending notifications: SMTP server connection error (No such file or directory). Please modify [notification] smtp_server or [notification] smtp_port in your configuration.

Incorrect [notification] sendmail_path:

close Warning: The change has been saved, but an error occurred while sending notifications: Sendmail error (No such file or directory). Please modify [notification] sendmail in your configuration.

tt tags need to be changed to code tags on merge to trunk (#11094). I'm not sure about using smtp.example.com in the test case. Maybe there is a better way?`

in reply to:  5 comment:6 by Jun Omae, 11 years ago

Cc: Jun Omae added

Replying to rjollos:

The patch in log:rjollos.git:t10029 attempts to improve the error message for a few different scenarios:

The socket.error isn't a child class in Python 2.5. Also, smtplib.SMTP.connect may raise a socket.error with empty strerror.

>>> try:
...   smtplib.SMTP('localhost:123aaa', 0)
... except socket.error, e:
...   print e
...   print e.strerror
...
nonnumeric port
None

Oh, I noticed that strerror property of socket.error has a localized error string in Python 2.6+ on Windows.

>>> try:
...   smtplib.SMTP('127.0.0.1', 65536)
... except socket.error, e:
...   pass
...
>>> e.strerror
'\x97v\x8b\x81\x82\xb5\x82\xbd\x83A\x83h\x83\x8c\x83X\x82\xcc\x83R\x83\x93\x83e\x83L\x83X\x83g\x82\xaa\x96\xb3\x8c\xf8\x82\xc5\x82\xb7\x81B'

In Python 2.5 on Windows, the property is non-localized error string.

>>> try:
...   smtplib.SMTP('127.0.0.1', 65536)
... except socket.error, e:
...   print e
...
(10049, "Can't assign requested address")

I suggest that we use to_unicode with the exception rather than strerror. Proposed changes are in log:jomae.git:t10029.1.

I'm not sure about using smtp.example.com in the test case. Maybe there is a better way?`

How about using smtp_server = 127.0.0.1 and smtp_port = 65536, out of range, instead?

Last edited 11 years ago by Jun Omae (previous) (diff)

comment:7 by Ryan J Ollos, 11 years ago

API Changes: modified (diff)
Keywords: needinfo removed
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thanks! Committed to 1.0-stable in [12394:12396,12399,12401], merged to trunk in [12397,12400,12402] and tt tags replaced with code tags on the trunk in [12398].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.