Edgewall Software
Modify

Ticket #1579 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Can't modify ticket

Reported by: markb Owned by: cmlenz
Priority: highest Milestone: 0.9
Component: ticket system Version: devel
Severity: critical Keywords:
Cc: odela01@…
Release Notes:
API Changes:

Description (last modified by cmlenz) (diff)

Trying to add a comment to an existing ticket doesn't work. After clicking on the "Submit Changes" button, I'm presented with this error...

Trac detected an internal error:

int argument required



Traceback (most recent call last):
  File "/usr/local/python/lib/python2.4/site-packages/trac/web/cgi_frontend.py", line 103, in run
    dispatch_request(os.getenv('PATH_INFO', ''), req, env)
  File "/usr/local/python/lib/python2.4/site-packages/trac/web/main.py", line 419, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/python/lib/python2.4/site-packages/trac/web/main.py", line 283, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/python/lib/python2.4/site-packages/trac/Ticket.py", line 468, in process_request
    self._do_save(req, db, ticket)
  File "/usr/local/python/lib/python2.4/site-packages/trac/Ticket.py", line 609, in _do_save
    self.log.exception("Failure sending notification on change to "
TypeError: int argument required

I'm using revision: 1703

Attachments

Change History

comment:1 Changed 7 years ago by PBruin

Confirm, I had the same thing after upgrading. However, the second time it worked and it seems to be fine now.

comment:2 Changed 7 years ago by PBruin

Confirm, I had the same thing after upgrading. However, the second time it worked and it seems to be fine now.

comment:3 Changed 7 years ago by cmlenz

  • Description modified (diff)
  • Owner changed from jonas to cmlenz
  • Status changed from new to assigned

comment:4 Changed 7 years ago by cmlenz

This is actually due to an error send mail notifications.

comment:5 Changed 7 years ago by anonymous

This is a really high priority [


http://www.yahoo.com]

comment:6 Changed 7 years ago by odela01@…

  • Cc odela01@… added

I'm not sure why the email notification is failing, although using a ; to separate email addresses appears to be one cause.

The actual exception is because the log statement expects the ticketid? to be an int, but it's a string at that point. I think the culprit is line 221 of Notify.py: {{{
tktid? = '%s' % tktid?}}}, where tkt is a reference to the original ticket object that was passed to the notify method. I have applied the following patch, and it seems to work:

--- Notify.py.orig      Fri Jun  3 16:59:51 2005
+++ Notify.py   Fri Jun  3 17:00:41 2005
@@ -218,7 +218,6 @@
 
     def format_props(self):
         tkt = self.ticket
-        tkt['id'] = '%s' % tkt['id']
         t = self.modtime or tkt['time']
         tkt['modified'] = time.strftime('%c', time.localtime(t))
         fields = ['id',        'status',
@@ -252,7 +251,7 @@
         big=[]
         for f in fields:
             if not tkt.has_key(f): continue
-            fval = tkt[f]
+            fval = str(tkt[f])
             fname = f.startswith('custom_') and f[7:] or f
             if '\n' in str(fval):
                 big.append((fname.capitalize(), fval))

After that is done, the log call works correctly. The stack trace of the email notification failure is now logged:

17:11:16 Trac[web_ui] ERROR: Failure sending notification on change to ticket #165: len() of unsized object
Traceback (most recent call last):
  File "/usr/local/lib/python2.3/site-packages/trac/ticket/web_ui.py", line 347, in _do_save
    tn.notify(ticket, newticket=0, modtime=now)
  File "/usr/local/lib/python2.3/site-packages/trac/Notify.py", line 217, in notify
    NotifyEmail.notify(self, ticket['id'], subject)
  File "/usr/local/lib/python2.3/site-packages/trac/Notify.py", line 117, in notify
    Notify.notify(self, resid)
  File "/usr/local/lib/python2.3/site-packages/trac/Notify.py", line 56, in notify
    self.send(to)
  File "/usr/local/lib/python2.3/site-packages/trac/Notify.py", line 347, in send
    NotifyEmail.send(self, rcpt, hdrs)
  File "/usr/local/lib/python2.3/site-packages/trac/Notify.py", line 150, in send
    self.server.sendmail(self.from_email, rcpt, msg.as_string())
  File "/usr/local/lib/python2.3/email/Message.py", line 130, in as_string
    g.flatten(self, unixfrom=unixfrom)
  File "/usr/local/lib/python2.3/email/Generator.py", line 103, in flatten
    self._write(msg)
  File "/usr/local/lib/python2.3/email/Generator.py", line 138, in _write
    self._write_headers(msg)
  File "/usr/local/lib/python2.3/email/Generator.py", line 184, in _write_headers
    header_name=h, continuation_ws='\t').encode()
  File "/usr/local/lib/python2.3/email/Header.py", line 412, in encode
    newchunks += self._split(s, charset, targetlen, splitchars)
  File "/usr/local/lib/python2.3/email/Header.py", line 297, in _split
    elen = charset.encoded_header_len(encoded)
  File "/usr/local/lib/python2.3/email/Charset.py", line 341, in encoded_header_len
    return len(s)
TypeError: len() of unsized object

I haven't had a chance to look into this yet. Hope that helps.

comment:7 Changed 7 years ago by cmlenz

  • Milestone set to 0.9
  • Resolution set to fixed
  • Status changed from assigned to closed

Should be fixed in [1831].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cmlenz. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.