Problem creating tickets

System: Redhat Linux 6.2/alpha
DB: Postgres 7.3
RT version: 2.0.15

I went through, got RT up and running, created users, set permissions, and
a whole buncha other stuff, but, creating a test ticket, I got this
message after hitting submit.

http://rt.server/rt2/Ticket/Display.html

System error
error: Can’t bind a reference (Class::ReturnValue=HASH(0x122911000)) at
/usr/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Handle.pm line 376.
context:

372: do_backtrace => undef);
373: return ($ret->return_value);
374: }
375: }
376: unless ( $sth->execute(@bind_values) ) {
377: if ($DEBUG) {
378: die "$self couldn’t execute the query ‘$QueryString’"
379: . $self->dbh->errstr . “\n”;
380:

code stack:
/usr/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Handle.pm:376
/usr/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Handle.pm:319
/usr/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Record.pm:636
/usr/local/rt2/lib/RT/Ticket.pm:342
/usr/local/rt2/WebRT/html/Ticket/Display.html:87
/usr/local/rt2/WebRT/html/autohandler:58

in lib/RT/Ticket.pm, there’s a routine called “Create”.

it contains the line:

my ($val, $msg) = $self->__Set(Field => ‘EffectiveId’, Value => $id);

For debugging purposes, it would be incredibly useful if you would
insert the following lines before that line:

use Data::Dumper;
die scalar Dumper($id);

Then, stop apache, start apache and try creating a ticket over the web.
It will die with an error. send the full text of that error to the
list.

There’s some error condition with postgres 7.3 that we’re not handling
and clearly not aware of.

As a temporary fix, try replacing that with:

my ($val, $msg) = $self->__Set(Field => ‘EffectiveId’, Value => $self->id);

and tell me if the problem goes away?On Fri, Dec 13, 2002 at 03:34:06PM -0500, John Jasen wrote:

System: Redhat Linux 6.2/alpha
DB: Postgres 7.3
RT version: 2.0.15

I went through, got RT up and running, created users, set permissions, and
a whole buncha other stuff, but, creating a test ticket, I got this
message after hitting submit.

http://rt.server/rt2/Ticket/Display.html

System error
error: Can’t bind a reference (Class::ReturnValue=HASH(0x122911000)) at
/usr/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Handle.pm line 376.
context:

372: do_backtrace => undef);
373: return ($ret->return_value);
374: }
375: }
376: unless ( $sth->execute(@bind_values) ) {
377: if ($DEBUG) {
378: die "$self couldn’t execute the query ‘$QueryString’"
379: . $self->dbh->errstr . “\n”;
380:

code stack:
/usr/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Handle.pm:376
/usr/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Handle.pm:319
/usr/lib/perl5/site_perl/5.005/DBIx/SearchBuilder/Record.pm:636
/usr/local/rt2/lib/RT/Ticket.pm:342
/usr/local/rt2/WebRT/html/Ticket/Display.html:87
/usr/local/rt2/WebRT/html/autohandler:58


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.

changes made with Data::Dumper

new error is:

System error
error: $VAR1 = bless( {
‘error_message’ => 'Couldn’t execute the query 'INSERT INTO Tickets
(Starts, Type, Priority, Resolved, Status, Queue, Owner, InitialPriority,
FinalPriority, Subject, Creator, LastUpdatedBy, Created, TimeLeft,
TimeWorked, LastUpdated, Due) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?)‘ERROR: pg_atoi: zero-length string’, ‘errno’ => -1 },
‘Class::ReturnValue’ );
context:

339: Due => $due->ISO
340: );
341: #Set the ticket’s effective ID now that we’ve created it.
342: use Data::Dumper;
343: die scalar Dumper($id);
344: my ($val, $msg) = $self->__Set(Field => ‘EffectiveId’, Value =>
$id);
345:
346: unless ($val) {
347: $RT::Logger->err("$self ->Create couldn’t set EffectiveId: $msg\n");

code stack: /usr/local/rt2/lib/RT/Ticket.pm:343
/usr/local/rt2/WebRT/html/Ticket/Display.html:87
/usr/local/rt2/WebRT/html/autohandler:58

Hm, that looks like the basic insert is totally failing. Can you turn on
postgres query logging and seeing exactly what’s being sent over the
wire to the database?a

‘ERROR: pg_atoi: zero-length string’ doesn’t really clue me in.

-jOn Fri, Dec 13, 2002 at 03:47:05PM -0500, John Jasen wrote:

changes made with Data::Dumper

new error is:

System error
error: $VAR1 = bless( {
‘error_message’ => 'Couldn’t execute the query 'INSERT INTO Tickets
(Starts, Type, Priority, Resolved, Status, Queue, Owner, InitialPriority,
FinalPriority, Subject, Creator, LastUpdatedBy, Created, TimeLeft,
TimeWorked, LastUpdated, Due) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?)‘ERROR: pg_atoi: zero-length string’, ‘errno’ => -1 },
‘Class::ReturnValue’ );
context:

339: Due => $due->ISO
340: );
341: #Set the ticket’s effective ID now that we’ve created it.
342: use Data::Dumper;
343: die scalar Dumper($id);
344: my ($val, $msg) = $self->__Set(Field => ‘EffectiveId’, Value =>
$id);
345:
346: unless ($val) {
347: $RT::Logger->err("$self ->Create couldn’t set EffectiveId: $msg\n");

code stack: /usr/local/rt2/lib/RT/Ticket.pm:343
/usr/local/rt2/WebRT/html/Ticket/Display.html:87
/usr/local/rt2/WebRT/html/autohandler:58


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.

Changed the line in Create, the webpage comes back with an RT Error.
error_log contains the following:

WebRT: ()RT::Ticket=HASH(0x1228d9400) ->Create couldn’t set EffectiveId:
No value passed to _Set
WebRT: ()

rt.log0 reports the same.

Hm, that looks like the basic insert is totally failing. Can you turn on
postgres query logging and seeing exactly what’s being sent over the
wire to the database?a

‘ERROR: pg_atoi: zero-length string’ doesn’t really clue me in.

I think that means that atoi is trying to convert “” to an integer.
Perhaps a mismatch in the number of placeholders provided vs. the number
expected?

(darren)

Greenspun’s Tenth Rule of Programming:
Any sufficiently complicated C or Fortran program contains an ad
hoc informally-specified bug-ridden slow implementation of half
of Common Lisp.

Hm, that looks like the basic insert is totally failing. Can you turn on
postgres query logging and seeing exactly what’s being sent over the
wire to the database?a

‘ERROR: pg_atoi: zero-length string’ doesn’t really clue me in.

I think that means that atoi is trying to convert “” to an integer.
Perhaps a mismatch in the number of placeholders provided vs. the number
expected?

(darren)

Is this a change from 7.2? Would 7.2 have accepted “” as ‘0’?

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

  • Jesse Vincent jesse@bestpractical.com [2002-12-13 16:19]:> On Fri, Dec 13, 2002 at 03:58:30PM -0500, darren chamberlain wrote:

Hm, that looks like the basic insert is totally failing. Can you turn on
postgres query logging and seeing exactly what’s being sent over the
wire to the database?a

‘ERROR: pg_atoi: zero-length string’ doesn’t really clue me in.

I think that means that atoi is trying to convert “” to an integer.
Perhaps a mismatch in the number of placeholders provided vs. the number
expected?

Is this a change from 7.2? Would 7.2 have accepted “” as ‘0’?

I’m not a postgres user, I was just taking a stab in the dark. Where’s
Vivek when we need him?

(darren)

When I am working on a problem I never think about beauty. I only
think about how to solve the problem. But when I have finished, if the
solution is not beautiful, I know it is wrong.
– R. Buckminster Fuller

“dc” == darren chamberlain darren@boston.com writes:

Is this a change from 7.2? Would 7.2 have accepted “” as ‘0’?

dc> I’m not a postgres user, I was just taking a stab in the dark. Where’s
dc> Vivek when we need him?

Sleeping in my office :wink:

Seriously, I wasn’t following this thread… how do I reproduce the
error?

here’s some logs from trying to create a ticket.

postmaster successfully started
LOG: database system was shut down at 2002-12-13 16:42:43 EST
LOG: checkpoint record is at 0/B3F790
LOG: redo record is at 0/B3F790; undo record is at 0/0; shutdown TRUE
LOG: next transaction id: 11788; next oid: 17654
LOG: database system is ready
LOG: connection received: host=127.0.0.1 port=3798
LOG: connection authorized: user=rt_user database=rt2
LOG: query: begin; select getdatabaseencoding(); commit
LOG: query: SET TIME ZONE 'GMT’
LOG: query: SET DATESTYLE TO 'ISO’
LOG: query: SELECT * FROM Users WHERE lower(Name) = 'rt_system’
LOG: query: SELECT * FROM Users WHERE lower(Name) = 'nobody’
LOG: query: SELECT * FROM Queues WHERE lower(Name) = 'ifs’
LOG: query: SELECT COUNT(ACL.id) FROM ACL, Groups WHERE (((RightScope = ‘Queue’) AND (RightAppliesTo = 1))) AND ((RightName = ‘CreateTicket’)) AND (((Groups.Name = ‘Everyone’) AND
(PrincipalType = ‘Group’) AND
(Groups.Id = PrincipalId)))
LOG: query: SELECT COUNT(ACL.id) FROM ACL, GroupMembers, Groups WHERE ((((((RightScope = ‘Queue’) AND (RightAppliesTo = 1))) AND ((RightName = ‘CreateTicket’))) OR ((RightName = ‘SuperUser’) AND (RightScope = ‘System’) AND (RightAppliesTo = 0))) AND (((ACL.PrincipalType = ‘Group’) AND (ACL.PrincipalId = Groups.Id) AND (GroupMembers.GroupId = Groups.Id) AND (GroupMembers.UserId = 4))))
LOG: query: SELECT COUNT(ACL.id) FROM ACL WHERE (((((RightScope = ‘Queue’) AND (RightAppliesTo = 1))) AND ((RightName = ‘CreateTicket’))) OR ((RightName = ‘SuperUser’) AND (RightScope = ‘System’) AND (RightAppliesTo = 0))) AND (((PrincipalType = ‘User’) AND (PrincipalId = 4)))
LOG: query: SELECT * FROM Users WHERE id = '2’
LOG: query: SELECT * FROM Queues WHERE id = '1’
LOG: query: INSERT INTO Tickets (Starts, Type, Priority, Resolved, Status, Queue, Owner, InitialPriority, FinalPriority, Subject, Creator, LastUpdatedBy, Created, TimeLeft, TimeWorked, LastUpdated, Due) VALUES (‘1970-01-01 00:00:00’, ‘ticket’, ‘0’, NULL, ‘new’, ‘1’, ‘2’, ‘0’, ‘0’, ‘ifs crashes when …’, ‘4’, ‘4’, ‘2002-12-13 21:43:30’, ‘’, ‘’, ‘2002-12-13 21:43:30’, ‘1970-01-01 00:00:00’)
ERROR: pg_atoi: zero-length string
LOG: statement: INSERT INTO Tickets (Starts, Type, Priority, Resolved, Status, Queue, Owner, InitialPriority, FinalPriority, Subject, Creator, LastUpdatedBy, Created, TimeLeft, TimeWorked, LastUpdated, Due) VALUES (‘1970-01-01 00:00:00’, ‘ticket’, ‘0’, NULL, ‘new’, ‘1’, ‘2’, ‘0’, ‘0’, ‘ifs crashes when …’, ‘4’, ‘4’, ‘2002-12-13 21:43:30’, ‘’, ‘’, ‘2002-12-13 21:43:30’, ‘1970-01-01 00:00:00’)
LOG: query: SELECT * FROM Users WHERE lower(EmailAddress) = 'jjasen@datafoundation.com’
LOG: query: SELECT * FROM Watchers WHERE Email is null AND Owner = ‘4’ AND lower(Scope) = ‘ticket’ AND lower(Type) = ‘requestor’ AND Value is null
LOG: query: UPDATE Tickets SET LastUpdated=‘2002-12-13 21:43:30’ WHERE id=NULL
LOG: query: UPDATE Tickets SET LastUpdatedBy=‘4’ WHERE id=NULL
LOG: query: UPDATE Tickets SET TimeWorked=0 WHERE id=NULL
LOG: query: SELECT DISTINCT main.* FROM Queues main WHERE ((main.Disabled = ‘0’)) ORDER BY main.Name ASC
LOG: connection received: host=127.0.0.1 port=3799
LOG: connection authorized: user=rt_user database=rt2
LOG: query: begin; select getdatabaseencoding(); commit
LOG: query: SET TIME ZONE 'GMT’
LOG: query: SET DATESTYLE TO 'ISO’
LOG: connection received: host=127.0.0.1 port=3800
LOG: connection authorized: user=rt_user database=rt2
LOG: query: begin; select getdatabaseencoding(); commit
LOG: query: SET TIME ZONE 'GMT’
LOG: query: SET DATESTYLE TO 'ISO’
LOG: connection received: host=127.0.0.1 port=3801
LOG: connection authorized: user=rt_user database=rt2
LOG: query: begin; select getdatabaseencoding(); commit
LOG: query: SET TIME ZONE 'GMT’
LOG: query: SET DATESTYLE TO 'ISO’
LOG: query: SELECT * FROM Users WHERE lower(Name) = 'rt_system’
LOG: query: SELECT * FROM Users WHERE lower(Name) = ‘nobody’

John Jasen wrote:

LOG: query: INSERT INTO Tickets (Starts, Type, Priority, Resolved, Status, Queue, Owner, InitialPriority, FinalPriority, Subject, Creator, LastUpdatedBy, Created, TimeLeft, TimeWorked, LastUpdated, Due) VALUES (‘1970-01-01 00:00:00’, ‘ticket’, ‘0’, NULL, ‘new’, ‘1’, ‘2’, ‘0’, ‘0’, ‘ifs crashes when …’, ‘4’, ‘4’, ‘2002-12-13 21:43:30’, ‘’, ‘’, ‘2002-12-13 21:43:30’, ‘1970-01-01 00:00:00’)
ERROR: pg_atoi: zero-length string

I’m not a postgres user, so this is untested, but see if it helps.

Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

ticket-create-patch (1018 Bytes)

So, this is the same problem we’ve been discussing elsewhere on
rt-users. Postgres 7.3 changed some underlying magic. I posted a change
to Ticket->Create that I’d like people to try. If that works, it’ll be
in 2.0.16On Tue, Dec 17, 2002 at 10:16:17AM +1000, Phil Homewood wrote:

John Jasen wrote:

LOG: query: INSERT INTO Tickets (Starts, Type, Priority, Resolved, Status, Queue, Owner, InitialPriority, FinalPriority, Subject, Creator, LastUpdatedBy, Created, TimeLeft, TimeWorked, LastUpdated, Due) VALUES (‘1970-01-01 00:00:00’, ‘ticket’, ‘0’, NULL, ‘new’, ‘1’, ‘2’, ‘0’, ‘0’, ‘ifs crashes when …’, ‘4’, ‘4’, ‘2002-12-13 21:43:30’, ‘’, ‘’, ‘2002-12-13 21:43:30’, ‘1970-01-01 00:00:00’)
ERROR: pg_atoi: zero-length string

I’m not a postgres user, so this is untested, but see if it helps.


Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

Index: webrt/Ticket/Create.html

RCS file: /cvs/local/rt/webrt/Ticket/Create.html,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 Create.html
— webrt/Ticket/Create.html 23 Jan 2002 00:47:58 -0000 1.1.1.3
+++ webrt/Ticket/Create.html 17 Dec 2002 00:13:51 -0000
@@ -104,8 +104,8 @@

- - + +
Priority:
Final Priority:
Time Worked:
Time Left:
Time Worked:
Time Left:
<& /Elements/TitleBoxEnd &>

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