Gossamer Forum
Home : Products : Gossamer Links : Discussions :

fatal error -- "Wrong argument passed to this subroutine"

Quote Reply
fatal error -- "Wrong argument passed to this subroutine"
This is a bug we have been living with for several months. The latest release did not fix it. Forum searches show that others have had similar problems, but there is no indication that any of them got fixed.

When attempting to delete a link through the Admin > Database menu, the Category Browser, or View Link Status, we always get an error like this:
Code:
A fatal error has occured:
GT::SQL::Table (41604): Wrong argument passed to this subroutine.
Usage: Could not create a condition object out of arguments.
at /PATH_TO/admin/GT/SQL/Table.pm line 642.

This is what is at Table.pm, line 642:
Code:
if (! $where->sql) {
return $self->error ('BADARGS', 'FATAL',
"Could not create a condition object out of arguments.");
}

So the problem could be the value of $where -- in this case the value of $where is something like GT::SQL::Condition=HASH(0x84f3a64)

We can't go on much longer being unable to delete through the admin interface, but we have no idea what to do about it.

We don't get this problem with our test database at home. There are not many differences ... test database runs under Windows 98, the live database (not yet public) runs under FreeBSD.

GT people: Help please, Any fixes for this? What can we do about it?
It's getting urgent ...
Quote Reply
Re: [YoYoYoYo] fatal error -- "Wrong argument passed to this subroutine" In reply to
Here is some more info about this apparently intractable problem ...

If we attempt to delete a link through Admin > Database, it is removed from all categories, but not from the database.

If we attempt to delete a link through Category Browser, it is removed from the current category, but remains in any other category in which it has been placed.

So it is clear that the error message is not caused by deletion from the CatLinks table, but from the Links table.

Her is the top of the stack trace after trying to delete a bad link:
Code:
Links (54885): Links::environment called at <PATH_TO>admin/Links.pm line 430 with no arguments.

Links (54885): Links::fatal called at GT::Base::error line 360 with arguments
(GT::SQL::Table (54885): Wrong argument passed to this subroutine.
Usage: Could not create a condition object out of arguments.
at <PATH_TO>admin/GT/SQL/Table.pm line 642.).

Links (54885): GT::Base::error called at <PATH_TO>admin/GT/SQL/Table.pm line 642 with arguments
(GT::SQL::Table=HASH(0x84fac84), BADARGS, FATAL,
Could not create a condition object out of arguments.).

Links (54885): GT::SQL::Table::delete called at GT::SQL::Table::_do_opt line 2164 with arguments
(GT::SQL::Table=HASH(0x84fac84), GT::SQL::Table=HASH(0x84fac84), HASH(0x84fa12c)).

Links (54885): GT::SQL::Table::_do_opt called at GT::SQL::Table::_delete_cond line 2192 with arguments
(Links::Link=HASH(0x83a9860), cascade, HASH(0x84fa12c), lsql_Bad_Link).
Quote Reply
Re: [YoYoYoYo] fatal error -- "Wrong argument passed to this subroutine" In reply to
Mind emailing me the login information to your admin panel and if possible ssh as well? It's a strange error and I can't figure out what's going wrong. (read: the stack trace is reporting something that shouldn't be happening)

You can reach me at aki@gossamer-threads.com
Quote Reply
Re: [Aki] fatal error -- "Wrong argument passed to this subroutine" In reply to
Fixed this -- not solved, as I still have no idea what caused it, and I suppose it might happen again.

But for anyone else who runs into the same problem, this is how I got out of the immediate difficulty :

1. Use MySQLMan to dump structure and data of the core LSQL tables.
2. Delete all the existing tables.
3. Use SQL Monitor to re-create the tables.

Now everything is OK again, but it's mystery to me. The new database is, as far as I can can see, identical to the old database.