Problem with attachments

Good morning.

I have fighting with this problem two days, but I still have no clue.

The problem is this: suddenly RT will not send attachments.

Unfortunately we send attachments very rarely, so I cannot exactly say when this behaviour started. It could be that it started from the day I upgraded our installation from 4.2.3 to 4.2.9 (in december), or later when I added/upgraded some extensions (RT-Extension-Announce-1.00, rt-extension-customfieldsonupdate, RT-Extension-SpawnLinkedTicketInQueue-1.01).

I tried everything I could to debug the problem. I am sure sendmail is working well, because I can send mails with attachments using the simple “mail” interface from the same server where RT resides.

I just finished examining RT’s log (in debug mode), regarding a test ticket I created and then resolved adding an attachment. There is no error at all in the log, let alone a warning message that says

[warning]: Couldn’t load object RT::Transaction #0 (/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:3026)

but I don’t think this is a real problem, since we had have this type of message for a long time with no apparent symptoms (please reply if I’m wrong).

I can easily see that RT is skipping the attachment somehow. Here is an old header from a mail of ticket that contained an attachment:Subject: [DBA #7162] prova allegato
From: “Cristiano Guadagnino via RT” dba@amended
Reply-To: dba@amended
In-Reply-To:
References: RT-Ticket-7162@amended
Message-ID: rt-3.8.6-13489-1258986687-217.7162-10-0@amended
Precedence: bulk
X-RT-Loop-Prevention: DBA e SCHEDULAZIONE
RT-Ticket: DBA e SCHEDULAZIONE #7162
Managed-by: RT 3.8.6 (Request Tracker — Best Practical Solutions)
RT-Originator: guadagnino.cristiano@amended
Cc: trombetta.giampaolo@amended
MIME-Version: 1.0
X-RT-Original-Encoding: utf-8
Date: Mon, 23 Nov 2009 15:31:28 +0100
RT-Attachment: 7162/105417/63969
Content-Type: text/plain; charset=“utf-8”
Content-Transfer-Encoding: 8bit

Here is the header from the mail of the test ticket I just created:

Subject: [BKGS #94919] Prova 3
Content-Type: multipart/alternative; boundary=“----------=_1422441180-4767-8”
From: “Cristiano Guadagnino via RT” bksistemi@creval.itmailto:bksistemi@creval.it
Reply-To: bksistemi@creval.itmailto:bksistemi@creval.it

X-RT-Loop-Prevention: Bankadati Servizi Informatici
X-RT-Ticket: Bankadati Servizi Informatici #94919
X-Managed-BY: RT 4.2.9 (Request Tracker — Best Practical Solutions)
X-RT-Originator: guadagnino.cristiano@creval.itmailto:guadagnino.cristiano@creval.it
To: criguada@gmail.commailto:criguada@gmail.com
Precedence: bulk
Date: Wed, 28 Jan 2015 11:33:00 +0100
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 0

We have not changed the resolution template recently (I mean in the last 2 years). The template starts with:

Content-Type: text/html
Subject: {$Ticket->Subject}
RT-Attach-Message: yes

Risoluzione:

(...)

It is as if the RT-Attach-Message special header didn’t work anymore, or if it suddenly doesn’t consider the attachment in the last transaction.

I am out of ideas, could somebody try to help me?

Thank you in advance.

Cris

It dawned on me that maybe the problem was only with the resolution message (which is of type comment), so I tried with a simple reply with an attachment, and it worked.

Was there a change in the way RT 4.2.9 handles comments? We had no problem previously sending out an email with attachment on resolution of the ticket. We upgraded from RT 4.2.3 IIRC.

CrisOn 28/01/2015 12:53, Guadagnino Cristiano wrote:
Good morning.

I have fighting with this problem two days, but I still have no clue.

The problem is this: suddenly RT will not send attachments.

Unfortunately we send attachments very rarely, so I cannot exactly say when this behaviour started. It could be that it started from the day I upgraded our installation from 4.2.3 to 4.2.9 (in december), or later when I added/upgraded some extensions (RT-Extension-Announce-1.00, rt-extension-customfieldsonupdate, RT-Extension-SpawnLinkedTicketInQueue-1.01).

I tried everything I could to debug the problem. I am sure sendmail is working well, because I can send mails with attachments using the simple “mail” interface from the same server where RT resides.

I just finished examining RT’s log (in debug mode), regarding a test ticket I created and then resolved adding an attachment. There is no error at all in the log, let alone a warning message that says

[warning]: Couldn’t load object RT::Transaction #0 (/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:3026)

but I don’t think this is a real problem, since we had have this type of message for a long time with no apparent symptoms (please reply if I’m wrong).

I can easily see that RT is skipping the attachment somehow. Here is an old header from a mail of ticket that contained an attachment:

Subject: [DBA #7162] prova allegato
From: “Cristiano Guadagnino via RT” dba@amended
Reply-To: dba@amended
In-Reply-To:
References: RT-Ticket-7162@amended
Message-ID: rt-3.8.6-13489-1258986687-217.7162-10-0@amended
Precedence: bulk
X-RT-Loop-Prevention: DBA e SCHEDULAZIONE
RT-Ticket: DBA e SCHEDULAZIONE #7162
Managed-by: RT 3.8.6 (Request Tracker — Best Practical Solutions)
RT-Originator: guadagnino.cristiano@amended
Cc: trombetta.giampaolo@amended

Cristiano Guadagnino

Servizio Sistemi Dipartimentali, Periferici e DB
Bankadati Servizi Informatici Soc.Cons.P.A.
Gruppo bancario Credito Valtellinese
VIA TRENTO, 22 - 23100 SONDRIO
tel +39 0342522172 - fax +39 0342522997
guadagnino.cristiano@creval.it
www.creval.ithttp://www.creval.it

Il presente messaggio non è di natura personale ma inviato per esigenze lavorative; l’eventuale messaggio di risposta potrà essere conosciuto anche da altri soggetti diversi dall’originatore di questo messaggio per dette esigenze o per controllo aziendale. Questo messaggio, corredato dei relativi allegati, contiene informazioni da considerarsi strettamente riservate, ed è destinato esclusivamente al destinatario sopra indicato, il quale è l’unico autorizzato ad usarlo, copiarlo e, sotto la propria responsabilità, diffonderlo. Chiunque ricevesse questo messaggio per errore o comunque lo leggesse senza esserne legittimato è avvertito che trattenerlo, copiarlo, divulgarlo, distribuirlo a persone diverse dal destinatario è severamente proibito, ed è pregato di rinviarlo immediatamente al mittente distruggendone l’originale.

MIME-Version: 1.0
X-RT-Original-Encoding: utf-8
Date: Mon, 23 Nov 2009 15:31:28 +0100
RT-Attachment: 7162/105417/63969
Content-Type: text/plain; charset=“utf-8”
Content-Transfer-Encoding: 8bit

Here is the header from the mail of the test ticket I just created:

Subject: [BKGS #94919] Prova 3
Content-Type: multipart/alternative; boundary=“----------=_1422441180-4767-8”
From: “Cristiano Guadagnino via RT” bksistemi@creval.itmailto:bksistemi@creval.it
Reply-To: bksistemi@creval.itmailto:bksistemi@creval.it
References: RT-Ticket-94919@creval.itmailto:RT-Ticket-94919@creval.it
Message-ID: rt-4.2.9-4767-1422441180-1538.94919-10-0@creval.itmailto:rt-4.2.9-4767-1422441180-1538.94919-10-0@creval.it
X-RT-Loop-Prevention: Bankadati Servizi Informatici
X-RT-Ticket: Bankadati Servizi Informatici #94919
X-Managed-BY: RT 4.2.9 (Request Tracker — Best Practical Solutions)
X-RT-Originator: guadagnino.cristiano@creval.itmailto:guadagnino.cristiano@creval.it
To: criguada@gmail.commailto:criguada@gmail.com
Precedence: bulk
Date: Wed, 28 Jan 2015 11:33:00 +0100
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Length: 0

We have not changed the resolution template recently (I mean in the last 2 years). The template starts with:

Content-Type: text/html
Subject: {$Ticket->Subject}
RT-Attach-Message: yes

Risoluzione:

(...)

It is as if the RT-Attach-Message special header didn’t work anymore, or if it suddenly doesn’t consider the attachment in the last transaction.

I am out of ideas, could somebody try to help me?

Thank you in advance.

Cris

Unfortunately we send attachments very rarely, so I cannot exactly
say when this behaviour started. It could be that it started from the
day I upgraded our installation from 4.2.3 to 4.2.9 (in december), or
later when I added/upgraded some extensions
(RT-Extension-Announce-1.00, rt-extension-customfieldsonupdate,
RT-Extension-SpawnLinkedTicketInQueue-1.01).

You may wish to try disabling those extensions temporarily to see if
that helps resolve the issue. However, see below.

I just finished examining RT’s log (in debug mode), regarding a test
ticket I created and then resolved adding an attachment. There is no
error at all in the log, let alone a warning message that says

[warning]: Couldn’t load object RT::Transaction #0
(/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:3026)

but I don’t think this is a real problem, since we had have this type
of message for a long time with no apparent symptoms (please reply if
I’m wrong).

That warning is extremely worrisome, and I expect the cause of your
problem. You should run /opt/rt4/sbin/rt-validator.

  • Alex

Alex,
I did this: I took a backup of my production RT and restored it on our testing environment.
I perused rt-validator till I had no more warnings (well, I still have a few warnings related to articles: it seems rt-validator cannot fix them).
Then I created a test ticket and resolved it attaching a file.

As in our production system, the attachment did not get sent, and the last line in RT’s log was again this:

[15371] [Tue Feb 3 15:28:32 2015] [warning]: Couldn’t load object RT::Transaction #0 (/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:3026)

Any hint?

Thank you in advance.

CrisOn 29/01/2015 21:06, Alex Vandiver wrote:

On Wed, 28 Jan 2015 11:53:53 +0000 Guadagnino Cristiano guadagnino.cristiano@creval.itmailto:guadagnino.cristiano@creval.it wrote:

(…)

[warning]: Couldn’t load object RT::Transaction #0
(/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:3026)

but I don’t think this is a real problem, since we had have this type
of message for a long time with no apparent symptoms (please reply if
I’m wrong).

That warning is extremely worrisome, and I expect the cause of your
problem. You should run /opt/rt4/sbin/rt-validator.

  • Alex

I did this: I took a backup of my production RT and restored it on
our testing environment. I perused rt-validator till I had no more
warnings (well, I still have a few warnings related to articles: it
seems rt-validator cannot fix them). Then I created a test ticket and
resolved it attaching a file.

As in our production system, the attachment did not get sent, and the
last line in RT’s log was again this:

[15371] [Tue Feb 3 15:28:32 2015] [warning]: Couldn’t load object
RT::Transaction #0 (/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:3026)

Any hint?

Try disabling the extensions you have installed and see if removing any
of them fixes it. My suspicion is on CustomFieldsOnUpdate, from the
previous list you gave.

  • Alex

Alex,
I disabled CustomFieldsOnUpdate by commenting out the
“Plugin(‘RT::Extension::CustomFieldsOnUpdate’);” line in
RT_SiteConfig.pm, then I stopped Apache, cleared the mason cache, and
restarted Apache.

I tested resolving a ticket adding an attachment, but had the same
behavior as before.

I then also disabled the “Announce” extension by following the same
procedure, but still I had no success.

Those are the only two extensions I added recently (other extensions are
loaded but they have been there for years).

Is it sufficient to disable the extensions by commenting them out in the
RT_Siteconfig.pm file or should I completely uninstall them? If so, how
do I do it?

Thank you in advance

CrisOn 03/02/2015 17:30, Alex Vandiver wrote:

On Tue, 3 Feb 2015 15:43:05 +0000 Guadagnino Cristiano guadagnino.cristiano@creval.it wrote:

I did this: I took a backup of my production RT and restored it on
our testing environment. I perused rt-validator till I had no more
warnings (well, I still have a few warnings related to articles: it
seems rt-validator cannot fix them). Then I created a test ticket and
resolved it attaching a file.

As in our production system, the attachment did not get sent, and the
last line in RT’s log was again this:

[15371] [Tue Feb 3 15:28:32 2015] [warning]: Couldn’t load object
RT::Transaction #0 (/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:3026)

Any hint?
Try disabling the extensions you have installed and see if removing any
of them fixes it. My suspicion is on CustomFieldsOnUpdate, from the
previous list you gave.

  • Alex

I disabled CustomFieldsOnUpdate by commenting out the
“Plugin(‘RT::Extension::CustomFieldsOnUpdate’);” line in
RT_SiteConfig.pm, then I stopped Apache, cleared the mason cache, and
restarted Apache.

I tested resolving a ticket adding an attachment, but had the same
behavior as before.

I then also disabled the “Announce” extension by following the same
procedure, but still I had no success.

Those are the only two extensions I added recently (other extensions
are loaded but they have been there for years).

Is it sufficient to disable the extensions by commenting them out in
the RT_Siteconfig.pm file or should I completely uninstall them? If
so, how do I do it?

Removing the Plugin line should mostly suffice; removing the files from
disk does no better. Fully removing a plugin requires backing out
database contents that relay on it, (like the RTAnnounce) queue, but
that’s not relevant for this test.

  • Alex

Thank you Alex,
so basically my test is correct and my problem is not solved.
Back to the drawing board :frowning:

Let’s see if I can give some more detail, to help you in helping me :slight_smile:

Here is the header of a mail sent when replying with an attachment (as shown by RT - color and emphasis by me):

Email Source for Ticket 95127, Attachment 1198765From: Cristiano Guadagnino bksistemi@AMENDED

Subject: [BKGS #95127] Prova attachment

Reply-To: bksistemi@AMENDED

X-RT-Loop-Prevention: Bankadati Servizi Informatici (TEST)

X-RT-Ticket: Bankadati Servizi Informatici (TEST) #95127

X-Managed-BY: RT 4.2.9 (Request Tracker — Best Practical Solutions)

X-RT-Originator: guadagnino.cristiano@AMENDED

To: criguada@AMENDED

Precedence: bulk

Date: Wed, 04 Feb 2015 12:06:14 +0100

MIME-Version: 1.0

RT-Attachment: 95127/1383139/1198764

Content-Type: multipart/alternative; boundary=“----------=_1423047973-22299-11”

Content-Length: 0

Here is the header of a mail sent when resolving with an attachment (as shown by RT):

Email Source for Ticket 95127, Attachment 1198757

Subject: [BKGS #95127] Prova attachment

Content-Type: multipart/alternative; boundary=“----------=_1423047772-22299-7”

From: “Cristiano Guadagnino via RT” bksistemi@AMENDED

Reply-To: bksistemi@AMENDED

X-RT-Loop-Prevention: Bankadati Servizi Informatici (TEST)

X-RT-Ticket: Bankadati Servizi Informatici (TEST) #95127

X-Managed-BY: RT 4.2.9 (Request Tracker — Best Practical Solutions)

X-RT-Originator: guadagnino.cristiano@AMENDED

To: criguada@AMENDED

Precedence: bulk

Date: Wed, 04 Feb 2015 12:02:52 +0100

MIME-Version: 1.0

Content-Transfer-Encoding: 8bit

Content-Length: 0

Is there anything that can help shed some light?

T.I.A.

Cris

Thank you Alex,
so basically my test is correct and my problem is not solved.
Back to the drawing board :frowning:

Let’s see if I can give some more detail, to help you in helping
me :slight_smile:

Those two mails are sent by different scrips. Check that the template
for the latter scrip has “RT-Send-Attachment: yes” in the headers
section.

  • Alex

Both templates contain “RT-Send-Attachment: yes” as second row.
Yesterday I did some more experiments, unfortunately without success.

CrisOn 04/02/2015 20:03, Alex Vandiver wrote:

On Wed, 4 Feb 2015 18:26:36 +0000 Guadagnino Cristiano guadagnino.cristiano@creval.it wrote:

Thank you Alex,
so basically my test is correct and my problem is not solved.
Back to the drawing board :frowning:

Let’s see if I can give some more detail, to help you in helping
me :slight_smile:
Those two mails are sent by different scrips. Check that the template
for the latter scrip has “RT-Send-Attachment: yes” in the headers
section.

  • Alex

Both templates contain “RT-Send-Attachment: yes” as second row.
Yesterday I did some more experiments, unfortunately without success.

Cris

Thank you Alex,
so basically my test is correct and my problem is not solved.
Back to the drawing board :frowning:

Let’s see if I can give some more detail, to help you in helping
me :slight_smile:
Those two mails are sent by different scrips. Check that the template
for the latter scrip has “RT-Send-Attachment: yes” in the headers
section.

  • Alex
    “Magic headers” need to be in the first paragraph.
    If the first line is blank remove it. Make sure there is a blank line
    after RT-Send-Attachment and before the main template.

Jeff, thank you for your reply.

My templates have not been varied in the last couple of years.
Anyway, here is my “correspondence” template (which is working):

Content-Type: text/html
RT-Attach-Message: yes
From: {
my $u = $Transaction->CreatorObj;
my $a = $Ticket->QueueObj->CorrespondAddress;
$a = $Ticket->QueueObj->CommentAddress if ( $Transaction->Type eq
‘Comment’ );
my $res = $u->RealName || $u->Name;
$res .= " <“.$a .”>" ;
$res; }

{$Transaction->Content()}

And here is (part of) my “resolved” template, which suddenly is not
working anymore (i.e. files are not attached):

Content-Type: text/html
RT-Attach-Message: yes
Subject: {$Ticket->Subject}

Risoluzione:

{ my $Transactions = $Ticket->Transactions; $Transactions->Limit( FIELD => 'Type', VALUE => 'Comment' ); $Transactions->OrderByCols ( { FIELD => 'Created', ORDER => 'DESC' }, { FIELD => 'id', ORDER => 'DESC' }, );

my $resolution_comment;
my $CommentObj = $Transactions->First;
if( $CommentObj && $CommentObj->id ) {
$resolution_comment = $CommentObj->Content;
}

$resolution_comment;
}

(…)

Thank you in advance.

CrisOn 06/02/2015 13:06, Jeff Voskamp wrote:

“Magic headers” need to be in the first paragraph.
If the first line is blank remove it. Make sure there is a blank line
after RT-Send-Attachment and before the main template.