Rt CLI on rt-3-0-8

Hi All

When I try to rt CLI (from rt-3-0-8) on my rt-3-0-5 I get this error

rt: Malformed RT response from http://x.y.z.net. and no output

Anyone has a fix/workaround/suggestion to get rid of this error and get an
output without using the RTDEBUG value. Let me know if I shouldn’t cross post
this email.

Here is the output with RTDEBUG

RTDEBUG=3 ./rt ls -i “Status=‘new’ and Queue=‘20’”

POST http://x.y.z.net/REST/1.0/search/ticket
Content-Length: 346
Content-Type: multipart/form-data; boundary=xYzZY

–xYzZY
Content-Disposition: form-data; name=“format”

i
–xYzZY
Content-Disposition: form-data; name=“orderby”

–xYzZY
Content-Disposition: form-data; name=“query”

Status=‘new’ and Queue=‘20’
–xYzZY
Content-Disposition: form-data; name=“user”

Asif
–xYzZY
Content-Disposition: form-data; name=“pass”

xxxxxxxx
–xYzZY–

HTTP/1.1 200 OK
Connection: close
Server: Apache/1.3.27 (Unix) mod_perl/1.28
Content-Type: text/plain; charset=UTF-8
Client-Date: Tue, 20 Jan 2004 01:48:25 GMT
Client-Peer: 1.2.3.4:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Set-Cookie: RT_SID=36d903a60b462925df2e5962e65ba216; path=/

RT/3.0.5 200 Ok

ticket/104289
ticket/168706
ticket/183289
ticket/187265
ticket/202615
ticket/202695
ticket/202716

rt: Malformed RT response from http://x.y.z.net.

Thanks for all the suggestions
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
There’s no place like 127.0.0.1

Quoting Asif Iqbal iqbala@qwestip.net (2004-01-20 01:59:20 GMT):

Hi All

When I try to rt CLI (from rt-3-0-8) on my rt-3-0-5 I get this error

rt: Malformed RT response from http://x.y.z.net. and no output

Anyone has a fix/workaround/suggestion to get rid of this error and get an
output without using the RTDEBUG value. Let me know if I shouldn’t cross post
this email.

[followup-to trimmed to rt-devel]

The following patch may help:

diff -urNad /home/wompom/ads/debian/request-tracker3/request-tracker3-3.0.7+01/bin/rt.in request-tracker3-3.0.7+01/bin/rt.in
— /home/wompom/ads/debian/request-tracker3/request-tracker3-3.0.7+01/bin/rt.in
2003-11-18 03:54:05.000000000 +0000
+++ request-tracker3-3.0.7+01/bin/rt.in 2003-11-20 17:23:30.000000000 +0000
@@ -720,6 +720,7 @@
# a blank line, and arbitrary text.

     my ($head, $text) = split /\n\n/, $res->content, 2;
  •   $head =~ s/^\s+//;
       my ($status, @headers) = split /\n/, $head;
       $text =~ s/\n*$/\n/;
    

It was necessary for 3.0.7-01 and the patch at least still applies to
3.0.8 though I didn’t test whether it was necessary.

FAIR ISLE
VARIABLE 3 OR 4 BECOMING SOUTHEASTERLY 5 OR 6, VEERING WESTERLY 4 OR
5 IN WEST LATER. OCCASIONAL RAIN. MODERATE OR GOOD

At 2004-01-19 20:59:20 -0500, iqbala@qwestip.net wrote:

RT/3.0.5 200 Ok

ticket/104289
ticket/168706
ticket/183289
ticket/187265
ticket/202615
ticket/202695
ticket/202716

rt: Malformed RT response from http://x.y.z.net.

I can’t see why bin/rt thinks this response is malformed. I ran the code
by hand with your response, and saw no problems. Could you please try to
find out what the problem is by stepping through the submit() function?
In particular, start with the “if ($res->is_success)” around line 729.
(Print out $head/$text/$status after the two split()s.)

At 2004-01-20 09:37:51 +0000, a.d.stribblehill@durham.ac.uk wrote:

     my ($head, $text) = split /\n\n/, $res->content, 2;
  •   $head =~ s/^\s+//;
       my ($status, @headers) = split /\n/, $head;
       $text =~ s/\n*$/\n/;
    

It was necessary for 3.0.7-01 and the patch at least still applies to
3.0.8 though I didn’t test whether it was necessary.

I don’t understand why this is necessary, or what use it would be in the
problem reported above. In any case, the server shouldn’t send the extra
whitespace, so that should be fixed first.

– ams