Problem with slashes

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/

1 Like

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.

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:

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

Request Tracker... So much more than a help desk ā€” Best Practical Solutions ā€“ Trouble Ticketing. Free.

---------- 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/

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

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:

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.

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;

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,
);