Indestructible document can not be deleted

There is one document in a database that can not be deleted. I delete it and the cross appears next to it in the view, press the f9 key and the cross next to the document disappears but the document doesn’t.

This is the only document in the database that this happens to. I have manager access with delete rights, am a member of all roles and there is not any code anywhere that is stopping the deletion.

I have tried deleting it with the following code and still no luck. I always get a true message indicating that it has been deleted ok and what is weird is that this line can sometimes find the document and sometimes can’t but can always find it with the hard coded id.

Set dc = db.Search({Form = “frmDataOwner” & Database = “Master Index Non Anonymised”}, Nothing, 0)

Sub Click(Source As Button)

Dim session As New notessession

Dim db As notesdatabase

Dim dc As notesdocumentcollection

Dim doc As notesdocument

Dim success As Boolean



Set db = session.CurrentDatabase

'There is only one document with these details but sometimes dc.Count is 0 and at other times 1

Set dc = db.Search({Form = "frmDataOwner" & Database = "Master Index Non Anonymised"}, Nothing, 0)

If dc.Count = 0 Then

	Msgbox "Not found"

End If

'id taken from document properties. finds this every time

Set doc =db.GetDocumentByUNID("6F39E7889C30E5898025727A003F1318")

success = doc.RemovePermanently(False)

'always get true

Msgbox success

Set doc = db.GetDocumentByUNID(“6F39E7889C30E5898025727A003F1318”)

'always get Deleted = False

Msgbox "Deleted = " & doc.IsDeleted

End Sub

I’m not too bothered by this as it is a test document in a template but am interested to know if anyone else has come across this and how they resolved it.

Subject: Maybe a long shot

Matt,

could it be possible that this dB is replicated, however deletes from this dB are not sent to other dB’s. So everytime you delete the document, another replica sends it back?

I may also try to make a local copy, and delete it, and see if it ever comes back.

John

Subject: RE: Maybe a long shot

Thanks for the reply John

The database is not replicated - just to make sure I checked the replication history and it is blank. It is a template and I have disabled the inheritance to the production database whilst I am working on release 2.

I have just made a local copy of the database design and documents and the rogue document is not there. It is an orphaned response document and it appears to be in some sort of limbo. I have just tried to edit and save the document and get the message that another copy of this document was saved whilst I was editing it. As I am the only person using the database and there is no script in the form that saves either the front or back end document this can’t be true.

Subject: RE: Maybe a long shot

Mat,

Well you got me. The only other thing I might try is to set a collection = dB.alldocuments and then try a dc.removeAll( true), although what you wrote in your first post would seem that the document would go away.

As wost case senerio, if you local does not have the document, then delete the server copy of the template, and then move over the local one.

John

Subject: gets weirder by the minute

The reason that the document can’t be deleted is that something is continually updating it.

As fast as I can right click it to see the document properties the modified time of the document is changing.

07/03/2007 16:00:30

07/03/2007 16:00:33

07/03/2007 16:00:37

07/03/2007 16:00:41

I’ve no idea what could be doing this as all the scheduled agents have been disabled and I have just checked all the agent logs and none of them has run today. Even if they were enabled the minimum time schedule is 5 minutes. This has not just happened today as I remember trying to delete it last week with the same result.

I have limited admin knowledge but even if there was some sort of infinite loop code being run on the server then I believe there is a maximum length of time it can run before being stopped.

I will try the log file to see if I can see anything there.

UPDATE Nothing in the log file and the maximum agent execution time is set to 10 minutes. Guess its a case of overwriting the server version with the local copy I made earlier and keeping everything crossed that it gets rid of it.

Subject: RE: gets weirder by the minute

Matt,

Once again a long shot, nothing is stopping from somebody having a local agent run that is maybe in an infinite loop updating that document.

I haven’t doen admin in a long time, but can you see on the console who has the dB opened?

John

Subject: RE: gets weirder by the minute

Thanks for the responses everyone.

The only people with access to this template are the administrators and I. I have checked the database usage in the notes log and I am the only person to access it since the start of the logs - about 10 days.

None of our users have rights to create personal agents in the production version of the database and nor can they run any agents on the server.

I am shown as the person modifying the documents which would make sense if there was an agent running somewhere as they are signed by me but I can’t find any evidence of agent activity in the notes log, the database activity log or the agent logs.

All the documents are test documents so what I will do is make a copy of the design, delete the current database and create a new one.

Subject: $UpdatedBy???

Who is updating it?

Subject: RE: gets weirder by the minute

Shut the Domino server down and open the db using the Notes client on the server. You should then be able to have exclusive access to the doc and will then be able to delete it.

Subject: indestructible document can not be deleted

Maybe this is too simple a solution, but we get these “indestructible” docs in our mailfiles on a fairly regular basis, and in those cases, it appears to be a view corruption error. We run “fixup-compact-updall” on the database from the server console, and the troublemaker goes away.

One of the clues to this solution is if you try to delete the document and it tells you it’s already been deleted.

Subject: RE: indestructible document can not be deleted

Even better,

– shut down the Domino server.

–On the Domino box, (where the database lives), open a DOS prompt and CD to the Notes Porgram folder.

– Type compact -c -i <path/database>

(you may want to run fixup, updall and compact from the DOS prompt as well, it depends on you.

Close DOS and start the server

Please post results

Subject: RE: indestructible document can not be deleted

sorry…

use …

ncompact (or whatever the name of the exe file is)

Subject: RE: indestructible document can not be deleted

The answer for future reference is that there was a powerdown at the weekend after which the document could be deleted without any problems.