Autoreply: "can't build entity: no body, and not multipart"

Hi,

I recently installed RT 2.0.10 (the latest at the time), and have so far been very impressed with it. Unfortunately, last night I got a little over-enthusiastic and decided to customise my templates and scrips a little more. After doing this, and also making some permissions changes within RT, something broke :frowning:

Now, whenever a requestor emails RT to create a new ticket, they get an email bounce similar to this, from Mailer-Daemon@rt-host :

The following text was generated during the delivery attempt:
------ pipe to |/home/rt/rt2/bin/rt-mailgate --queue tickets --action correspond
canā€™t build entity: no body, and not multipart
------ This is a copy of the message, including all the headers. ------

Despite the bounce, a new ticket is created successfully - but the AutoReply template is never sent to the requestor, presumably due to the error above. As far as I can tell, Iā€™ve put all permissions back to the way they were before - but the above error still occurs.

Iā€™ve searched the archives, and found the following, which seems to be a similar problem:
http://lists.fsck.com/pipermail/rt-devel/2001-March/000985.html

Unfortunately I donā€™t know how to produce full debug logs similar to Carlā€™s in the message above. Is it as simple as adding ā€œā€“debugā€ to the commandline for rt?

I am in the lucky position of not having any real data in my RT system yet, so if needed I can simply blow away the database and start over. But, I would much rather help track this bug down and solve it!

Iā€™m happy to email Jesse off-list and provide a login (RT and/or ssh) to my RT system if that helps. I will also try some more things later on today, and see if I can figure out where this error is coming from - Iā€™ll post a reply to the list if I find anything.

Oh, and I have looked at the ChangeLog for 2.0.11. I canā€™t see anything that obviously fixes the above problem. If I have missed it, then apologies and I will upgrade to 2.0.11ā€¦

Thanks for your help!

Jonathan

Check that there is a blank line at the start of the Auto-Reply template.

If thereā€™s not, everything until the first blank line is treated as an
email header.

-fr.

At 08:18 11/01/02 +0000, Hunter, Jonathan wrote:

Now, whenever a requestor emails RT to create a new ticket,
they get an email bounce similar to this, from Mailer-Daemon@rt-host :

[ā€¦]

canā€™t build entity: no body, and not multipart

OK. I am pleased to report that I have found the problemā€¦ And, I can also report that it was a ā€œuser configuration errorā€, rather than anything wrong with RT per se. This was one of those problems that you just canā€™t spot even though you re-read the same code over and over again :slight_smile:

Here is what Iā€™d done. Whilst editing one of my templates, I added the following string to the body text. Spot the mistake:

ā€œā€¦your ticket ID is [{$rtname} #$Ticket->id()}]ā€

By simply adding the missing ā€œ{ā€, everything started working again. Simple enough, once I found itā€¦!

I guess I have two remaining questions thenā€¦

  1. Is there an easy way of stopping RT barfing on this type of syntax error? I havenā€™t looked at much code so far, but is it possible to execute the {ā€¦} replacements from the templates within an @eval() block?

Even if not, at least this message will now be in the mailing list archives, so anyone experiencing the same problem in future should be able to find a fix. Is it worth adding this to the Installation or Administration sections of the FAQ?

  1. How do I delete templates? I created two test templates for the queue in question whilst trying to debug this, and now Iā€™ve finished with them Iā€™d like to remove them. I must be missing something obvious, but I canā€™t see a ā€œdeleteā€ link anywhere??

Thanks again for your help!

Regards,

Jonathan

  1. Is there an easy way of stopping RT barfing on this type of syntax
    error? I havenā€™t looked at much code so far, but is it possible to
    execute the {ā€¦} replacements from the templates within an @eval()
    block?

Being able to see what a template looks like would be useful, particularly
against a given ticket/attachment.

  1. How do I delete templates? I created two test templates for the
    queue in question whilst trying to debug this, and now Iā€™ve finished
    with them Iā€™d like to remove them. I must be missing something
    obvious, but I canā€™t see a ā€œdeleteā€ link anywhere??

Nope. You either keep on editing it (everything can change), or simply
donā€™t refer to it in your Scrips. You canā€™t delete it from the WebUI.

                         Bruce Campbell                            RIPE
                                                                    NCC
                                                             Operations
  1. How do I delete templates? I created two test templates for the
    queue in question whilst trying to debug this, and now Iā€™ve finished
    with them Iā€™d like to remove them. I must be missing something
    obvious, but I canā€™t see a ā€œdeleteā€ link anywhere??

Nope. You either keep on editing it (everything can change), or simply
donā€™t refer to it in your Scrips. You canā€™t delete it from the WebUI.

Thatā€™s rather a bug. Jonathan: can you send a writeup to rt-2.0-bugs@fsck.com ?

ā€“
Bruce Campbell RIPE
NCC
Operations


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

http://www.bestpractical.com/products/rt ā€“ Trouble Ticketing. Free.