Document has been deleted

Hi,

An auto archive agent which is scheduled to run daily on all the documents (which are present in one view). This agent ran on many documents and got failed by giving the error “Document has been deleted”.

(1)Initially it checks for the upper bound value of one field value and proceeds based on this value.

(2)If the upper bound value is 0 then it checks for another condition (If (doc1.name(0) = doc2.name(0) And doc1.sec(0) = doc2.sec(0) then) here the values of name and sec fields exists for both the docs.

(3)If both (1) and (2) conditions are true then checks for the docuemnt created date and today’s date differnce equal to 15 and then sets the flag to 1.

(4)If (2) fails then checks for the docuement created date and today’s date differnce equal to 550 and then sets the flag to 1.

(5) if the upper bound value is not zero thenchecks for the docuement created date and today’s date differnce equal to 550 and then sets the flag to 1.

The agent fails at this line (If (doc1.name(0) = doc2.name(0) And doc1.sec(0) = doc2.sec(0) then) by giving the error “document has been delete”.

I have tried all the possibilites specified below:

1)Did all the views refresh indexing.

2)compact database.

3)Deleted the replication history and replicated the db.

4)There is no possibility of document deletion.

5)There are no replication conflicts (replication conflict docs also not there)

6)The documents last modified person still exists in our acl list

Can anyone please suggest the possible cause and resolution for this issue?

Thanks in advance for the reply

Subject: Document has been deleted

how are you getting doc1 and doc2? getdocumentbyunid returns deletion stubs so be aware of that. are you looping through the documents in a view or documentcollection? ensure that if you are using “getnextdocument(doc)”, then doc has not been deleted during the loop

Subject: RE: Document has been deleted

Hi Gwyn,

Thank you for your response.

I am looping through the documents in a view…no where i have used code for deletion in between. This agent has been used from 10years only from few days i am facing this error.

There is no possibility for other deletion also.

sirisha

Subject: RE: Document has been deleted

run compact -c -i on it.

Subject: RE: Document has been deleted

Hi,

Thanks for your reply.

The problem got solved when I performed view rebuild.