Gossamer Forum
Home : Products : Gossamer Links : Discussions :

[fatal error] Updating Changed Flags

Quote Reply
[fatal error] Updating Changed Flags
GT Staff -- help please, this has just started happening today ...

Running nph-build.cgi --changed, from both shell and browser, we get this fatal error ...
Code:
Updating Changed Flags ...
A fatal error has occured:GT::SQL::Table (48591): Wrong argument passed to this subroutine.
Usage: Must pass category id to parents at <PATH_TO>/admin/Links/Category.pm line 334.

Stack Trace
======================================
Links (48695): Links::environment called at <PATH_TO>/admin/Links.pm line 430 with no arguments.
Links (48695): Links::fatal called at GT::Base::error line 360 with arguments
(GT::SQL::Table (48695): Wrong argument passed to this subroutine.
Usage: Must pass category id to parents at <PATH_TO>/admin/Links/Category.pm line 334.
).
Links (48695): GT::Base::error called at <PATH_TO>/admin/Links/Category.pm line 334 with arguments
(Links::Category=HASH(0x864a6dc), BADARGS, FATAL, Must pass category id to parents).
Links (48695): Links::Category::parents called at Links::Build::build_changed_flags line 50 with arguments
(Links::Category=HASH(0x864a6dc), 0).
Links (48695): Links::Build::build_changed_flags called at <PATH_TO>/admin/GT/Plugins.pm line 108 with arguments
(HASH(0x82d7670)).
Links (48695): GT::Plugins::dispatch called at <PATH_TO>/admin/Links/Build.pm line 30 with arguments
(GT::Plugins, <PATH_TO>/admin/Plugins, build_changed_flags, *Links::Build::build_changed_flags, HASH(0x82d7670)).
Links (48695): Links::Build::build called at <PATH_TO>/admin/nph-build.cgi line 756 with arguments
(changed_flags, HASH(0x82d7670)).
Links (48695): main::_build_changed_flags called at <PATH_TO>/admin/nph-build.cgi line 129 with no arguments.
Links (48695): main::build_changed called at <PATH_TO>/admin/nph-build.cgi line 41 with no arguments.
Links (48695): main::main called at <PATH_TO>/admin/nph-build.cgi line 32 with no arguments.

Line 334 is in sub parents ...
Code:
my $id = shift or return $self->error ('BADARGS', 'FATAL', "Must pass category id to parents");

All the categories have a valid FatherID.

We are going to comment out _build_changed_flags() as a temporary avoidance measure, but there is obviously something wrong and we can't find it.
Quote Reply
Re: [YoYoYoYo] [fatal error] Updating Changed Flags In reply to
Hi,

What version are you using? That could only happen in 2.1.1 if you somehow got a CategoryID of 0 in your CatLinks table, something that should normally never happen.

Can you do a:

SELECT * FROM CatLinks where CategoryID < 1;

and see what it returns?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] [fatal error] Updating Changed Flags In reply to
In Reply To:
What version are you using?

2.1.1


In Reply To:
That could only happen in 2.1.1 if you somehow got a CategoryID of 0 in your CatLinks table, something that should normally never happen.

Can you do a:

SELECT * FROM CatLinks where CategoryID < 1;

and see what it returns?

OK, we found one link with CategoryID = 0
Like nearly all our links, it has multiple CatLinks. Somehow CategoryID 140 got changed to CategoryID 0 (the other CatLinks are unchanged). The link has been edited recently, but as you point out, a normal operation could not have done that -- and if it had, we would have noticed immediately (we always build changed after editing sessions).

Could it have happened if a normal operation were interrupted by the server? For example, we have various nph-build.cgi tasks in a cron table (--changed every 24 hours, --repair and --all weekly). Could the CatLinks table be corrupted if the process were killed before completion?
Quote Reply
Re: [YoYoYoYo] [fatal error] Updating Changed Flags In reply to
Hmm, did everything work once you manually changed it back?

I can't see a scenerio where a CategoryID would get inserted as 0. Running a build at the same time as making changes manually should cause no problems.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] [fatal error] Updating Changed Flags In reply to
In Reply To:
Hmm, did everything work once you manually changed it back?

Yes, there was nothing else wrong.