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.