Modify

Opened 6 years ago

Closed 6 years ago

#404 closed defect (fixed)

Missing attachments

Reported by: magda@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 2.9.0
Keywords: Cc:

Description

I am trying to set up email2trac in our multi-project trac environment by piping incoming mails through a php script which then calls email2trac with the correct project id. The only problem: email attachments are not being attached to tickets. Adding an attachments to a ticket manually works. Executing email2trac with debug option reveals that attachments of mails are being parsed and created in the tmp folder.

Last log entry lines:

2016-11-17 13:17:33,867 email2trac 182: writing body to /tmp/182xZk6af.email2trac.body

2016-11-17 13:17:33,867 email2trac 182: function debug_attachments

2016-11-17 13:17:33,867 email2trac 182:          part0: Content-Type: application/pdf

2016-11-17 13:17:33,867 email2trac 182: writing /tmp/182xZk6af.email2trac.part1.pdf: filename: st-oktober.pdf

The file exists and is readable by the apache user (which is executing the email2trac command)

But the ticket itself has no attachment and the link in the description points to an invalid/missing attachments. Looking at the projects db, the attachment table doesn't contain an entry for the attachment.

Any ideas/suggestions where or what the problem might be?

Attachments (0)

Change History (12)

comment:1 Changed 6 years ago by magda@…

We are using trac 1.0.1 on Ubuntu 12.04.5 and emailt2trac 2.9.0.

comment:2 Changed 6 years ago by bas

  • Status changed from new to assigned

comment:3 Changed 6 years ago by bas

what are the permissions of the trac attachment folder? I think it is a permission issue. You must see this in the trac.log.

The most people use an MTA setup. There are some examples:

comment:4 Changed 6 years ago by magda@…

permissions of the attachment folder (located at projectId/files/) are fine.

drwxr-xr-x  3 www-data www-data 4.0K Nov 17 13:22 attachments

the trac.log doesn't reveal any problems. neither does the email2trac debug log.
email2trac log
trac.log

comment:5 Changed 6 years ago by bas

There is something wrong: wiki image link for: temp.png

2016-11-23 11:54:37,150 email2trac 182: Traceback (most recent call last):

2016-11-23 11:54:37,150 email2trac 182:   File "/usr/bin/email2trac", line 2905, in <module>
    tktparser.parse(sys.stdin)

2016-11-23 11:54:37,150 email2trac 182:   File "/usr/bin/email2trac", line 1814, in parse
    self.parse_subject_field(m, subject, spam_msg)

2016-11-23 11:54:37,150 email2trac 182:   File "/usr/bin/email2trac", line 1959, in parse_subject_field
    self.new_ticket(m, subject, spam_msg)

2016-11-23 11:54:37,150 email2trac 182:   File "/usr/bin/email2trac", line 1307, in new_ticket
    self.id = tkt.insert()

2016-11-23 11:54:37,150 email2trac 182:   File "/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/ticket/model.py", line 256, in insert
    listener.ticket_created(self)

2016-11-23 11:54:37,150 email2trac 182:   File "/usr/local/lib/python2.7/dist-packages/binary_agilo-1.3.14_PRO-py2.7.egg/agilo/scrum/burndown/changelistener.py", line 41, in ticket_created
    if not ticket.is_writeable_field(Key.SPRINT) or not ticket[Key.SPRINT]:

2016-11-23 11:54:37,151 email2trac 182: AttributeError: 'Ticket' object has no attribute 'is_writeable_field'
}}}}

I have no experience with agilo

comment:6 Changed 6 years ago by magda@…

I discovered that attachments are added correctly when I updating a ticket. So even the previoulsy broken links are working correctly when i resend the email with #ticketid: in as subject.

comment:7 follow-up: Changed 6 years ago by bas

So it only fails for new tickets? Maybe it is a permission problem in a workflow that "anonymous" user van not attachments.

comment:8 Changed 6 years ago by anonymous

that was actually the first thing i tried allowing anonymous users to add attachments but anyways creating and updating the ticket is done from the same email (and its an existing user)

comment:9 in reply to: ↑ 7 Changed 6 years ago by bas

Replying to bas:

So it only fails for new tickets? Maybe it is a permission problem in a workflow that "anonymous" user van not attachments.

If a ticket is created it fails with a python stackstrace in the agilo environment. I think some thing is missing for this environment. As said I can not test it. I am not using this plugin.

comment:10 Changed 6 years ago by bas

Sorry I missed this options. Do you run email2trac with agilo enabled:

  • -A, --agilo

SO:

  • email2trac --agilo or email2trac -A

comment:11 Changed 6 years ago by anonymous

Missed that, too! Thank you so much!

comment:12 Changed 6 years ago by anonymous

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

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.