Error handling

Configuration of the SMTP server

If errors occur, email notifications can be sent. As a prerequisite, an SMTP server must be set up in configuration file ./etc/startup.xml. The following listing shows the relevant section. All error notifications are sent via this SMTP server. Alternatively, a channel of type "Mail" can be used.


<!-- mail server settings -->
<Call name="addApplication">
<Arg>
<New class="com.ebd.util.net.mail.HubStartupConfiguration">
<Call name="setMailSettings">
<!-- Uncomment the next line if SMTP via TLS should be used -->
<Arg>smtps</Arg>
<!-- Server -->
<Arg>win-mx.example.com</Arg>
<!-- Port -->
<Arg type="int">587</Arg>
<Arg>username</Arg>
<Arg>password</Arg>
</Call>
<!-- or use mail channel instead
<Call name="setMailChannel">
<Arg>PartnerName</Arg>
<Arg>ChannelName</Arg>
</Call>
-->    
<!-- Uncomment the next line and set with fitting values to change the list of mechanisms to be used for authentication -->
<!-- <Set name="sMTPAuthMechanisms">NTLM LOGIN PLAIN MD5-DIGEST</Set> -->
</New>
</Arg>
</Call>

Configuration of the error email recipients


There are three different entries, in which the recipients of error emails can be configured. In principle, all three entries send emails independently of each other if the respective conditions apply. Exceptions are specifically mentioned below.

Configuration file ./etc/startup.xml

The following setting applies to all profiles and to errors in phase 1.


...
<Call name="enableErrorMail"><Arg type="boolean">true</Arg></Call>
<Set name="MailSender">info@example.com</Set>
<Set name="MailRecipient">admin@example.com;other@example.com</Set>
...


If "enableErrorMail" has the value "true", an email for each error entry in the "General Messages" (with the content of the error entry) to the specified recipients in "MailRecipient" (so even if no job has been created yet) is sent. Important note: Since this can generate a large number of emails very quickly, this functionality should only be used with caution. Note: This address is also used, for example, to send a notification if the disk space of the computer on which the Integration Server is installed is running low.

On page "Clients"


The following settings apply to all profiles of this client and to errors in phases 1-6.

On the "Clients" page, it is possible to define email recipients for errors in all six phases of a profile.

The email contains the job number, the profile name, the name of the input file and the error message. Existing input files are attached to the email. This default behaviour can be prevented by setting the system property "-Dhub.datawizard.error_mail.no_attachment" to "true".

Note: The entered email address for phases 2-5 in the profile overwrites the email addresses for phases 2-5 in the client if an error occurs.


images/download/attachments/153257038/503-version-1-modificationdate-1697531793636-api-v2.png

Here on page "Error handling" - Phases 2-5


The following settings only apply to this profile and to errors in phases 2-5.

The email contains the job number, the profile name, the name of the input file and the error message. Existing input files are attached to the email. This default behaviour can be prevented by setting the system property "-Dhub.datawizard.error_mail.no_attachment" to "true".

Note: The entered email address for phases 2-5 in the profile overwrites the email addresses for phases 2-5 in the client if an error occurs.


images/download/attachments/153257038/504-version-3-modificationdate-1743407198543-api-v2.png


(1) Profile on error: You can specify a profile to be called if an error has occurred in phases 2-5. The profile needs to be active and have an Input Agent of type "Message". The context and queue are irrelevant. The input file and all variables are passed on. If an error occurs before phase 3, variables only contain the defined default values, but you can always access the system variable VAR_FILENAME. The system variable VAR_SYS_EXCEPTION contains the error message and VAR_SYS_CURRENT_RECORD contains the number of the record in which the error occurred (only relevant in phase 3, otherwise, it is always "0").

(2) Start new workflow: You can specify a workflow to be called if an error has occurred in phases 2-5. Variables of the profile can be passed on. For details see section Passing profile variables to workflows. If the workflow allows attaching files, the input data of the profile is transferred. Note: The display name of these workflows begins with the prefix "Error of profile", followed by the profile name and the job number.

(3) Mail recipient on error: Here you can set the email addresses to which an error email is sent if errors have occurred in phases 2-5.

Here on page "Error handling" - Phases 2-6


The following settings only apply to this profile and to errors in phases 2-6.

The content of the email can be freely edited. Note: You may use variables, but depending on the phase in which an error occurs, they may not yet have been initialised.


images/download/attachments/153257038/505-version-2-modificationdate-1743407212572-api-v2.png


(3) Receiver, CC receivers, BCC receivers: If an error has occurred during the profile run, an email can be sent to one or more recipients.

(4) Subject, Message: You can use constants and system variables (e.g. VAR_PROFILENAME, VAR_JOBNR, VAR_SENDER, VAR_MAILSUBJECT, VAR_FILENAME, VAR_SYS_CLIENTNAME and VAR_SYS_EXCEPTION) if they have been defined in the profile (in (3) as well).

(5) Attach input data: This option decides whether the input file is attached to the email. Note: The system property "-Dhub.datawizard.error_mail.no_attachment" hat has no influence on this setting and the setting also has no influence on the system property.

Further settings


Here on page "Error Handling" - Checkboxes


The following settings only apply to this profile and to errors in phases 1-6.


(6) Is an error if profile is called when suspended: If this checkbox is set, calling this profile is interpreted as an error if it is suspended. The profile must have an Input Agent of type "Message". Error emails are sent to the recipients in the error handling for phases 2-6 (see above) and the recipients on page "Clients" for phase 1 (see above). No error emails are sent to the recipients in configuration file ./etc/startup.xml (see above). This setting does not create error entries on pages "Errors" and "General Messages", but it does create them on page "Overview".

(7) Do not report errors and do not send error mail: If this checkbox is set, no error emails are sent for errors in phases 2-6. Error entries are not created on page "Errors", but they are created on page "Overview". Error emails for errors in phase 1 are still sent to the recipients specified in ./etc/startup.xml (see above) (but not to the email addresses specified for phase 1 on page "Clients").

Phase 1/Options in time-driven Input Agents - Checkboxes


The following settings only apply to this profile and to errors in phase 1.

You will find them in the tab "Options" of time-driven Input Agents.


(8) Cronjob is considered on error if no data is found: If this checkbox is set, it is interpreted as an error if the Input Agent does not produce data. If (7) is not set, error emails are sent to the recipients defined in configuration file ./etc/startup.xml (see above), the recipients in the error handling for phases 2-6 (see above) and the recipients on page "Clients" for phase 1 (see above). If (7) is set, emails are only sent to the recipients defined in configuration file ./etc/startup.xml. These errors are not shown on pages "Overview" and "Errors", only on page "General Messages".

(9) Also send notification mail on connection error: Connection errors in phase 1 will also trigger error emails (usually that would only trigger emails to the recipients in configuration file ./etc/startup.xml, see above). If (7) is not set, error emails are sent to the recipients defined in configuration file ./etc/startup.xml (see above), the recipients in the error handling for phases 2-6 (see above) and the recipients on page "Clients" for phase 1 (see above). If (7) is set, emails are only sent to the recipients defined in configuration file ./etc/startup.xml. These errors are not shown on pages "Overview" and "Errors", only on page "General Messages".

See also


Automatic error correction


See section Automatic error correction.


Evaluation of logs


Not all log messages, which may be problematic, are classified as errors. If you want to react to certain (possibly self-generated) log messages, it is possible to set up a Log Listener. A Log Listener 'listens' to certain keywords in the error messages and if necessary sends a notification email.

You can react to Comm Log events with the Input Agent "CommLog".