# Error "All configured authentication methods failed"

**URL:** <https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093>\
**Category:** Icinga Web\
**Created:** [May 3, 2019, 10:56am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093 "2019-05-03T10:56:36Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.sch](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/41988e/32.png) [@m.sch](https://community.icinga.com/u/m.sch)\
**Post date:** [May 3, 2019, 10:56am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/1 "2019-05-03T10:56:36Z")

</div>

Hello everybody.  
I’m very new to icinga so please be a little be patient with me. I took over a network where icinga is running. That works fine. I’m getting mails if there is a status change.  
But icinga web 2 isn’t working. When I’m trying to log in I get the following error message.  
“All configured authentication methods failed. Please check the system log or Icinga Web 2 log for more information.”

The log informations looks like this:

```
May 03 12:51:09 icinga icinga2[13816]: [2019-05-03 12:50:39 +0200] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!
May 03 12:51:09 icinga icinga2[13816]: [2019-05-03 12:50:45 +0200] information/ConfigObject: Dumping program state to file '/var/lib/icinga2/icinga2.state'
May 03 12:51:09 icinga icinga2[13816]: [2019-05-03 12:50:49 +0200] critical/IdoMysqlConnection: Connection to database 'icinga2idomysql' with user 'icingaweb' on 'localhost:3306' failed: "Access denied for user 'icingaweb'@'localhost'
May 03 12:51:09 icinga icinga2[13816]: Context:
May 03 12:51:09 icinga icinga2[13816]: (0) Reconnecting to MySQL IDO database 'ido-mysql'
May 03 12:51:09 icinga icinga2[13816]: [2019-05-03 12:50:49 +0200] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!
May 03 12:51:09 icinga icinga2[13816]: [2019-05-03 12:50:59 +0200] critical/IdoMysqlConnection: Connection to database 'icinga2idomysql' with user 'icingaweb' on 'localhost:3306' failed: "Access denied for user 'icingaweb'@'localhost'
May 03 12:51:09 icinga icinga2[13816]: Context:
May 03 12:51:09 icinga icinga2[13816]: (0) Reconnecting to MySQL IDO database 'ido-mysql'
May 03 12:51:09 icinga icinga2[13816]: [2019-05-03 12:50:59 +0200] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!

```

How can I verify that the db is operational?

---

<div class="post-metadata">

**Author:** ![nilmerg](https://community.icinga.com/user_avatar/community.icinga.com/nilmerg/32/277_2.png) [@nilmerg](https://community.icinga.com/u/nilmerg)\
**Post date:** [May 3, 2019, 11:12am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/2 "2019-05-03T11:12:11Z")

</div>

The shown log is that of Icinga 2. (Note the missing _Web_ here 😉 ) The error says “Access denied”, being more precise than that is difficult.

If you want to troubleshoot why you can’t login into Icinga **Web** 2 take a look at its log. Probably to be found here: /var/log/icingaweb2/icingaweb2.log (Or syslog)

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [May 3, 2019, 11:29am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/3 "2019-05-03T11:29:07Z")

</div>

Hi,

seems you’re mixing the databases here.

- icinga (or icinga2) is used for the the IDO database backend. This is where the monitoring core daemon Icinga 2 is writing its status and config data to.
- icingaweb is used by Icinga Web being the frontend, it stores its config and users in there. Icinga Web as presentation layer also _reads_ from the IDO resource db.

Make sure to first fix the `ido-mysql.conf` file for Icinga 2 and ensure it is writing to the database.  
Then focus on the authentication issue with Icinga Web 2, likely you’re using the wrong resource.

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![m.sch](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/41988e/32.png) [@m.sch](https://community.icinga.com/u/m.sch)\
**Post date:** [May 8, 2019, 3:12pm UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/4 "2019-05-08T15:12:18Z")

</div>

My `ido-mysql.conf` looks like this:

```
library "db_ido_mysql"

object IdoMysqlConnection "ido-mysql" {
  user = "icingaweb",
  password = "password",
  host = "localhost",
  database = "icinga2idomysql"
}

```

So I’ve tried to run `mysql` searching for the right database name. But I’m not able to start mysql. I’m getting `access denied` even as root user.

The messages at the syslog after a faulty login looks like this:  
`May 8 17:05:33 bw-icinga icingaweb2[1089]: Icinga\Exception\IcingaException in /usr/share/php/Icinga/Util/Translator.php:181 with message: Cannot set locale 'de_DE' for category 'LC_ALL'May 8 17:05:33 bw-icinga icingaweb2[1089]: Icinga\Exception\IcingaException in /usr/share/php/Icinga/Util/Translator.php:181 with message: Cannot set locale 'de_DE' for category 'LC_ALL' May 8 17:05:43 bw-icinga icingaweb2[1087]: Icinga\Exception\IcingaException in /usr/share/php/Icinga/Util/Translator.php:181 with message: Cannot set locale 'de_DE' for category 'LC_ALL' May 8 17:05:43 bw-icinga icingaweb2[1087]: Icinga\Exception\AuthenticationException in /usr/share/php/Icinga/Authentication/User/DbUserBackend.php:232 with message: Failed to authenticate user "icingaweb" against backend "icingaweb2". An exception was thrown: <- Zend_Db_Adapter_Exception in /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php:144 with message: SQLSTATE[HY000] [1045] Access denied for user 'icingaweb'@'localhost' (using password: YES) <- PDOException in /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php:128 with message: SQLSTATE[HY000] [1045] Access denied for user 'icingaweb'@'localhost' (using password: YES)`

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [May 9, 2019, 6:54am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/5 "2019-05-09T06:54:34Z")

</div>

Hi,

the ido-mysql feature named “DB IDO” in the docs needs its own database for storing Icinga 2’s config, status, history. The username should be different to `icingaweb` in your example.

I’m not sure if you have yet created the database, user and imported the schema for the DB IDO feature yet - please do so by following the [docs](https://icinga.com/docs/icinga2/latest/doc/02-getting-started/#configuring-db-ido-mysql).

> **Note**
> 
> `mysql -u root -p` should work at this stage. If not, please post the exact steps you’ve taken to install MySQL/MariaDB and the error messages.

Once completed, modify the ido-mysql.conf file again and correct the details. By default, everything is called `icinga` and you don’t need any modifications in there.

Restart Icinga 2 and run `tail -f /var/log/icinga2/icinga2.log` to check that the IDO feature connected to the database.

When you are there and it is working, please tell us here. Then we’ll guide you with Icinga Web 2.

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![m.sch](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/41988e/32.png) [@m.sch](https://community.icinga.com/u/m.sch)\
**Post date:** [May 9, 2019, 7:36am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/6 "2019-05-09T07:36:04Z")

</div>

Hi Michael,

I’ve got connection to the database now.  
So I think we can keep going to the Icinga Web 2 problem.

Thanks for your support!

Regards

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [May 9, 2019, 7:50am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/7 "2019-05-09T07:50:41Z")

</div>

Ok. First off, check whether the previous setup wizard already had created the `icingaweb` database and users.

```auto
mysql -u root -e 'show databases;'
mysql -u root -e "select user,host from mysql.db where db='icingaweb';"

```

If that’s not existing, do that manually following [this step](https://icinga.com/docs/icingaweb2/latest/doc/20-Advanced-Topics/#icinga-web-2-manual-database-setup) (leave out the rest!).

Now that Icinga Web 2 has a database and user, verify that the backend is properly configured. This can be done by editing the ini configuration files in /etc/icingaweb2 - specifically we need the [database resource](https://icinga.com/docs/icingaweb2/latest/doc/04-Resources/#database).

Should look like this, it should take all the credentials you’ve tested before.

```auto
vim /etc/icingaweb2/resources.ini

[mysql-icingaweb]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "icingaweb"
username = "icingaweb"
password = "icingaweb"

```

Now check in [authentication.ini](https://icinga.com/docs/icingaweb2/latest/doc/05-Authentication/#database-authentication) that this points to the database resource.

```auto
vim /etc/icingaweb2/authentication.ini

[mysql-auth]
backend = "db"
resource = "mysql-icingaweb"

```

If the login still fails, verify that the default `icingaadmin` user has been imported into the database already.

```auto
mysql -u icingaweb -picingaweb icingaweb -e 'SELECT * from icingaweb_user;'

```

If not, here’s the manual [steps](https://icinga.com/docs/icingaweb2/latest/doc/20-Advanced-Topics/#manual-user-creation-for-database-authentication-backend).

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![m.sch](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/41988e/32.png) [@m.sch](https://community.icinga.com/u/m.sch)\
**Post date:** [May 9, 2019, 10:05am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/8 "2019-05-09T10:05:36Z")

</div>

I’ve got a database that is called `icingaweb2`. This database has one user `icingaweb`. So I’ve checked `resources.ini`. There are two entries.

```
[icingaweb_db]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "icingaweb2"
username = "icingaweb"
password = "password"
charset = "latin1"
persistent = "0"

[icinga_ido]
type = "db"
db = "mysql"
host = "localhost"
port = "3306"
dbname = "icinga2idomysql"
username = "icingaweb"
password = "password"
charset = "latin1"
persistent = "0"

```

The authentication.ini points to the `icingaweb_db`. That looks fine for me. So I checked the `icingaweb_user`. There is an `icingaadmin` and an `icingaweb`. They are both active.

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [May 9, 2019, 10:17am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/9 "2019-05-09T10:17:38Z")

</div>

Ok, and the authentication.ini parts look like?

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![m.sch](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/41988e/32.png) [@m.sch](https://community.icinga.com/u/m.sch)\
**Post date:** [May 9, 2019, 10:32am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/10 "2019-05-09T10:32:20Z")

</div>

Thats the `authentication.ini`

[icingaweb2]  
backend = “db”  
resource = “icingaweb\_db”

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [May 9, 2019, 11:44am UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/11 "2019-05-09T11:44:22Z")

</div>

Ok, strange. Now, what happens in the log when you attempt to login again with `icingaadmin/icinga` (at this very timestamp)?

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![m.sch](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/41988e/32.png) [@m.sch](https://community.icinga.com/u/m.sch)\
**Post date:** [May 9, 2019, 12:19pm UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/12 "2019-05-09T12:19:40Z")

</div>

Thats the log

`May 9 14:15:14 bw-icinga icingaweb2[2542]: Icinga\Exception\AuthenticationException in /usr/share/php/Icinga/Authentication/User/DbUserBackend.php:232 with message: Failed to authenticate user "icingaadmin" against backend "icingaweb2". An exception was thrown: <- Zend_Db_Adapter_Exception in /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php:144 with message: SQLSTATE[HY000] [1045] Access denied for user 'icingaweb'@'localhost' (using password: YES) <- PDOException in /usr/share/php/Zend/Db/Adapter/Pdo/Abstract.php:128 with message: SQLSTATE[HY000] [1045] Access denied for user 'icingaweb'@'localhost' (using password: YES)`

Looks like the user icingaweb has incorrect rights at the database?!?!?!?

Regards

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [May 9, 2019, 12:24pm UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/13 "2019-05-09T12:24:00Z")

</div>

Ok, then let’s test this.

```auto
mysql -h localhost -u icingaweb -ppassword icingaweb2

select * from icingaweb_user;
show grants;

```

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![m.sch](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/41988e/32.png) [@m.sch](https://community.icinga.com/u/m.sch)\
**Post date:** [May 9, 2019, 12:27pm UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/14 "2019-05-09T12:27:39Z")

</div>

Thats what I get:  
±----------------------------------------------------------------------------------------------------------------------------------------------+  
| Grants for icingaweb@localhost |  
±----------------------------------------------------------------------------------------------------------------------------------------------+  
| GRANT USAGE ON _._ TO ‘icingaweb’@‘localhost’ |  
| GRANT SELECT, INSERT, UPDATE, DELETE, DROP, INDEX, EXECUTE, CREATE VIEW ON `icinga2idomysql`.\* TO ‘icingaweb’@‘localhost’ |  
| GRANT SELECT, INSERT, UPDATE, DELETE, DROP, INDEX, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW ON `icingaweb2`.\* TO ‘icingaweb’@‘localhost’ |  
| GRANT SELECT, INSERT, UPDATE, DELETE, DROP, INDEX, EXECUTE, CREATE VIEW ON `icinga2`.\* TO ‘icingaweb’@‘localhost’ |  
| GRANT SELECT, INSERT, UPDATE, DELETE ON `icingaweb2`.`icingaweb_group_membership` TO ‘icingaweb’@‘localhost’ |  
| GRANT SELECT, INSERT, UPDATE, DELETE ON `icingaweb2`.`icingaweb_user_preference` TO ‘icingaweb’@‘localhost’ |  
| GRANT SELECT, INSERT, UPDATE, DELETE ON `icingaweb2`.`icingaweb_group` TO ‘icingaweb’@‘localhost’ |  
| GRANT SELECT, INSERT, UPDATE, DELETE ON `icingaweb2`.`icingaweb_user` TO ‘icingaweb’@‘localhost’ |  
±----------------------------------------------------------------------------------------------------------------------------------------------+

Regards

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [May 9, 2019, 12:40pm UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/15 "2019-05-09T12:40:38Z")

</div>

Hm. This is getting into black magic. Can you show me the content of `/etc/os-release` (or the output of `icinga2 --version`), I am primarily interested in the distribution details.

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![m.sch](https://community.icinga.com/letter_avatar_proxy/v4/letter/m/41988e/32.png) [@m.sch](https://community.icinga.com/u/m.sch)\
**Post date:** [May 9, 2019, 12:52pm UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/16 "2019-05-09T12:52:15Z")

</div>

I don’t like black magic at least at software problems 😉

That’s the version information:

```
icinga2 - The Icinga 2 network monitoring daemon (version: r2.6.3-1)

Copyright (c) 2012-2017 Icinga Development Team (https://www.icinga.com/)
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Application information:
  Installation root: /usr
  Sysconf directory: /etc
  Run directory: /run
  Local state directory: /var
  Package data directory: /usr/share/icinga2
  State path: /var/lib/icinga2/icinga2.state
  Modified attributes path: /var/lib/icinga2/modified-attributes.conf
  Objects path: /var/cache/icinga2/icinga2.debug
  Vars path: /var/cache/icinga2/icinga2.vars
  PID path: /run/icinga2/icinga2.pid

System information:
  Platform: Ubuntu
  Platform version: 16.04.6 LTS (Xenial Xerus)
  Kernel: Linux
  Kernel version: 4.4.0-146-generic
  Architecture: x86_64

Build information:
  Compiler: GNU 4.8.4
  Build host: lgw01-43
```

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [May 9, 2019, 1:36pm UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/17 "2019-05-09T13:36:55Z")

</div>

So, Ubuntu and Debian who treat `localhost` like a Unix-socket connection. You might want to modify the resource to use `127.0.0.1` as host key and try again.

Besides that, you’re using Icinga 2 core in version 2.6.3 which isn’t supported anymore. I suppose you are using the Ubuntu packages, and not [packages.icinga.com](http://packages.icinga.com) as suggested by our docs. That upgrade is your homework after resolving the web problem then.

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![theFeu](https://community.icinga.com/user_avatar/community.icinga.com/thefeu/32/7277_2.png) [@theFeu](https://community.icinga.com/u/theFeu)\
**Post date:** [September 17, 2021, 2:02pm UTC](https://community.icinga.com/t/error-all-configured-authentication-methods-failed/1093/18 "2021-09-17T14:02:32Z")

</div>

2 posts were split to a new topic: [Failed to check health: Zend\_Db\_Adapter\_Exception](https://community.icinga.com/t/failed-to-check-health-zend-db-adapter-exception/8258)
