Domino/Notes Version: 14.5FP1
Add-on Product (if appropriate, e.g. Verse / Traveler / Nomad / Domino REST API):
Its Version:
Operating System: AlmaLinux 9
Client (Notes, Nomad Web, Nomad Mobile, Android/iOS, browser version):
Problem/Query:
Hi,
I have a script that has run daily for at least one year.
A MailIn database receives every day mails with an attached file which the agent detaches in a certain directory.
It runs scheduled in background.
Since I have upgraded the server (os is almalinux 9.5) from 14.0 to 14.5FP1 the script gives an error âError 13 Type Mismatchâ when tries to access the field âBodyâ
Dim item As NotesRichTextItem
[...]
Set item = doc.GetFirstItem("Body") <- ERROR 13 TYPE MISMATCH (while it is a rich text item)
ForAll o In item.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
Call o.ExtractFile ( "<path>" & o.Source )
End If
End ForAll
If I remove the declaration for âitemâ variable the error changes:
[...]
Set item = doc.GetFirstItem("Body")
ForAll o In item.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then <- ERROR 182 Instance member EMBEDDEDOBJECT does not exist (while exists)
Call o.ExtractFile ( "<path>" & o.Source )
End If
End ForAll
All the documents have the files attached in the body item and is possible detach them with a Notes client.
If I run the script on a document received and detached with 14.0 server the script runs so i fear that the upgrade changed something in the incoming mail attached files
The script runs with no errors in GUI in debug mode with a 14.5FP1 administrator client
any suggestion will be appreciated
tommaso
Try to get the field as a NotesItem first.
Check the Item.type if itâs one get it as Richtext and to the embedded check otherwise handle it as text.
Perhaps the Body fields is returned as a text field sometimes due to some bug or that the client sending the email doing something.
1 Like
Hi Fredrik,
running the agent in debug mode with a notes client item.type is 1 (RichText) while Prompting the item.type in the scheduled agent it results 25 (MIME_PART) in the same document, strange.
That item.type is not expected to have an embedded object thatâs why we get the error 182.
We cannot reach the embedded object neither detach it
Perhaps you could try
session.setConvertMIME(false);
or session.setConvertMIME(true);
and see if that changes things.
Unfortunately it doesnât work.
Neither with s.Convertmime = False nor with s.Convertmime = True.
I tried in a server same version (14.5FP1) in a different Domino Domain and the script works in background
while, the same script on the same server, same document, but with two different clients
in debug with a designer 14.5 item.type = 25 it doesnât work
in debug wiith a designer 14.5FP1 item.type = 1 it works
donât understand âŚ
t
Do you think it can have something to do with language settings?
The Domino mail server has in Italian SLP that has often had problems while upgrading
the server creates a dir /opt/hcl/domino/notes/latest/linux/res/C aside the dir /opt/hcl/domino/notes/latest/linux/res/it_IT.UTF-8
this cause the error âRouter: Error transferring message 005805D2 via SMTP to 192.168.0.253 Cannot convert Notes Rich Text message to MIME message.â thai I fix renaming (or removing) the âCâ directory.
thanks
t
This seams like a bug, create a support case.
I do not know if the linux version could be an issue here, perhaps reach out some people on the openntf chat on discord that know more about linux if you canât create a ticket with HCL
I have been using the construction with
Dim item As Variant
Look at example number 4 at:
I found the solution
I re-wrote the agent in java and the error message console is clearer:
AMgr: Agent (âDetachJâ in âtest/scripterror.nsfâ) printing: Trovati 1 document
AMgr: Agent (âDetachJâ in âtest/scripterror.nsfâ) printing: Soggetto: [External] [BULK] Campbell data from CR1000x serial 24342 at Ittiri 2 h93 0.0
00000966: CVS: Not initialized
MIME to CD error (Process: Agent Manager (00000E59:00000009), Database: /local/notesdata/data/test/scripterror.nsf, Note: 00000966): CVS: Not initialized
End MIME to CD Conversion (Process: Agent Manager (00000E59:00000009), Database: /local/notesdata/data/test/scripterror.nsf, Note: 00000966)
AMgr: Agent (âDetachJâ in âtest/scripterror.nsfâ) printing: Item type 25
AMgr: Agent (âDetachJâ in âtest/scripterror.nsfâ) error message: java.lang.ClassCastException: lotus.domino.local.Item incompatible with lotus.domino.RichTextItem
AMgr: Agent (âDetachJâ in âtest/scripterror.nsfâ) error message: at JavaAgent.NotesMain(Unknown Source)
AMgr: Agent (âDetachJâ in âtest/scripterror.nsfâ) error message: at lotus.domino.AgentBase.runNotes(Unknown Source)
AMgr: Agent (âDetachJâ in âtest/scripterror.nsfâ) error message: at lotus.domino.NotesThread.run(Unknown Source)
I then checked and also in the server the agent runs on has the directory
/opt/hcl/domino/notes/latest/linux/res/C
aside of
/opt/hcl/domino/notes/latest/linux/res/it_IT.UTF-8
I renamed the C dir and restart the server and the script restarted running
I still wonder why that /opt/hcl/domino/notes/latest/linux/res/C dir comes from but the problem is solved.
Thanks a lot to everybody
tommaso