[rt-users] Error Condition Unimplemented in RT::Handle migration from 3.6.5 to 4.0.5 database

Juanjo juanjillo at gmail.com
Wed Mar 21 03:58:36 EDT 2012


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
-- 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 <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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120321/62f4aeb3/attachment.htm>


More information about the rt-users mailing list