[rt-users] Error Condition Unimplemented in RT::Handle migration from 3.6.5 to 4.0.5 database
Kevin Falcone
falcone at bestpractical.com
Tue Mar 27 18:12:53 EDT 2012
On Tue, Mar 27, 2012 at 08:38:04AM +0200, Juanjo wrote:
> I still can*t upgrade in the Centos Server.
>
> I have to install two Ubuntu servers. One with the 3.8 Version and one with 4.0.1 version
> (with APT). And make and upgrade per version, Dump the original database and import to ubuntu,
> for migrate to 3.8.10. Dump and migrate to version 4.0.1 and so the last migration to the
> centos to reward at 4.0.5
>
> :( a lot of job and hours of restrore innodb tables, or changing all tables form myisam to
> innodb.
Your Scrip #10 has a Condition of 0, that is completely invalid.
Either delete that row or go into the UI and fix it to be a valid
condition and then select a Stage of disabled to disable the Scrip.
Setting a condition or action to 0 is something we allowed in earlier
versions of RT but wasn't a valid state to be in. Later versions of
3.8 began enforcing this. I suspect you chose an early enough version
of 3.8 to avoid this.
-kevin
> Any help with this problem.
>
> El 21 de marzo de 2012 08:58, Juanjo <[1]juanjillo at gmail.com> escribi*:
>
> My Database name is RT3.
>
> Execute the order to upgrade 3.7.19 and get this:
>
> Working with:
> Type: mysql
> Host: localhost
> Name: rt3
> User: rt_user
> DBA: root
> [Wed Mar 21 07:57:27 2012] [debug]: RT's GnuPG libraries couldn't successfully read your
> configured GnuPG home directory (/opt/rt4/var/data/gpg). PGP support has been disabled
> (/opt/rt4/sbin/../lib/RT/Config.pm:595)
> [Wed Mar 21 07:57:27 2012] [debug]: The RTAddressRegexp option is not set in the config. Not
> setting this option results in additional SQL queries to check whether each address belongs
> to RT or not. It is especially important to set this option if RT recieves emails on
> addresses that are not in the database or config. (/opt/rt4/sbin/../lib/RT/Config.pm:454)
> Now inserting data.
> [Wed Mar 21 07:57:27 2012] [debug]: Going to load 'etc/upgrade/3.7.19/content' data file
> (/opt/rt4/sbin/../lib/RT/Handle.pm:759)
> Couldn't finish 'insert' step.
>
> ERROR: Couldn't load data from 'etc/upgrade/3.7.19/content' for import:
>
> ERROR:RT::Scrip::Condition Unimplemented in RT::Handle. (etc/upgrade/3.7.19/content line 27)
> Compilation failed in require at /opt/rt4/sbin/../lib/RT/Handle.pm line 760.
>
> My script table, i don*t know if i can post and attacchment. so i paste the SQL
>
> -- phpMyAdmin SQL Dump
> -- version 3.4.9
> -- [2]http://www.phpmyadmin.net
> --
> -- Servidor: localhost
> -- Tiempo de generaci*n: 21-03-2012 a las 08:53:29
> -- Versi*n del servidor: 5.5.21
> -- Versi*n de PHP: 5.3.10
>
> SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
> SET time_zone = "+00:00";
>
> /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
> /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
> /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
> /*!40101 SET NAMES utf8 */;
>
> --
> -- Base de datos: `rt3`
> --
>
> -- --------------------------------------------------------
>
> --
> -- Estructura de tabla para la tabla `Scrips`
> --
>
> CREATE TABLE IF NOT EXISTS `Scrips` (
> `id` int(11) NOT NULL AUTO_INCREMENT,
> `Description` varchar(255) DEFAULT NULL,
> `ScripCondition` int(11) NOT NULL DEFAULT '0',
> `ScripAction` int(11) NOT NULL DEFAULT '0',
> `ConditionRules` text,
> `ActionRules` text,
> `CustomIsApplicableCode` text,
> `CustomPrepareCode` text,
> `CustomCommitCode` text,
> `Stage` varchar(32) DEFAULT NULL,
> `Queue` int(11) NOT NULL DEFAULT '0',
> `Template` int(11) NOT NULL DEFAULT '0',
> `Creator` int(11) NOT NULL DEFAULT '0',
> `Created` datetime DEFAULT NULL,
> `LastUpdatedBy` int(11) NOT NULL DEFAULT '0',
> `LastUpdated` datetime DEFAULT NULL,
> PRIMARY KEY (`id`)
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=24 ;
>
> --
> -- Volcado de datos para la tabla `Scrips`
> --
>
> INSERT INTO `Scrips` (`id`, `Description`, `ScripCondition`, `ScripAction`,
> `ConditionRules`, `ActionRules`, `CustomIsApplicableCode`, `CustomPrepareCode`,
> `CustomCommitCode`, `Stage`, `Queue`, `Template`, `Creator`, `Created`, `LastUpdatedBy`,
> `LastUpdated`) VALUES
> (1, 'On Correspond Open Tickets', 3, 17, NULL, NULL, NULL, NULL, NULL, 'TransactionCreate',
> 0, 1, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (2, 'On Owner Change Notify Owner', 7, 4, NULL, NULL, NULL, NULL, NULL, 'TransactionCreate',
> 0, 16, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (3, 'On Create Autoreply', 1, 1, NULL, NULL, NULL, NULL, NULL, 'TransactionCreate', 0, 13,
> 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (4, 'On Create Notify AdminCcs', 1, 8, NULL, NULL, NULL, NULL, NULL, 'TransactionCreate', 0,
> 3, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (5, 'On Correspond Notify AdminCcs', 3, 8, NULL, NULL, NULL, NULL, NULL,
> 'TransactionCreate', 0, 4, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (6, 'On Correspond Notify Requestors and Ccs', 3, 10, NULL, NULL, NULL, NULL, NULL,
> 'TransactionCreate', 0, 5, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (7, 'On Correspond Notify Other Recipients', 3, 14, NULL, NULL, NULL, NULL, NULL,
> 'TransactionCreate', 0, 5, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (8, 'On Comment Notify AdminCcs as Comment', 4, 7, NULL, NULL, NULL, NULL, NULL,
> 'TransactionCreate', 0, 6, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (9, 'On Comment Notify Other Recipients as Comment', 4, 13, NULL, NULL, NULL, NULL, NULL,
> 'TransactionCreate', 0, 5, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (10, NULL, 0, 2, NULL, NULL, NULL, NULL, NULL, 'TransactionCreate', 0, 8, 1, '2007-11-05
> 15:40:29', 1, '2007-11-05 15:40:29'),
> (11, 'When an approval ticket is created, notify the Owner and AdminCc of the item awaiting
> their approval', 10, 4, NULL, NULL, '\n $self->TicketObj->Type eq ''approval'' and\n
> $self->TransactionObj->Field eq ''Status'' and\n $self->TransactionObj->NewValue eq ''open''
> and\n eval { $T::Approving = ($self->TicketObj->AllDependedOnBy( Type => ''ticket'' ))[0]
> }\n ', NULL, NULL, 'TransactionCreate', 2, 9, 1, '2007-11-05 15:40:29', 1, '2007-11-05
> 15:40:29'),
> (12, 'If an approval is rejected, reject the original and delete pending approvals', 5, 15,
> NULL, NULL, NULL, '\n# -------------------------------------------------------------------
> #\nreturn(0) unless ( lc($self->TransactionObj->NewValue) eq "rejected" or\n
> lc($self->TransactionObj->NewValue) eq "deleted" );\n\nmy $rejected = 0;\nmy $links =
> $self->TicketObj->DependedOnBy;\nforeach my $link (@{ $links->ItemsArrayRef }) {\n my $obj =
> $link->BaseObj;\n if ($obj->QueueObj->IsActiveStatus($obj->Status)) {\n if ($obj->Type eq
> ''ticket'') {\n $obj->Comment(\n Content => $self->loc("Your request was rejected."),\n );\n
> $obj->SetStatus(\n Status => ''rejected'',\n Force => 1,\n );\n\n $T::Approval =
> $self->TicketObj; # so we can access it inside templates\n $self->{TicketObj} = $obj; # we
> want the original id in the token line\n $rejected = 1;\n }\n else {\n $obj->SetStatus(\n
> Status => ''deleted'',\n Force => 1,\n );\n }\n }\n}\n\n$links =
> $self->TicketObj->DependsOn;\nforeach my $link (@{ $links->ItemsArrayRef }) {\n my $obj =
> $link->TargetObj;\n if ($obj->QueueObj->IsActiveStatus($obj->Status)) {\n $obj->SetStatus(\n
> Status => ''deleted'',\n Force => 1,\n );\n }\n}\n\n# Now magically turn myself into a
> Requestor Notify object...\nrequire RT::Action::Notify; bless($self,
> ''RT::Action::Notify'');\n$self->{Argument} = ''Requestor''; $self->Prepare;\n\nreturn
> $rejected;\n# ------------------------------------------------------------------- #\n ',
> '"never needed"', 'TransactionCreate', 2, 12, 1, '2007-11-05 15:40:29', 1, '2007-11-05
> 15:40:29'),
> (13, 'When a ticket has been approved by any approver, add correspondence to the original
> ticket', 9, 15, NULL, NULL, NULL, '\n#
> ------------------------------------------------------------------- #\nreturn(0) unless
> ($self->TicketObj->Type eq ''approval'');\n\nmy $note;\nmy $t =
> $self->TicketObj->Transactions;\nwhile (my $o = $t->Next) {\n $note .= $o->Content . "\\n"
> if $o->ContentObj\n and $o->Content !~ /Default Approval/;\n}\n\nforeach my $obj
> ($self->TicketObj->AllDependedOnBy( Type => ''ticket'' )) {\n $obj->Comment(\n Content =>
> $self->loc( "Your request has been approved by [_1]. Other approvals may still be pending.",
> # loc\n $self->TransactionObj->CreatorObj->Name,\n ) . "\\n" . $self->loc( "Approver''s
> notes: [_1]", # loc\n $note\n ),\n );\n $T::Approval = $self->TicketObj; # so we can access
> it inside templates\n $self->{TicketObj} = $obj; # we want the original id in the token
> line\n}\n\n# Now magically turn myself into a Requestor Notify object...\nrequire
> RT::Action::Notify; bless($self, ''RT::Action::Notify'');\n$self->{Argument} =
> ''Requestor''; $self->Prepare;\n\nreturn 1;\n#
> ------------------------------------------------------------------- #\n ', '"never needed"',
> 'TransactionCreate', 2, 10, 1, '2007-11-05 15:40:29', 1, '2007-11-05 15:40:29'),
> (14, 'When a ticket has been approved by all approvers, add correspondence to the original
> ticket', 9, 15, NULL, NULL, NULL, '\n#
> ------------------------------------------------------------------- #\n# Find all the
> tickets that depend on this (that this is approving)\n\nmy $Ticket = $self->TicketObj;\nmy
> @TOP = $Ticket->AllDependedOnBy( Type => ''ticket'' );\nmy $links =
> $Ticket->DependedOnBy;\nmy $passed = 0;\n\nwhile (my $link = $links->Next) {\n my $obj =
> $link->BaseObj;\n next if ($obj->HasUnresolvedDependencies( Type => ''approval'' ));\n\n if
> ($obj->Type eq ''ticket'') {\n $obj->Comment(\n Content => $self->loc("Your request has been
> approved."),\n );\n $T::Approval = $Ticket; # so we can access it inside templates\n
> $self->{TicketObj} = $obj; # we want the original id in the token line\n $passed = 1;\n }\n
> elsif ($obj->Type eq ''approval'') {\n $obj->SetStatus( Status => ''open'', Force => 1 );\n
> }\n elsif ($RT::UseCodeTickets and $obj->Type eq ''code'') {\n my $code =
> $obj->Transactions->First->Content;\n my $rv;\n\n foreach my $TOP (@TOP) {\n local $@;\n
> $rv++ if eval $code;\n $RT::Logger->error("Cannot eval code: $@") if $@;\n }\n\n if ($rv or
> !@TOP) {\n $obj->SetStatus( Status => ''resolved'', Force => 1,);\n }\n else {\n
> $obj->SetStatus( Status => ''rejected'', Force => 1,);\n }\n }\n}\n\n# Now magically turn
> myself into a Requestor Notify object...\nrequire RT::Action::Notify; bless($self,
> ''RT::Action::Notify'');\n$self->{Argument} = ''Requestor''; $self->Prepare;\n\nreturn 0; #
> ignore $passed;\n# ------------------------------------------------------------------- #\n
> ', '"never needed"', 'TransactionCreate', 2, 11, 1, '2007-11-05 15:40:29', 1, '2007-11-05
> 15:40:29'),
> (15, 'Notify Owner on Comment', 4, 4, NULL, NULL, '', '', '', 'TransactionCreate', 0, 5, 12,
> '2007-11-06 18:03:24', 12, '2007-11-06 18:03:24'),
> (16, 'Notify Owner on Correspondence', 3, 4, NULL, NULL, '', '', '', 'TransactionCreate', 0,
> 5, 12, '2007-11-06 18:04:03', 12, '2007-11-06 18:04:03'),
> (17, 'On Resolve in General-ES Reopen', 9, 15, NULL, NULL, '', 'return 1;', '# get out
> unless ticket is in Dispatch\n return 1 unless $self->TicketObj->QueueObj->Name eq
> "General-ES";\n\n # ok, re-open ticket\n $RT::Logger->info("Re-openinging ticket #".
> $self->TicketObj->id ." - tried to resolve in Dispatch");\n my ($status, $msg) =
> $self->TicketObj->SetStatus( "open" );\n\n return 1;\n', 'TransactionCreate', 0, 1, 12,
> '2007-11-06 18:08:14', 12, '2007-11-06 18:08:14'),
> (18, 'On Resolve Set Owner', 9, 15, NULL, NULL, '', 'return 1;', '# get actor ID\r\n my
> $Actor = $self->TransactionObj->Creator;\r\n\r\n # if actor is RT_SystemUser then get out of
> here\r\n return 1 if $Actor == $RT::SystemUser->id;\r\n\r\n # get out unless ticket owner is
> nobody\r\n return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;\r\n\r\n # ok, try to
> change owner\r\n $RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user
> #". $Actor );\r\n my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );\r\n unless(
> $status ) {\r\n $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );\r\n
> return undef;\r\n }\r\n\r\nreturn 1;', 'TransactionCreate', 0, 1, 12, '2007-11-06 18:15:05',
> 12, '2007-11-06 18:15:05'),
> (19, 'On Create Autoreply - General-DE', 1, 1, NULL, NULL, '', '', '', 'Disabled', 0, 14,
> 12, '2007-11-07 12:41:40', 12, '2007-11-07 12:41:40'),
> (20, 'On Create Autoreply - General-NL', 1, 1, NULL, NULL, '', '', '', 'Disabled', 0, 15,
> 12, '2007-11-07 12:42:07', 12, '2007-11-07 12:42:07'),
> (21, 'On Resolve in General-DE Reopen', 9, 15, NULL, NULL, '', 'return 1;', '# get out
> unless ticket is in Dispatch\r\n return 1 unless $self->TicketObj->QueueObj->Name eq
> "General-DE";\r\n\r\n # ok, re-open ticket\r\n $RT::Logger->info("Re-openinging ticket #".
> $self->TicketObj->id ." - tried to resolve in Dispatch");\r\n my ($status, $msg) =
> $self->TicketObj->SetStatus( "open" );\r\n\r\n return 1;\r\n', 'TransactionCreate', 0, 1,
> 12, '2007-11-07 14:02:07', 12, '2007-11-07 14:02:07'),
> (22, 'On Resolve in General-NL Reopen', 9, 15, NULL, NULL, '', 'return 1;', '# get out
> unless ticket is in Dispatch\r\n return 1 unless $self->TicketObj->QueueObj->Name eq
> "General-NL";\r\n\r\n # ok, re-open ticket\r\n $RT::Logger->info("Re-openinging ticket #".
> $self->TicketObj->id ." - tried to resolve in Dispatch");\r\n my ($status, $msg) =
> $self->TicketObj->SetStatus( "open" );\r\n\r\n return 1;\r\n', 'TransactionCreate', 0, 1,
> 12, '2007-11-07 14:02:36', 12, '2007-11-07 14:02:36'),
> (23, 'Notify Owner on Create', 1, 3, NULL, NULL, '', '', '', 'TransactionCreate', 0, 16, 12,
> '2007-11-20 19:46:12', 12, '2007-11-20 19:46:12');
>
> /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
> /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
> /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
>
> El 21 de marzo de 2012 01:40, Kevin Falcone <[3]falcone at bestpractical.com> escribi*:
>
> On Tue, Mar 20, 2012 at 12:06:46PM +0100, Juanjo wrote:
> > I installa the new scenario, dump the old database and import in the new database.
> >
> > I try to upgrade the old to rt 4.0.5 installation.
> >
> > I do a Make initalize-database
> > import the rt3 database on rt4 database and do:
> >
> > ./rt-setup-database --prompt-for-dba-password --action upgrade
> >
> > From 3.6.5 to 3.7.10 works fine
> >
> > but from 3.7.10 to 3.7.19 i get this error.
> >
> > Proceed [y/N]:y
> > Processing 3.7.15
> > Now inserting data.
> > Processing 3.7.19
> > Now inserting data.
> > Couldn't finish 'upgrade' step.
> >
> > ERROR: Couldn't load data from './etc/upgrade/3.7.19/content' for import:
> >
> > ERROR:RT::Scrip::Condition Unimplemented in RT::Handle. (./etc/upgrade/3.7.19/content
> line 27)
> > Compilation failed in require at /opt/rt4/sbin/../lib/RT/Handle.pm line 760.
>
> Try setting Set($LogToScreen,'debug') in your RT_SiteConfig.pm and run
> just the 3.7.19 step
>
> ./sbin/rt-setup-database --action insert --datadir etc/upgrade/3.7.19
>
> It'd also be interesting to see what you have in your Scrips table.
> -kevin
>
> --
> Un saludo.
> Juanjo Corral
>
> --
> Un saludo.
> Juanjo Corral
>
> References
>
> Visible links
> 1. mailto:juanjillo at gmail.com
> 2. http://www.phpmyadmin.net/
> 3. mailto:falcone at bestpractical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120327/7d0808d3/attachment.sig>
More information about the rt-users
mailing list