Can't modify or create tickets after upgrading from 2 to 3 on a new machine

Hi,

I have had quite some difficulty performing this upgrade, I thought all
was well when I was finally able to log into RT3 and see a familiar set
of queues and tickets, but I am unable to modify existing tickets or
create new ones and I have reached the limit of my clue. The following
is the details of what I started with, what I am migrating too, how I
did it and how it doesn’t work:

I started with the following configuration:

FreeBSD 4.6.2-RELEASE-p26 i386
Apache/1.3.33
PostgreSQL 7.2.1
Perl 5.6.1
RT 2.0.15

Used rt-2.0-to-dumpfile to create a dump of this install.

Set up RT3 on a new system, with the following configuration:

FreeBSD 5.4-RELEASE-p4 amd64
Apache/2.0.54
PostgreSQL 7.4.8
Perl 5.8.6
RT 3.0.12

Built RT:

cd /usr/ports/www/rt3

Edited Makefile to set RT_PATH to a custom install prefix

Built the port

make -DWITH_FASTCGI -DWITH_APACHE2 -DDB_TYPE=Pg -DDB_DBA_USER=‘moo’ \

-DDB_DBA_PASSWORD=‘baa’ clean install

Edited RT_SiteConfig.pm

Setup the database

/usr/local/rt3/sbin/rt-setup-database \

–action init --dba ‘moo’ --dba-password ‘baa’

The I tried to use rt-2.0-to-dumpfile to import my data from RT2 (around
15 queues and 10,000 tickets). That failed miserably due to encoding
issues. After scanning the rt-users archives I followed the suggestion
of Julian Dunn:

http://lists.bestpractical.com/pipermail/rt-users/2005-July/032518.html

I have bludgeoned the importer into working by adding the statement:

Hacked by Julian

$RT::Handle->SimpleQuery(“SET CLIENT_ENCODING TO ‘LATIN1’”);

into the dumpfile-to-rt3.0 script. Note that one can’t translate
SQL_ASCII directly into UNICODE per the docs
(http://www.postgresql.org/docs/7.4/static/multibyte.html) so I chose
LATIN1 (ISO-8859-1) instead, in the hopes that this will work.

I still had a couple of tickets which would cause this to die, so at the
point in the code where this was happening I changed the die() to a
warn() and hoped for the best. Finally it would get all the way through
populating the database with my tickets.

Next I had some problems with the web interface, which was not related
to RT specifically and I was able to solve, but I will mention here as
possibly relevant as my workaround involved a hack to RT.
The problem was that in the migration to the new machine the version of
mod_auth_kerb (our RT is accessible only via https with krb5 auth) went
from 4 to 5. There is a change in the behaviour of the module such that
in 4 the HTTP env variable REMOTE_USER is set to , which in 5 it
is set to @. As all of my users are in RT as this
meant that I couldn’t log in. To work around this I modified
lib/RT/Interface/Web.pm as follows:

sub WebCanonicalizeInfo {
my $user;

if ( defined $ENV{'REMOTE_USER'} ) {
    $user = lc ( $ENV{'REMOTE_USER'} ) if( 

length($ENV{‘REMOTE_USER’}) );

20050815/dknight - mod_auth_kerb_5 sets REMOTE_USER to include the

realm,

but our users were created in the days of mod_auth_kerb_4 which did not.

    $user =~ s/\@isc.org$// if ($user =~ /\...@isc.org$/);

}

Now I can log into RT and see the queues and tickets I expect to see. I
cannot however modify existing tickets or create new ones. If I try to
add a new ticket using the web interface I get the following error
message upon clicking 'Create’
RT Error
Ticket could not be created due to an internal error

And the following in my Apache error log (tail -f errorlog | awk
-F’stderr: ’ ‘{print $2}’)
Queue->CustomFields is deprecated, use Queue->TicketCustomFields instead
at /usr/local/rt3ops/lib/RT/Queue_Overlay.pm line 516., referer:
https://ops2.isc.org/Ticket/Create.html?Queue=3
DBD::Pg::st execute failed: ERROR: duplicate key violates unique
constraint “tickets_pkey”, referer:
https://ops2.isc.org/Ticket/Create.html?Queue=3
RT::Handle=HASH(0x51f6e8) couldn’t execute the query ‘INSERT INTO
Tickets (Subject, Status, Queue, Creator, Owner, LastUpdatedBy, Started,
Type, Starts, Resolved, Created, Priority, Due, LastUpdated) VALUES (?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’ at
/usr/local/lib/perl5/site_perl/5.8.6/DBIx/SearchBuilder/Handle.pm line
494., referer: https://ops2.isc.org/Ticket/Create.html?Queue=3
[Thu Aug 18 19:28:21 2005] [crit]: Couldn’t create a ticket: Internal
Error: Couldn’t execute the query 'INSERT INTO Tickets (Subject, Status,
Queue, Creator, Owner, LastUpdatedBy, Started, Type, Starts, Resolved,
Created, Priority, Due, LastUpdated) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?)'ERROR: duplicate key violates unique constraint
"tickets_pkey", referer: https://ops2.isc.org/Ticket/Create.html?Queue=3
(/usr/local/rt3ops/lib/RT/Ticket_Overlay.pm:590), referer:
https://ops2.isc.org/Ticket/Create.html?Queue=3
[Thu Aug 18 19:28:21 2005] [error]: WebRT: Ticket could not be created
due to an internal error ()
(/usr/local/rt3ops/share/html/Elements/Error:54), referer:
https://ops2.isc.org/Ticket/Create.html?Queue=3-

This is where my clue runs out :frowning:

Anyone have any idea as to why this is happening?

dave

Dave Knight
Internet Systems Consortium