Problem with slashes


#1

Hello

I create a new ticket via e-mail or vie web.
Subject line and body contain text with two slashes

for example {slash}{slash}server
\server

but I see only one slash in body

I suppose it is a error. :frowning:

Sergey Tsvetukhin, Deputy Chief Support&Service Officer
Open Technologies, tel: +7(095)787-7027
e-mail: tsv (at) ot.ru, http://www.ot.ru/


#2

Hello,

I create a new ticket via e-mail or vie web.
Subject line and body contain text with two slashes

I do not see this problem using rt-3.0.2pre4

you should consider telling us what rt version you are using.

Florent AIDE.


#3

I have the same problem (noticed somewhere around version 2-1-87). I’m
currently 3-0-2pre4 (with perl 5.8.0, apache 1.3.26, postgres 7.3.2r1-4)
but still have the backslash problem. The backslash is considered an
escape character so whenever I need to add text containing a backslash I
add a second one. Added text with only one backslash will end up with
the error:

Apr 28 13:35:24 rt postgres[1245]: [3] ERROR: Bad input string for type
bytea
Apr 28 15:35:24 rt RT: DBD::Pg::st execute failed: ERROR: Bad input
string for type bytea at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm
line 385. (/opt/rt3.0.2pre4/lib/RT.pm:222)
Apr 28 15:35:24 rt RT: RT::Handle=HASH(0x9840830) couldn’t execute the
query ‘INSERT INTO Attachments (Subject, ContentType, Filename, Headers,
Creator, Parent, Created, ContentEncoding, Content, TransactionId)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ at
/usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 392.
(/opt/rt3.0.2pre4/lib/RT.pm:222)

regards,

Alex Fung A Foek

Sergey Tsvetukhin wrote:


#4

If you followed the upgrade procedure through the betas, you should have
converted all of your bytea columns to ‘text’.

That’s your problem.On Mon, Apr 28, 2003 at 01:57:11PM +0200, Alex Fung A Foek wrote:

I have the same problem (noticed somewhere around version 2-1-87). I’m
currently 3-0-2pre4 (with perl 5.8.0, apache 1.3.26, postgres 7.3.2r1-4)
but still have the backslash problem. The backslash is considered an
escape character so whenever I need to add text containing a backslash I
add a second one. Added text with only one backslash will end up with
the error:

Apr 28 13:35:24 rt postgres[1245]: [3] ERROR: Bad input string for type
bytea
Apr 28 15:35:24 rt RT: DBD::Pg::st execute failed: ERROR: Bad input
string for type bytea at /usr/share/perl5/DBIx/SearchBuilder/Handle.pm
line 385. (/opt/rt3.0.2pre4/lib/RT.pm:222)
Apr 28 15:35:24 rt RT: RT::Handle=HASH(0x9840830) couldn’t execute the
query ‘INSERT INTO Attachments (Subject, ContentType, Filename, Headers,
Creator, Parent, Created, ContentEncoding, Content, TransactionId)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ at
/usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 392.
(/opt/rt3.0.2pre4/lib/RT.pm:222)

regards,

Alex Fung A Foek

Sergey Tsvetukhin wrote:

Hello

I create a new ticket via e-mail or vie web.
Subject line and body contain text with two slashes

for example {slash}{slash}server
\server

but I see only one slash in body

I suppose it is a error. :frowning:


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

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

http://www.bestpractical.com/rt – Trouble Ticketing. Free.


#5

---------- Message transmis ----------Subject: Re: [rt-users] problem with slashes
Date: Lundi 28 Avril 2003 12:03
From: Sergey Tsvetukhin tsv@ot.ru
To: Aide Florent faide@alphacent.com

Hello,

I create a new ticket via e-mail or vie web.
Subject line and body contain text with two slashes

I do not see this problem using rt-3.0.2pre4

you should consider telling us what rt version you are using.

sorry,

rt-3.0.2pre3
perl 5.8.0
Solaris 2.8

Florent AIDE.

Sergey Tsvetukhin, Deputy Chief Support&Service Officer
Open Technologies, tel: +7(095)787-7027
e-mail: tsv (at) ot.ru, http://www.ot.ru/


#6

I do not see this problem using rt-3.0.2pre4

you should consider telling us what rt version you are using.

since you answered you used 3.0.2pre3 you should consider an upgrade to
3.0.2pre4 which eliminates many problems.

The anti-slash “” (simple or double) pb seems to be linked with a bad upgrade
more than with the version itself… you should see a post just following the
next thread by Jesse.

Hope it helps.

Florent AIDE


#7

Thanks Jesse! It works fine now.

I’ve searched the mailing list and used the update_rt script from David
Wheeler (posted 4/3/2003 12:52 AM) to convert the postgres db.

regards, Alex

Jesse Vincent wrote:


#8

Does anyone have the link to this script? I know it’s been quite some time so I’m wondering where I can find this. I running RT 4.0.8 with PostgreSQL 9.2, converted over from MySQL using pgloader. I’m having these same issues when trying to add replies or comments to tickets with slashes. I’m also having issues with fulltext-search and bytea, preventing indexing from completing.

Any help would be greatly appreciated.


#9

Found it. However, the 12:52 was in local time, not absolute time.
Details below.

/jeff

Post:
https://marc.info/?l=rt-users&m=104932414019979&w=2
File:
https://marc.info/?l=rt-users&m=104932414019979&q=p3
Quote:
[“update_rt” (update_rt)]

#!/usr/bin/perl -w
use strict;

use DBI;
use DBD::Pg;

my $dbh = DBI->connect(‘dbi:Pg:dbname=rt3’, ‘postgres’, ‘’);

foreach my $col (qw(Content Headers)) {
$dbh->do(“ALTER TABLE Attachments RENAME COLUMN $col to Old$col”);
$dbh->do(“ALTER TABLE Attachments ADD COLUMN $col text NULL”);

my $sel = $dbh->prepare("SELECT id, Old$col FROM Attachments");
my $upd = $dbh->prepare("UPDATE Attachments SET $col = ? WHERE id = ?");
my ($id, $data);
$sel->execute;
$sel->bind_columns(\$id, \$data);
while ($sel->fetch) {
    $upd->execute($data, $id);
}
$dbh->do("ALTER TABLE Attachments DROP COLUMN Old$col");

}
$dbh->disconnect;


#10

Thanks!

I was able to modify /opt/rt4/lib/RT/Attachment.pm to get to this work as well. My RT 4.0.8 install was different so the file location was actually /opt/rt4/as/Linux/local/lib/RT/Attachment.pm.

On RT 4.0.8
Add line 193 in file
$Body =~ /\/\\/gm;

Just above this:
my $id = $self->SUPER::Create(
TransactionId => $args{‘TransactionId’},
ContentType => $ContentType,
ContentEncoding => $ContentEncoding,
Parent => $args{‘Parent’},
Headers => $head,
Subject => $Subject,
Content => $Body,
Filename => $Filename,
MessageId => $MessageId,
);

On RT 4.4.2:
Add line 207 in file:
$content =~ s/\/\\/gm;

Just above this:
my $id = $self->SUPER::Create(
TransactionId => $args{‘TransactionId’},
ContentType => $type,
ContentEncoding => $encoding,
Parent => $args{‘Parent’},
Headers => $head,
Subject => $Subject,
Content => $content,
Filename => $Filename,
MessageId => $MessageId,
);