No notifications are being generated (SendAgentNotification)

Moderator: crythias

Locked
glorang
Znuny newbie
Posts: 8
Joined: 09 Jun 2016, 11:39
Znuny Version: 6.4.1
Real Name: Geert Lorang

No notifications are being generated (SendAgentNotification)

Post by glorang »

After updating from 6.0.32 (last known working config) -> 6.1.2 -> 6.2.2 -> 6.3.4 -> 6.4.3 (current version) we noticed no notifications are being generated. We did not test notifications on the in between versions (6.1, 6.2, 6.3), we went from 6.0 to 6.4 for the OAuth support.

I've been looking at this the entire day but I'm out of ideas, hopefully someone can give me some hints...

Looking at some old tickets I see in the history of the ticket the actions being taken: change queue, follow-up, unlock, escalation etc and then approximately 10 seconds later a "SendAgentNotification" is logged in the history of the ticket, this is now no longer the case.

We can receive ticket / send replies just fine, everything works here, it's just looks like the notifications are no longer triggered.

I've now deleted all notifications in the system and created a simple notification with following settings:

- Name: test
- Show in agent preference: no
- Validity: valid
- Event : NotificationMove
- Send to these agents: myself, user2
- Also send if user is OoO : checked
- Email : enable this notification method: checked
- Additional recipient email: my other email address with a different domain
- Email template: Default
- Subject / text : test notification / test

I can move the ticket between two queues but no notification is sent / event generated.

My user and user2 are both subscribed to the queue's I've been moving the ticket between.

In System Config "Ticket::EventModulePost###7000-NotificationEvent" is set to the defaults (Module Kernel::System::Ticket::Event::NotificationEvent, Transaction 1)

Under Core > Email > SendmailModule we just use sendmail which will deliver it to our Postfix on the local machine which will forward it to our mail relay. This has been working fine (we can also reply to tickets) so I don't think there is any problem here. As a test I did change to SMTP localhost 25 without authentication but there was no difference.

Daemon also running / started in debug mode, does not show anything related.

Possibly related / which might give a hint to my problem:

Before deleting all notifications I tried to set them to invalid, but any existing notification of event "ArticleCreate" could not be saved because of a missing value for "Article sender type" under the Article Filter. For each of them having this problem I selected all (agent, customer, system) and then set it to invalid.

Same goes for the Znuny generated notification "Mention notification" which is created without any Event set and hence cannot be (re-)saved.

All upgrades went fine / no errors reported etc. I followed all upgrade guides as described so I have no idea anymore where to look.

Many thanks and apologies if this got a bit lengthy.
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: No notifications are being generated (SendAgentNotification)

Post by root »

Hi,

Is there sending a notification recorded in the ticket history?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
glorang
Znuny newbie
Posts: 8
Joined: 09 Jun 2016, 11:39
Znuny Version: 6.4.1
Real Name: Geert Lorang

Re: No notifications are being generated (SendAgentNotification)

Post by glorang »

No, the SendAgentNotification action/event is missing in the ticket history. I've attached a screenshot here.

I'll try to debug some more as well, could you clarify a bit :

- Are those notifications events generated directly after submitting the form or are they added by the OTRS daemon ? I see in past tickers there is approximate 10 seconds delay between the action performed and the SendAgentNotification event.

- What is supposed to be the Event in the "Mention notification" that was added somewhere after > 6.0.32 ? Perhaps some default values are missing in one of the notification tables ?

Thx,
Geert
You do not have the required permissions to view the files attached to this post.
glorang
Znuny newbie
Posts: 8
Joined: 09 Jun 2016, 11:39
Znuny Version: 6.4.1
Real Name: Geert Lorang

Re: No notifications are being generated (SendAgentNotification)

Post by glorang »

Hi guys,

Adding many debug messages in System/Ticket/Event/NotificationEvent.pm I figured out the problem I think.

From my initial debugging the notification was not spawned because _NotificationFilter() returned false when checking for key "AgentEnabledByDefault" because this key does not exist in the passed Ticket object.

Diffing a bit between the 6.0 -> 6.4 versions I noticed this attribute should not be checked because of this code:

in v6.1 there was still :

Code: Select all

    KEY:
    for my $Key ( sort keys %{ $Notification{Data} } ) {

        # TODO: This function here should be fixed to not use hardcoded attribute values!
        # ignore not ticket related attributes
        next KEY if $Key eq 'Recipients';
        ...
        next KEY if $Key eq 'AgentEnabledByDefault';
while from 6.2 onwards this became:

Code: Select all

    # get not ticket related attributes
    my $IgnoredAttributes = $Kernel::OM->Get('Kernel::Config')->Get('Ticket::Event::NotificationEvent::IgnoredAttributes') || {};
    my %IgnoredAttributesHash;
    for my $Key ( keys %{$IgnoredAttributes} ) {
        if ( IsHashRefWithData( $IgnoredAttributes->{$Key} ) ) {
            %IgnoredAttributesHash = ( %IgnoredAttributesHash, %{ $IgnoredAttributes->{$Key} } );
        }
    }

    ...

    KEY:
    for my $Key ( sort keys %{ $Notification{Data} } ) {

        # ignore not ticket related attributes
        next KEY if %IgnoredAttributesHash && $IgnoredAttributesHash{$Key};
But it seems that setting "Ticket::Event::NotificationEvent::IgnoredAttributes" does not exist and this seems to break notifications.

I've commented out the hash check and copy/pasted the big "if" block from v6.1 ("# TODO: This function here should be fixed to not use hardcoded attribute values!") in 6.4 and notifications immediately started working again.

Is it possible the migration script has no initialization of Ticket::Event::NotificationEvent::IgnoredAttributes and/or how can we set this manually ?
glorang
Znuny newbie
Posts: 8
Joined: 09 Jun 2016, 11:39
Znuny Version: 6.4.1
Real Name: Geert Lorang

Re: No notifications are being generated (SendAgentNotification)

Post by glorang »

Ok found the issue :-(

One of our customizations overwrites Kernel/Config/Files/XML/Ticket.xml with an old (v6.0) version which will obviously not work.

I'm checking with the developer of that customization if/why it can't go into Custom.

Apologies for the noise.
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: No notifications are being generated (SendAgentNotification)

Post by root »

glorang wrote: 04 Oct 2022, 18:19 Ok found the issue :-(

One of our customizations overwrites Kernel/Config/Files/XML/Ticket.xml with an old (v6.0) version which will obviously not work.

I'm checking with the developer of that customization if/why it can't go into Custom.

Apologies for the noise.
Hi,

Never(!) overwrite framework XML files. There is already a mechanism in place. The first line of the XML file might look like this:

Code: Select all

<otrs_config version="2.0" init="Config">
FInd an explanation of which values are possible and their purpose at https://doc.znuny.org/manual/developer/ ... tion-files

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
dsmteam
Znuny newbie
Posts: 7
Joined: 19 Dec 2022, 18:16
Znuny Version: 6.0.37
Real Name: Antonin Meignan
Company: KDDI France

Re: No notifications are being generated (SendAgentNotification)

Post by dsmteam »

We have the same issue since upgrading to 6.0.37 (Centuran version)
May I ask how you added the various debug in the file as I suspect this would lead us to a solution ?

edit : found the issue browsing this forum, I was missing a rebuild of the config and cleanup of the cache
Locked