Weird error message: "Notes error: Network protocol error: message from server is too small"

Hi,
When executing a LotusScript agent I get the following error message :
Notes error: Network protocol error: message from server is too small

The line where the error occurs is the following :
Set vwEntryCollection = vw.AllEntries

Here's the complete script of the agent :
Sub Initialize
      REM ==================================================================================
      REM DEFINE ERROR ROUTINE
      REM ==================================================================================
      On Error Goto ErrorHandler
      
      REM ==================================================================================
      REM DECLARATIONS
      REM ==================================================================================
      REM *** Notes objects ***
      Dim session As New NotesSession
      Dim ws As New NotesUIWorkspace
      Dim docDialog As NotesDocument
      Dim uidoc As NotesUIDocument
      Dim dc As NotesDocumentCollection
      Dim vw As NotesView
      Dim vwEntryCollection As NotesViewEntryCollection
      
      REM *** Word objects ***
      Dim objWordDoc As Variant
      
      REM *** rtlib objects ***
      Dim rtlibParagraph As rtextParagraph
      
      REM *** Script processing variables ***
      Dim strStyle As String
      Dim lngTables As Long
      Dim intRows As Long, intColumns As Long
      Dim i As Integer, j As Integer
      Dim rc As Integer
      Dim strPathWordDoc As String
      Const FILEMASK$ = "Word Documents|*.doc"
      
      REM ==================================================================================
      REM INITIALIZE
      REM ==================================================================================
      Set cfg = New ConfigurationProfile
      Call Logging("Started")
      Set db = session.CurrentDatabase
      Set objWordDoc = Nothing
      Call InitStyles
      
      REM ==================================================================================
      REM Get Document to import and category
      REM ==================================================================================
      Set docDialog = db.CreateDocument
      docDialog.Form = "dlgSelectCategory"
      rc = ws.DialogBox("dlgSelectWordDoc", True, True, False, False, False, False, "Selecteer te importeren bestand", docDialog, True, False)
      If Not rc Or docDialog.importFile(0) = "" Then
            Exit Sub
      End If
      strPathWordDoc = docDialog.importFile(0)
      
      REM ==================================================================================
      REM OPEN WORD DOCUMENT
      REM ==================================================================================
      Set objWord = CreateObject("word.application")
      objWord.Application.Visible = False ' True 'activeer deze lijn bij problemen in word macro
      'disable AutoMacros
      objWord.Application.WordBasic.DisableAutoMacros 1
      Set objWordDoc = objWord.Documents.Open(strPathWordDoc)
      
      REM ===================================================================================
      REM REMOVE TABLE OF CONTENTS FROM THE DOCUMENT
      REM ===================================================================================
      Forall toc In objWord.ActiveDocument.TablesOfContents
            toc.Delete
      End Forall
      
      REM ==================================================================================
      REM CLEANUP PREVIOUS IMPORT
      REM ==================================================================================
      Set vw = db.GetView("vwPrep")
      Set vwEntryCollection = vw.AllEntries
      If vwEntryCollection.Count > 0 Then Call vwEntryCollection.RemoveAll(True)
      
      REM ==================================================================================
      REM IMPORT DOCUMENT
      REM ==================================================================================
      rc = ImportDocument(objWordDoc)
      If rc = False Then
            Messagebox "Er was een probleem tijdens het importeren van '" & strPathWordDoc & "'"
            Goto CleanupObjects
      End If
      
      REM ==================================================================================
      REM SHOW RESULT IN DIALOG BOX
      REM ==================================================================================
      Set docDialog = db.CreateDocument
      rc = ws.DialogBox("dlgShowPrep", True, True, False, False, False, False, "Resultaat", docDialog, True, False)
      
      REM ==================================================================================
      REM CLEANUP
      REM ==================================================================================
CleanupObjects:
      If Not objWordDoc Is Nothing Then
            Call objWordDoc.Close(wdDoNotSaveChanges)
            Set objWordDoc = Nothing
      End If
      If Not objWord Is Nothing Then
            'enable AutoMacros
            objWord.Application.WordBasic.DisableAutoMacros 0
            Call objWord.Application.Quit (True)
            Set objWord = Nothing
      End If
      Call Logging("Ended")
      Call cfg.close
      Exit Sub
      
      REM ==================================================================================
      REM ERROR HANDLER
      REM ==================================================================================
ErrorHandler:
      Call Logging("Error: " & Error$ & " in line " & Erl)
      Messagebox "Error: " & Error$ & " in line " & Erl & " - Error number: " & Err
      If Erl < 95 Then
            Resume CleanupObjects
      Else
            Call Logging("Ended with error")
            Exit Sub
      End If
End Sub

When I try to execute the agent there's no problem. I then ask a user with the problem to try. He/she gets the error.
I then try again and get the same error.

Does any of you have an idea what could be causing this problem ?
I'm developing in R5, using designer version 5.0.10
End users where the error first appeared are using version 5.0.5 clients.

I'd be grateful for any insight you guys/girls can give me.
LVL 8
Jean Marie GeeraertsApplication EngineerAsked:
Who is Participating?
 
HemanthaKumarConnect With a Mentor Commented:
I would suggest you mark them for deletion rather than deleting on fly..and move it out of the views by using this flag.

Advantages
1. It is safe and no need to give user delete access
2. Quicker
3. Rollback or retreive docs is easier before a nightly agent or weekly agent comes and clears up the trash
0
 
qwaleteeCommented:
I've only seen a couple of references to this, relating to networks with multiple segments, where there may be different packet sizes allowed betwen them.  This can cause packet fragmentation, and eventually, invalid content, and is especially problematic when you have multiple topologies between you and the server (e.g., Ethernet+Token Ring, IP+ATM, etc.).  I'm not very knowledgable.
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Might be a reason. We do have a mixed network environment here with everything you can imagine: ethernet, token ring, atm, ...
Don't know about the packet sizes (no longer occupied with the physical network).
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
HemanthaKumarCommented:
I have seen in one instance where the view contains some replication/save conflicts..

As alternate don't use viewentrycollection.. use the good old native method of looping thru the view...

~Hemanth
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Problem with looping through the view is that a document can be open in preview pane and it will return error message 'Unable to delete document while open in UI' (or something like that).

The original line of code was :
Call vw.AllEntries.RemoveAll(True)

This returned an error 'Entry not found in index', so I coded around to first check for existing entries and then removing the whole collection.
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
This sounds interesting. Will have to look into that.
Thanks, will get back to you as soon as I've managed to try and test a few things.
0
 
Jean Marie GeeraertsApplication EngineerAuthor Commented:
Stupid question: is there a script equivalent to the @command([MoveToTrash]) method to mark the document for deletion? And how do I actually remove the documents marked for deletion from the view so they won't be used in another script walking through the view?
0
 
qwaleteeConnect With a Mentor Commented:
Depending on if you have soft deletions on or not, and what version of that, you can just 'puInFolder("($Trash)") -- or.putAllInFolder for a collection
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.