Please change the encoding for the director database to utf8

Hi guys,
I installed my first Icinga2 Installation but i have a problem with the Icinga Director.
I see the database backend DB Resource has the following error “Please change the encoding for the director database to utf8”

I attempted the following commands to fix. They did not work.

— snip ----

MariaDB [(none)]> ALTER DATABASE director CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Query OK, 1 row affected (0.005 sec)

MariaDB [(none)]> ALTER DATABASE icingaweb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Query OK, 1 row affected (0.001 sec)

— snip —

Here are system details

icingaweb is install on a centos 8 server

# icinga2 --version

icinga2 - The Icinga 2 network monitoring daemon (version: 2.13.2-1)

Copyright (c) 2012-2022 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <https://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.

System information:
  Platform: CentOS Stream
  Platform version: 8
  Kernel: Linux
  Kernel version: 4.18.0-365.el8.x86_64
  Architecture: x86_64

Build information:
  Compiler: GNU 8.4.1
  Build host: runner-hh8q3bz2-project-322-concurrent-0
  OpenSSL version: OpenSSL 1.1.1k  FIPS 25 Mar 2021

Application information:

General paths:
  Config directory: /etc/icinga2
  Data directory: /var/lib/icinga2
  Log directory: /var/log/icinga2
  Cache directory: /var/cache/icinga2
  Spool directory: /var/spool/icinga2
  Run directory: /run/icinga2

Old paths (deprecated):
  Installation root: /usr
  Sysconf directory: /etc
  Run directory (base): /run
  Local state directory: /var

Internal paths:
  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

# ss -tnlp | grep 5665
LISTEN 0      128                *:5665            *:*    users:(("icinga2",pid=3344,fd=22))

Icinga Web 2 Version
2.9.5
Git commit
053971c99dc1a4510beb64a888ea695cc14032dc
PHP Version
8.0.16
Git commit date
2021-11-18

  # icinga2 daemon -C
[2022-02-23 22:30:52 -0500] information/cli: Icinga application loader (version: 2.13.2-1)
[2022-02-23 22:30:52 -0500] information/cli: Loading configuration file(s).
[2022-02-23 22:30:52 -0500] information/ConfigItem: Committing config item(s).
[2022-02-23 22:30:52 -0500] information/ApiListener: My API identity: icinga.acro.dev
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 GraphiteWriter.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 NotificationComponent.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 CheckerComponent.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 2 Users.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 UserGroup.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 3 ServiceGroups.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 3 TimePeriods.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 11 Services.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 3 Zones.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 4 NotificationCommands.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 2 HostGroups.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 24 Notifications.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 Downtime.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 IcingaApplication.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 Host.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 Endpoint.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 FileLogger.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 2 ApiUsers.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 244 CheckCommands.
[2022-02-23 22:30:52 -0500] information/ConfigItem: Instantiated 1 ApiListener.
[2022-02-23 22:30:52 -0500] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2022-02-23 22:30:52 -0500] information/cli: Finished validating the configuration file(s).

I’d also try to set the encoding in the resource configuration :thinking:

Is there guidance on how to set the encoding in the resource configuration?

Hi.

Icingaweb2
→ Configuration
→ Application
→ Resources
→ Name_Of_Your_Director_Resource
→ “Character Set”

You can enter your character set here, e.g. utf8.

Or you can directly edit the related config file, e.g.
/etc/icingaweb2/resources.ini

[Name_Of_Your_Director_Resource]
...
charset = "utf8"
...

Greetings.

Thanks, homerjay. That cleared the issue.