HTML5 password reset - Object reference not set to an instance of an object

I’m trying to reset password from the login screen, but the WF ends with Object reference not set to an instance of an object error message - see attached WF debug server log. I think the parameters in appsettings.json are set correctly - attached. Email is generated into the MAIL_OUT WQ and the error is generated after WQ Send command. Server name and port are saved in Model constant correctly. I can send email directly from the Origam server to the Email server via telnet without issue. Any suggestion appreciated!
Thank you.

2021-06-07 20:02:03,465 [17] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-07 20:02:03,465 [17] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Starting workflow: SendEmailFromQueue
2021-06-07 20:02:03,465 [17] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Transaction ID: 
2021-06-07 20:02:03,465 [17] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-07 20:02:03,465 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: WQ_Mail
2021-06-07 20:02:03,465 [17] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-07 20:02:03,465 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'WQ_Mail'
2021-06-07 20:02:03,466 [17] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'WQ_Mail'
2021-06-07 20:02:03,466 [17] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-07 20:02:03,466 [17] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: Send
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Starting workflow: SendEmail
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Transaction ID: 
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientEmail
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-07 20:02:03,467 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'recipientEmail'
2021-06-07 20:02:03,467 [17] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'recipientEmail'
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentEntityId
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentRecordId
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-07 20:02:03,467 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'attachmentRecordId'
2021-06-07 20:02:03,467 [17] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'attachmentRecordId'
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: subject
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-07 20:02:03,467 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'subject'
2021-06-07 20:02:03,467 [17] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'subject'
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: body
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-07 20:02:03,467 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'body'
2021-06-07 20:02:03,467 [17] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'body'
2021-06-07 20:02:03,467 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: Attachment_structure
2021-06-07 20:02:03,469 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: senderName
2021-06-07 20:02:03,469 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: senderEmail
2021-06-07 20:02:03,469 [17] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-07 20:02:03,469 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'senderEmail'
2021-06-07 20:02:03,469 [17] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'senderEmail'
2021-06-07 20:02:03,469 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: Mail
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachment
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: MailWorkQueueName
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentName
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientCCEmail
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-07 20:02:03,473 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'recipientCCEmail'
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientBCCEmail
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-07 20:02:03,473 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'recipientBCCEmail'
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 00_LoadData_Attachment_structure
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned True
2021-06-07 20:02:03,473 [17] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-07 20:02:03,474 [17] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: 00_LoadData_Attachment_structure
2021-06-07 20:02:03,477 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'Attachment_structure', Step 'SendEmail/00_LoadData_Attachment_structure'
2021-06-07 20:02:03,477 [17] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'Attachment_structure', Step 'SendEmail/00_LoadData_Attachment_structure'
2021-06-07 20:02:03,477 [17] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask 00_LoadData_Attachment_structure finished successfully.
2021-06-07 20:02:03,477 [17] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-07 20:02:03,477 [17] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: 01_GenerateMail
2021-06-07 20:02:03,479 [17] INFO Origam.Workflow.WorkflowEngine - Merging context 'Mail', Step 'SendEmail/01_GenerateMail'
2021-06-07 20:02:03,479 [17] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'Mail', Step 'SendEmail/01_GenerateMail'
2021-06-07 20:02:03,479 [17] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask 01_GenerateMail finished successfully.
2021-06-07 20:02:03,480 [17] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 02_Send
2021-06-07 20:02:03,480 [17] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned True
2021-06-07 20:02:03,480 [17] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-07 20:02:03,480 [17] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: 02_Send
2021-06-07 20:02:03,515 [17] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask 02_Send finished successfully.
2021-06-07 20:02:03,515 [17] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 02_SendByQueue
2021-06-07 20:02:03,515 [17] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned False
2021-06-07 20:02:03,515 [17] DEBUG Origam.Workflow.WorkflowEngine - Block 'SendEmail' completed
2021-06-07 20:02:03,516 [17] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask Send finished successfully.
2021-06-07 20:02:03,516 [17] DEBUG Origam.Workflow.WorkflowEngine - Block 'SendEmailFromQueue' completed
2021-06-07 20:02:03,516 [17] DEBUG Origam.Workflow.WorkflowEngine - Workflow completed
2021-06-07 20:02:03,518 [17] ERROR Origam.Workflow.WorkflowEngine - Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Origam.Workflow.Tasks.AbstractWorkflowEngineTask.OnFinished(WorkflowEngineTaskEventArgs e) in D:\a\1\s\origam-source\Origam.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 52
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.OnAsyncAgentOnAsyncCallFinished(Object sender, AsyncReturnValues args) in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 95
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.Execute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 80
   at Origam.Workflow.WorkflowEngine.RunWorkflow() in D:\a\1\s\origam-source\Origam.Workflow\Engine.cs:line 556

part of appsettings.json :

  "UserConfig": {
    "FromAddress": "info@aaa.cz",
    "NewUserRoleId": "",
    "ResetPasswordMailSubject": "Reset Password",
    "ResetPasswordMailBodyFileName": "testResetPwFile.txt",
    "UserUnlockNotificationSubject": "",
    "UserUnlockNotificationBodyFileName": "",
    "UserRegistrationMailSubject": "Register",
    "UserRegistrationMailBodyFileName": "testNewUserFile.txt",
    "MultiFactorMailSubject": "Register",
    "MultiFactorMailBodyFileName": "testMultiFactorFile.txt",
    "MailQueueName": "MAIL_OUT",
    "UserRegistrationAllowed": "true"
  "MailConfig": {
    "UserName": "",
    "Password": "",
    "Server": "10.10.10.254",
    "Port": 25,
    "UseSsl": "false",
    "PickupDirectoryLocation": "C:\\inetpub\\html5test3\\EmailSpool"

Are you using. the latest build?

I’ve just upgraded to the latest Master 2021.2.0.2091. The Object reference not set error disappeared. But the mail message is removed from queue after send command. There is no error in the server log - WF SendEmail is completed without error, but the message is not send. There is no traffic to the mail server. The message just disappeared. Is there any way how to debug the MailService methods?

@koki If you set up your environment in the way that you’re sure the settings are wrong (e. g. incorrect server IP), do you get any error from Origam?

If I set wrong IP address of the mail server on both places (appsettings.json, Origam constant), reset IIS AppPool and send password recovery request, the WF SendEmail ends with Workflow Completed message without any errors in the log.

2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Starting workflow: SendEmail
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Transaction ID: f81dd511-8a8c-4b6e-bfde-bef9e616ed99
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientEmail
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 12:52:28,865 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'recipientEmail'
2021-06-08 12:52:28,865 [18] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'recipientEmail'
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentEntityId
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentRecordId
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 12:52:28,865 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'attachmentRecordId'
2021-06-08 12:52:28,865 [18] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'attachmentRecordId'
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: subject
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 12:52:28,865 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'subject'
2021-06-08 12:52:28,865 [18] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'subject'
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: body
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 12:52:28,865 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'body'
2021-06-08 12:52:28,865 [18] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'body'
2021-06-08 12:52:28,865 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: Attachment_structure
2021-06-08 12:52:28,874 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: senderName
2021-06-08 12:52:28,874 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: senderEmail
2021-06-08 12:52:28,874 [18] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 12:52:28,874 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'senderEmail'
2021-06-08 12:52:28,874 [18] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'senderEmail'
2021-06-08 12:52:28,874 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: Mail
2021-06-08 12:52:28,886 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachment
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: MailWorkQueueName
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentName
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientCCEmail
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 12:52:28,887 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'recipientCCEmail'
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientBCCEmail
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 12:52:28,887 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'recipientBCCEmail'
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 00_LoadData_Attachment_structure
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned True
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 12:52:28,887 [18] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: 00_LoadData_Attachment_structure
2021-06-08 12:52:28,897 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'Attachment_structure', Step 'SendEmail/00_LoadData_Attachment_structure'
2021-06-08 12:52:28,897 [18] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'Attachment_structure', Step 'SendEmail/00_LoadData_Attachment_structure'
2021-06-08 12:52:28,897 [18] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask 00_LoadData_Attachment_structure finished successfully.
2021-06-08 12:52:28,897 [18] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 12:52:28,897 [18] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: 01_GenerateMail
2021-06-08 12:52:28,903 [18] INFO Origam.Workflow.WorkflowEngine - Merging context 'Mail', Step 'SendEmail/01_GenerateMail'
2021-06-08 12:52:28,903 [18] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'Mail', Step 'SendEmail/01_GenerateMail'
2021-06-08 12:52:28,903 [18] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask 01_GenerateMail finished successfully.
2021-06-08 12:52:28,903 [18] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 02_Send
2021-06-08 12:52:28,904 [18] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned True
2021-06-08 12:52:28,904 [18] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 12:52:28,904 [18] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: 02_Send
2021-06-08 12:52:28,972 [18] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask 02_Send finished successfully.
2021-06-08 12:52:28,972 [18] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 02_SendByQueue
2021-06-08 12:52:28,972 [18] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned False
2021-06-08 12:52:28,972 [18] DEBUG Origam.Workflow.WorkflowEngine - Block 'SendEmail' completed
2021-06-08 12:52:28,973 [18] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask Send finished successfully.
2021-06-08 12:52:28,973 [18] DEBUG Origam.Workflow.WorkflowEngine - Block 'SendEmailFromQueue' completed
2021-06-08 12:52:28,973 [18] DEBUG Origam.Workflow.WorkflowEngine - Workflow completed

Why don’t we see the parameters passed to the transformation? I would expect to see it in the log… maybe rule engine logging should be turned on so we see better.

It started to throw Object reference not set to an instance of an object error again. See the debug WorkflowEngine log and RuleEngine log. Generated mail message from Trace attached (user private date are modified).

2021-06-08 16:30:53,086 [9] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 16:30:53,086 [9] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Starting workflow: SendEmail
2021-06-08 16:30:53,086 [9] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Transaction ID: 
2021-06-08 16:30:53,086 [9] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 16:30:53,103 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientEmail
2021-06-08 16:30:53,104 [9] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 16:30:53,127 [9] INFO Origam.Workflow.WorkflowEngine - Merging context 'recipientEmail'
2021-06-08 16:30:53,127 [9] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'recipientEmail'
2021-06-08 16:30:53,127 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentEntityId
2021-06-08 16:30:53,127 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentRecordId
2021-06-08 16:30:53,127 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: subject
2021-06-08 16:30:53,128 [9] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 16:30:53,137 [9] INFO Origam.Workflow.WorkflowEngine - Merging context 'subject'
2021-06-08 16:30:53,137 [9] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'subject'
2021-06-08 16:30:53,137 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: body
2021-06-08 16:30:53,137 [9] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 16:30:53,145 [9] INFO Origam.Workflow.WorkflowEngine - Merging context 'body'
2021-06-08 16:30:53,145 [9] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'body'
2021-06-08 16:30:53,145 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: Attachment_structure
2021-06-08 16:30:53,148 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: senderName
2021-06-08 16:30:53,148 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: senderEmail
2021-06-08 16:30:53,148 [9] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 16:30:53,154 [9] INFO Origam.Workflow.WorkflowEngine - Merging context 'senderEmail'
2021-06-08 16:30:53,154 [9] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'senderEmail'
2021-06-08 16:30:53,155 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: Mail
2021-06-08 16:30:53,163 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachment
2021-06-08 16:30:53,163 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: MailWorkQueueName
2021-06-08 16:30:53,163 [9] DEBUG Origam.Workflow.WorkflowEngine - Passing input context
2021-06-08 16:30:53,170 [9] INFO Origam.Workflow.WorkflowEngine - Merging context 'MailWorkQueueName'
2021-06-08 16:30:53,170 [9] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'MailWorkQueueName'
2021-06-08 16:30:53,170 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: attachmentName
2021-06-08 16:30:53,170 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientCCEmail
2021-06-08 16:30:53,170 [9] DEBUG Origam.Workflow.WorkflowEngine - Initializing data store: recipientBCCEmail
2021-06-08 16:30:53,176 [9] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 00_LoadData_Attachment_structure
2021-06-08 16:30:53,194 [9] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned False
2021-06-08 16:30:53,195 [9] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 16:30:53,195 [9] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: 01_GenerateMail
2021-06-08 16:30:53,281 [9] INFO Origam.Workflow.WorkflowEngine - Merging context 'Mail', Step 'SendEmail/01_GenerateMail'
2021-06-08 16:30:53,314 [9] INFO Origam.Workflow.WorkflowEngine - Finished merging context 'Mail', Step 'SendEmail/01_GenerateMail'
2021-06-08 16:30:53,314 [9] DEBUG Origam.Workflow.WorkflowEngine - ServiceMethodCallEngineTask 01_GenerateMail finished successfully.
2021-06-08 16:30:53,315 [9] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 02_Send
2021-06-08 16:30:53,324 [9] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned False
2021-06-08 16:30:53,324 [9] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 02_SendByQueue
2021-06-08 16:30:53,329 [9] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned True
2021-06-08 16:30:53,329 [9] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 16:30:53,329 [9] DEBUG Origam.Workflow.WorkflowEngine - Starting TransactionBlockEngineTask: 02_SendByQueue
2021-06-08 16:30:53,332 [9] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 16:30:53,332 [9] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Starting workflow: 02_SendByQueue
2021-06-08 16:30:53,332 [9] DEBUG Origam.Workflow.WorkflowEngine - ------------------- Transaction ID: 
2021-06-08 16:30:53,332 [9] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 16:30:53,332 [9] DEBUG Origam.Workflow.WorkflowEngine - Evaluating startup rule for step 01_Attachment_structure_fromAttachmentDataAndName
2021-06-08 16:30:53,337 [9] DEBUG Origam.Workflow.WorkflowEngine - Rule evaluated and returned False
2021-06-08 16:30:53,337 [9] DEBUG Origam.Workflow.WorkflowEngine - ---------------------------------------------------------------------------------------
2021-06-08 16:30:53,337 [9] DEBUG Origam.Workflow.WorkflowEngine - Starting ServiceMethodCallEngineTask: 02_Send_byQueue
2021-06-08 16:30:53,341 [9] ERROR Origam.Workflow.WorkflowEngine - ServiceMethodCallTask 02_Send_byQueue failed.
2021-06-08 16:30:53,369 [9] ERROR Origam.Workflow.WorkflowEngine - Object reference not set to an instance of an object.
Origam.OrigamException: Object reference not set to an instance of an object.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Origam.Workflow.WorkQueueServiceAgent.TraceLog(String parameter) in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 139
   at Origam.Workflow.WorkQueueServiceAgent.Add(IWorkQueueService wqs) in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 174
   at Origam.Workflow.WorkQueueServiceAgent.Run() in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 58
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 213
   at Origam.Workflow.ProfilingTools.<>c__DisplayClass4_0.<ExecuteAndLogDuration>g__FuncToExecute|0() in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 68
   at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Func`1 funcToExecute, String logEntryType, String path, String id, Func`1 logOnlyIf) in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 109
   at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Action action, String logEntryType, String path, String id, Func`1 logOnlyIf) in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 72
   at Origam.Workflow.Tasks.AbstractWorkflowEngineTask.MeasuredExecution() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 102
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.Execute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 71
   --- End of inner exception stack trace ---

--------------------------------------------
02_Send_byQueue
--------------------------------------------

2021-06-08 16:30:53,371 [9] DEBUG Origam.Workflow.WorkflowEngine - Block '02_SendByQueue' completed
2021-06-08 16:30:53,374 [9] ERROR Origam.Workflow.WorkflowEngine - TransactionWorkflowBlock 02_SendByQueue failed.
2021-06-08 16:30:53,409 [9] ERROR Origam.Workflow.WorkflowEngine - Object reference not set to an instance of an object.
Origam.OrigamException: Object reference not set to an instance of an object.
 ---> Origam.OrigamException: Object reference not set to an instance of an object.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Origam.Workflow.WorkQueueServiceAgent.TraceLog(String parameter) in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 139
   at Origam.Workflow.WorkQueueServiceAgent.Add(IWorkQueueService wqs) in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 174
   at Origam.Workflow.WorkQueueServiceAgent.Run() in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 58
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 213
   at Origam.Workflow.ProfilingTools.<>c__DisplayClass4_0.<ExecuteAndLogDuration>g__FuncToExecute|0() in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 68
   at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Func`1 funcToExecute, String logEntryType, String path, String id, Func`1 logOnlyIf) in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 109
   at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Action action, String logEntryType, String path, String id, Func`1 logOnlyIf) in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 72
   at Origam.Workflow.Tasks.AbstractWorkflowEngineTask.MeasuredExecution() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 102
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.Execute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 71
   --- End of inner exception stack trace ---

--------------------------------------------
02_Send_byQueue
--------------------------------------------

   --- End of inner exception stack trace ---

--------------------------------------------
02_SendByQueue
--------------------------------------------

2021-06-08 16:30:53,409 [9] DEBUG Origam.Workflow.WorkflowEngine - Block 'SendEmail' completed
2021-06-08 16:30:53,409 [9] DEBUG Origam.Workflow.WorkflowEngine - Workflow completed
2021-06-08 16:30:53,177 [9] DEBUG Origam.Rule.RuleEngine - Evaluating XPath Rule: SR_SimpleContextValue_IsNotEmpty
2021-06-08 16:30:53,177 [9] DEBUG Origam.Rule.RuleEngine -   Input data: <ROOT />
2021-06-08 16:30:53,315 [9] DEBUG Origam.Rule.RuleEngine - Evaluating XPath Rule: SR_SimpleContextValue_IsEmpty
2021-06-08 16:30:53,315 [9] DEBUG Origam.Rule.RuleEngine -   Input data: <ROOT><value>MAIL_OUT</value></ROOT>
2021-06-08 16:30:53,324 [9] DEBUG Origam.Rule.RuleEngine - Evaluating XPath Rule: SR_SimpleContextValue_IsNotEmpty
2021-06-08 16:30:53,324 [9] DEBUG Origam.Rule.RuleEngine -   Input data: <ROOT><value>MAIL_OUT</value></ROOT>
2021-06-08 16:30:53,332 [9] DEBUG Origam.Rule.RuleEngine - Evaluating XPath Rule: SR_SimpleContextValue_IsNotEmpty
2021-06-08 16:30:53,332 [9] DEBUG Origam.Rule.RuleEngine -   Input data: <ROOT />
<ROOT>
  <Mail DateSent="2021-06-08T16:19:02+02:00" Subject="Obnova Hesla" RecordCreatedBy="29d8990f-b0f3-462a-a812-74e772ce2b06" Id="3dabbc78-1b9d-4a5d-a8ef-73ca39a02fe0" RecordCreated="2021-06-08T16:19:02.9814824+02:00" Selected="false">
    <Sender>info@aaa.cz</Sender>
    <Recipient>aaa@aaaacz</Recipient>
    <MessageBody>Token: CfDJ8BydhlrjTIdBuGCSviyq9%2FUtd7mQ0Y0FOJgJcpowqNbXkcJj7sCIJ05auQyrnmsXhlg0OjcGUlveZEKcHpbOf1Jc56mC1WfkcCorxpI2YY1zqNP5xqVP49Cx1vGXpGAaoY048h2oRzd8IXha96uCByW1FHMxxDuxWQzDE7qrnC%2B5nTzSRHGNPXN%2Bpb%2FL2A16NA%3D%3D
TokenValidityHours: 24
UserName: aaa
EscapedUserName:  aaa
Name: Kocián
EscapedName: AAaa
UserEmail: aaa@aaacz
EscapedUserEmail: aaa%40aaa.cz
PortalBaseUrl: https://localhost:44356

link: https://localhost:44356/Account/ResetPassword?code=CfDJ8BydhlrjTIdBuGCSviyq9%2FUtd7mQ0Y0FOJgJcpowqNbXkcJj7sCIJ05auQyrnmsXhlg0OjcGUlveZEKcHpbOf1Jc56mC1WfkcCorxpI2YY1zqNP5xqVP49Cx1vGXpGAaoY048h2oRzd8IXha96uCByW1FHMxxDuxWQzDE7qrnC%2B5nTzSRHGNPXN%2Bpb%2FL2A16NA%3D%3D</MessageBody>
  </Mail>
</ROOT>

If I set MailQueueName to empty value “” in appsettings.json, the WF SendEmail ends without error, but email is not sent.

If you use queue name, then the queue with that name should exist. Otherwise do not provide a queue name at all and the mail should be sent right away. If you provide a queue name (queue class Mail) then you should at least see the mail in the queue.

If there is no queue name in MailQueueName parameter in appsettings.json, the message is saved to path defined in PickupDirectoryLocation parameter, but is not send to SMTP server.

Of course. That is the meaning of the pickup location. Same as it was on .net 4. It assumes your SMTP server will pick it up from there (I think IIS SMTP server can be configured to do that as well).

If you want ORIGAM to send it directly, do not specify the pickup directory.

I cleared the PickupDirectoryLocation parameter and tried to reset the password again. WF finished without error but no message was send to SMTP server.

Try to add this to the appsettings.config and check the logs:

"Logging": {
    "LogLevel": {
        "System.Net": "Trace",
        "System.Net.Sockets": "Trace" 
    }
}

Emails with reset password link started to work after upgrading to 2021.2.0.2148. Small bug is the email is send twice, so you have 2 identical messages in your inbox.
Just a note: it is not enough to set the SMTP server address in appsettings.json. It will generate error:

2021-07-14 11:50:14,552 [20] ERROR Origam.Workflow.WorkflowHost - Origam.OrigamException: This property cannot be set to an empty string. (Parameter 'value')
 ---> System.ArgumentException: This property cannot be set to an empty string. (Parameter 'value')
   at System.Net.Mail.SmtpClient.set_Host(String value)
   at Origam.Mail.NetStandardMailService.BuildSmtpClient(String server, Int32 port) in D:\a\1\s\origam-source\Origam.Mail\NetStandardMailService.cs:line 259
   at Origam.Mail.NetStandardMailService.SendMail2(MailData mailData, String server, Int32 port) in D:\a\1\s\origam-source\Origam.Mail\NetStandardMailService.cs:line 140
   at Origam.Mail.AbstractMailService.SendMail(IXmlContainer mailDocument, String server, Int32 port) in D:\a\1\s\origam-source\Origam.Mail\AbstractMailService.cs:line 394
   at Origam.Workflow.MailServiceAgent.Run() in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\MailServiceAgent.cs:line 76
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 213
   at Origam.Workflow.ProfilingTools.<>c__DisplayClass4_0.<ExecuteAndLogDuration>g__FuncToExecute|0() in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 68
   at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Func`1 funcToExecute, String logEntryType, String path, String id, Func`1 logOnlyIf) in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 109
   at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Action action, String logEntryType, String path, String id, Func`1 logOnlyIf) in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 72
   at Origam.Workflow.Tasks.AbstractWorkflowEngineTask.MeasuredExecution() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 102
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.Execute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 71
   --- End of inner exception stack trace ---

It is necessary to set SMTP server and port constant in application as well.

i fixed send twice email.

That makes no sense to require both settings in the model and in settings.

We should update the code so that it only sets port from the model if also server is set. If server is not set in the model, the port should be set in settings. If it is not, an error should occur that port is not set.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.