# Establishing an Event Stream API connection failed, will be retried

**URL:** <https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789>\
**Category:** Icinga Web Modules\
**Tags:** notifications\
**Created:** [April 9, 2025, 9:38am UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789 "2025-04-09T09:38:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![systemcookie](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@systemcookie](https://community.icinga.com/u/systemcookie)\
**Post date:** [April 9, 2025, 9:38am UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/1 "2025-04-09T09:38:28Z")

</div>

I’m new to icinga2 and want to setup the new _(beta)_ notifications.  
I’ve followed the documentation but I can’t get it to work. I want to be notified if a host goes down or a service changes to _Warning_, or from _Warning_ to _Critical_.

I added the database and the resource - as in the documentation.  
I created a channel with my MS365 SMTP Settings.  
I tried to set the sources:

```auto
Type: Icinga
API URL: localhost
API username: root
API Password: <from conf.d/api-users.conf> has permissions [*]
Verify API Certificate: Disabled

```

My Icinga Dashboard is available via apache webserver and [https://icinga.my.domain/dashboard](https://icinga.my.domain/dashboard).  
I can see following warning/error:

```auto
journalctl -fu icinga-notifications.service
icinga2: Establishing an Event Stream API connection failed, will be retried

```

I’ve also tried to set a shedule for 24/7 and the admin for every day. Do I need a shedule?  
Event Rule: No Filter – Incident Severity \>= Warning – User|MS365(name of the channel)  
in notifications/events - There are no events, even if I shutdown a minitored host.

- Icinga Web 2 version: 2.12.4-1+debian12
- Used modules and their versions (System - About):icingadb 1.1.3, icinganotifications 0.1.0
- Web browser used: Chrome
- Icinga 2 version used: version: r2.14.5-1
- PHP 8.2.28
- Server OS: Debian 12.10

---

<div class="post-metadata">

**Author:** ![Schl31ch](https://community.icinga.com/user_avatar/community.icinga.com/schl31ch/32/8070_2.png) [@Schl31ch](https://community.icinga.com/u/Schl31ch)\
**Post date:** [April 9, 2025, 12:31pm UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/2 "2025-04-09T12:31:34Z")

</div>

Hey,  
I remember having the exact same warnings in the log.  
My solution was to set the API URL to [https://localhost:5665/](https://localhost:5665/), like that:

```auto
API URL: https://localhost:5665/

```

---

<div class="post-metadata">

**Author:** ![systemcookie](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@systemcookie](https://community.icinga.com/u/systemcookie)\
**Post date:** [April 9, 2025, 1:15pm UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/3 "2025-04-09T13:15:34Z")

</div>

Thanks! I thought I tried all combinations, seems this I didn’t try. The warning is gone!

---

<div class="post-metadata">

**Author:** ![systemcookie](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@systemcookie](https://community.icinga.com/u/systemcookie)\
**Post date:** [April 10, 2025, 11:07am UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/4 "2025-04-10T11:07:21Z")

</div>

Do you may also know what causes this error:

```auto
Apr 10 12:48:24 icinga2 icinga-notifications[11208]: incident: Source 1 opened incident at severity "crit"

Apr 10 12:48:24 icinga2 icinga-notifications[11208]: incident: Rule matches

Apr 10 12:48:24 icinga2 icinga-notifications[11208]: incident: Rule reached escalation

Apr 10 12:48:24 icinga2 icinga-notifications[11208]: incident: Notify contact "the admin" via "ms365" of type "email"

Apr 10 12:48:26 icinga2 icingadb[600]: history-sync: Synced 1 notification history items

Apr 10 12:48:26 icinga2 icingadb[600]: history-sync: Synced 2 state history items

Apr 10 12:48:26 icinga2 icingadb[600]: runtime-updates: Upserted 2 ServiceState items

Apr 10 12:48:34 icinga2 icinga-notifications[11208]: incident: Failed to send notification via channel plugin

```

I’ve only set the settings via config → modues → notifications → channels. Did I overlook something to send emails via smtp?  
Can I enable more log, why it’s failing?

---

<div class="post-metadata">

**Author:** ![apenning](https://community.icinga.com/user_avatar/community.icinga.com/apenning/32/7669_2.png) [@apenning](https://community.icinga.com/u/apenning)\
**Post date:** [April 11, 2025, 8:16am UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/5 "2025-04-11T08:16:16Z")

</div>

The details are within journald fields, which are shown when using another `--output`. Please read the doc section about this in the Icinga DB docs - [Configuration - Icinga DB](https://icinga.com/docs/icinga-db/latest/doc/03-Configuration/#systemd-journald-fields). This will also be included in the Icinga Notification Docs in the upcoming release - [doc/03-Configuration.md: Logging Fields in Journald by oxzi · Pull Request #274 · Icinga/icinga-notifications · GitHub](https://github.com/Icinga/icinga-notifications/pull/274).

---

<div class="post-metadata">

**Author:** ![systemcookie](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@systemcookie](https://community.icinga.com/u/systemcookie)\
**Post date:** [April 14, 2025, 8:27am UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/6 "2025-04-14T08:27:49Z")

</div>

Thanks!  
I see following if STARTTLS or NONE as “SMTP Transport Encryption”:

```auto
ICINGA_NOTIFICATIONS_ERROR=SMTP error 504: Unrecognized authentication type [PA7P264CA0269.FRAP264.PROD.OUTLOOK.COM 2025-04-14T08:04:15.552Z 08DD7AEB578DD3F7]

```

or if TLS as “SMTP Transport Encryption”

```auto
ICINGA_NOTIFICATIONS_ERROR=tls: first record does not look like a TLS handshake

```

does icinga-notifications depend on a local postfix service configured as SMTP relay? I try to use MS365 SMTP authentication, which is working for other services. I only filled this fields:

 ![Screenshot 2025-04-14_10.16.56](https://community.icinga.com/uploads/default/original/2X/1/1efbba6d69d53230ec9ea1934ecb68b161a96256.png)

---

<div class="post-metadata">

**Author:** ![apenning](https://community.icinga.com/user_avatar/community.icinga.com/apenning/32/7669_2.png) [@apenning](https://community.icinga.com/u/apenning)\
**Post date:** [April 14, 2025, 9:39am UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/7 "2025-04-14T09:39:40Z")

</div>

> [@systemcookie](#):
>
> does icinga-notifications depend on a local postfix service configured as SMTP relay

No, the email channel speaks SMTP itself and uses the configured SMTP Host.

However, your error message when using STARTTLS seems to be O365-related. Based on similar web results\[1\], you have to use Microsoft’s so called Legacy SMTP endpoint.

* * *

1. [https://learn.microsoft.com/en-us/answers/questions/1276627/smtp-authentication-error](https://learn.microsoft.com/en-us/answers/questions/1276627/smtp-authentication-error), [https://learn.microsoft.com/en-us/answers/questions/788460/504-5-7-4-unrecognized-authentication-type-(with-o](https://learn.microsoft.com/en-us/answers/questions/788460/504-5-7-4-unrecognized-authentication-type-(with-o), and many more

---

<div class="post-metadata">

**Author:** ![systemcookie](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@systemcookie](https://community.icinga.com/u/systemcookie)\
**Post date:** [April 14, 2025, 10:56am UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/8 "2025-04-14T10:56:20Z")

</div>

unfortunately also this endpoint does not work.  
Maybe the authentication method of the channel is not “plain”.  
I’ll move on to setup smtp-relay with postfix.  
Thanks anyway!

---

<div class="post-metadata">

**Author:** ![systemcookie](https://community.icinga.com/letter_avatar_proxy/v4/letter/s/45deac/32.png) [@systemcookie](https://community.icinga.com/u/systemcookie)\
**Post date:** [April 15, 2025, 8:23am UTC](https://community.icinga.com/t/establishing-an-event-stream-api-connection-failed-will-be-retried/14789/9 "2025-04-15T08:23:07Z")

</div>

smtp-relay with postfix and configure the notifications-plugin to use localhost on 25 without authentication worked 😀
