Why? Script Restarts/Creates Duplicates

This is strange… to me at least. This script has been running for many months w/o issues. Is it sabotage? …ghost on the server? …who knows! It is now creating duplicates and appears to be restarting or in bad loop. I see it cycle through names01.nsf, names03.nsf… in the beginning but see it start at names01.nsf, etc… again. This is a beast of a script (I did not write) and too large to post here. I posted on a website @ http://servaps.com/servaps/badscript.pdf

Any ideas? I created a script that remove duplicates… but this is a “band-aid” fix. Had thought about creating agent that deletes all docs in each Db just before the agent run. That would work (still a band-aid) assuming the script doesn’t loop like above. My eyes are sore… help team. Thanks…

Subject: Why? Script Restarts/Creates Duplicates

Hi,

It’s a big ask for you to expect someone on the forum to debug an agent of this size.

In general, the code does not appear to be well done as there are loops and if/end if’s spanning over several pages and the programmer didn’t seem to be aware that code can be broken down into Subroutines and Functions. Furthermore there are few comments to provide a clue as to what the code is trying to do. I would suggest that you look at getting the code rewritten/updated in the near future so that it is easier to maintain.

If the code of the agent has not changed then check for something else to have changed. Has the scheduling of the agent changed so that it runs more than once a day ? Has the ACL of any of the databases changed. Perhaps the signer of the agent no longer has delete access in the database ACL ?

Ethann Castell

Caliton Innovations

web: http://www.caliton.com | blog: http://www.ethann.com

Subject: RE: Why? Script Restarts/Creates Duplicates

Thanks for your response. I agree that the script is a bit large… was just hoping that someone saw a missing “xyz” that maybe I missed.

Update: I thought it might be the ACL at first. Still producing duplicates. That being said… it appears to be on some Dbs and not others. All Dbs are inheriting design from common template now vs. before (that was a pain).

Update #2: let me refine “duplicates”… it seems to be adding the same document vs. removing the old and/or updating as required. Makes me wonder about the “ValidSqlRec” part of the script. It is adding OK… just not removing/updating existing docs. The 2 (or more) docs are the same but have different time/docID. The times correspond to the current and past agent runs.

Subject: Wild guess

Just a wild guess but since you mention that it works in some db’s and not others, I wonder if the problem could be caused by view indices not being updated i.e. the code does not find an original document to remove because the view indices hasn’t been updated.

Ethann Castell

Caliton Innovations

web: http://www.caliton.com | blog: http://www.ethann.com