[rt-users] dumpfile-to-rt-3.0 problem: parser: unterminated quotedstring
Alexei Barantsev
barancev at ispras.ru
Tue Jul 13 09:52:01 EDT 2004
Hi,
I've detected the reason of the problem, but I don't know how to woraroud
it.
The cause is that the attachment is marked as base64-encoded while IT IS
NOT!
It was base64-encoded in the RT2 database, I checked that up with direct SQL
query.
But serialized version of the ticket in the exported form contains decoded
content of the attachment.
I can't find decoding in rt-2.0-to-dumpfile script so it must be performed
somewhere in the RT library (probably $att->Content() do that???). So
dumpfile-to-rt-3.0 have to encode it back to base64 to be able to store it
to the database.
In this case the problem must be in this piece of code of the
rt-2.0-to-dumpfile script:
my $att_param ( sort keys %{ $att->{_AccessibleCache} } )
{
if ($att_param eq 'Content') {
$att_ds->{$att_param} = $att->Content();
} else {
$att_ds->{$att_param} =
$att->_Value($att_param)
if (defined $att->_Value($att_param)
);
}
and actualy there is no need to decode attachment content if it is
base64-encoded?
Regards,
--
Alexei Barantsev
UniTesK Product Line Manager, ISP RAS
mailto: barancev at ispras.ru
Phone : +7(095)912-5317(ext 4422)
Web : http://unitesk.com/
> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com
> [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf
> Of Alexei Barantsev
> Sent: Tuesday, July 13, 2004 11:38 AM
> To: rt-users at lists.bestpractical.com
> Subject: [rt-users] dumpfile-to-rt-3.0 problem: parser:
> unterminated quotedstring
>
> Hi,
>
> Now, I've coped with the subject encoding problem, I've
> faced another one that was mentioned on the list several
> times but no solution still found.
>
> Couldn't create attachment
> $VAR1 = {
> 'Subject' => '',
> 'ContentType' => 'image/gif',
> 'Filename' => 'configuration.gif',
> 'Headers' => 'Content-Type: image/gif;
> name="configuration.gif"
> Content-Disposition: inline; filename="configuration.gif"
> Content-Transfer-Encoding: base64
> ',
> 'Creator' => '11',
> 'Parent' => '1299',
> 'Created' => '2002-09-13 14:49:07+00',
> 'ContentEncoding' => 'base64',
> 'id' => '1301',
> 'TransactionId' => '1593'
> };
>
> ERROR: parser: unterminated quoted string at or near
> "'GIF89a¶Ў" at character 380
>
> It seems that import utility attempts to put decoded from
> base64 binary stream (that is GIF image in my case) to the
> 'content' column of the 'attachments' table. To do that it
> creates invalid SQL query including this binary stream.
>
> Syslog shows the following:
>
> Jul 13 10:52:20 sever RT: DBD::Pg::st execute failed:
> ERROR: parser:
> unterminated quoted string at or near "'GIF89a¶^AЎ" at
> character 380 at
> /usr/lib/perl5/site_perl/5.8.3/DBIx/SearchBuilder/Handle.pm
> line 410.
> (/usr/local/rt3/lib/RT.pm:247)
> Jul 13 10:52:20 sever RT: RT::Handle=HASH(0x8e0ef90)
> couldn't execute the query 'INSERT INTO Attachments
> (Subject, ContentType, Filename, Headers, Creator, Parent,
> Created, ContentEncoding, Content, id, TransactionId)
> VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' at
> /usr/lib/perl5/site_perl/5.8.3/DBIx/SearchBuilder/Handle.pm
> line 417.
> (/usr/local/rt3/lib/RT.pm:247)
> Jul 13 10:52:20 sever RT: Died at
> /home/barancev/tmp/rt2-to-rt3-1.23/dumpfile-to-rt-3.0 line 752.
> (/usr/local/rt3/lib/RT.pm:254)
>
> Regards,
> --
> Alexei Barantsev
> UniTesK Product Line Manager, ISP RAS
> mailto: barancev at ispras.ru
> Phone : +7(095)912-5317(ext 4422)
>
>
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT wiki at http://wiki.bestpractical.com
>
More information about the rt-users
mailing list