As the portal evolved from Plumtree to ALUI (AquaLogic User Interaction) to WCI (WebCenter Interaction), there’s been a legacy feature that was born with good intentions, but like many things in human physical anatomy, it has survived evolution with little to no value.
This feature is object “owners” for Content Crawlers and Automation Jobs. I’m sure there was a grand intent at some point for “owners” to mean something, but I haven’t found it yet.
The “owner” is the portal user that is scheduled to run a job. But if that user is later deleted, the portal doesn’t clean up after itself – and all jobs that the user created are “orphaned” and won’t run, showing an error in PTSpy like:
Sep 12, 2010 10:07:02 PM- *** Job Operation #1 of 1 with ClassID 38 and ObjectID 202 cannot be run, probably because the operation has been deleted.
The fix – which I will condone until I can figure out why jobs need “owners” in the first place – is to just make the owner of all jobs and crawlers the Administrator user. The Administrator user can’t be deleted, and since I haven’t found any problems with running a crawler as this user, you can just do a portal-wide update making this change with the following SQL:
UPDATE PTCRAWLERS SET OWNERID=1 UPDATE PTJOBS SET OWNERID=1
Helpful SQL to determine if you’re being bitten by this “vestigal organ” after the break.
To get a count of crawlers with invalid owners (look for “null” owners):
SELECT ptu.NAME, ptc.OWNERID AS Expr1, ptc.Count FROM PTUSERS ptu RIGHT OUTER JOIN (SELECT DISTINCT OWNERID AS Ownerid, COUNT(OWNERID) AS Count FROM PTCRAWLERS GROUP BY OWNERID) AS ptc ON PTUSERS.OBJECTID = ptc.OWNERID
To get a list of broken crawlers (invalid owners):
select NAME, DESCRIPTION, CREATED, LASTMODIFIED FROM PTCRAWLERS WHERE OWNERID NOT IN (select objectid from ptusers)
To get a count of JOBS with invalid owners (look for “null” owners):
SELECT ptu.NAME, ptj.OWNERID AS Expr1, ptj.Count FROM PTUSERS ptu RIGHT OUTER JOIN (SELECT DISTINCT OWNERID AS Ownerid, COUNT(OWNERID) AS Count FROM PTJOBS GROUP BY OWNERID) AS ptj ON PTUSERS.OBJECTID = ptj.OWNERID
To get a list of broken JOBS (invalid owners):
select NAME, DESCRIPTION, CREATED, LASTMODIFIED FROM PTJOBS WHERE OWNERID NOT IN (select objectid from ptusers)
Tags: Automation, Crawlers, database, jobs, owners