Problem with IcingaDB: "encoding/hex: invalid byte: U+002D '-'"

I installed icinga2, icingadb-redis and icingadb on Debian11.

After installing icingadb i created the database in mariadb and imported the schema:

mariadb
	MariaDB [(none)]> CREATE DATABASE icingadb;
	MariaDB [(none)]> GRANT ALL ON icingadb.* TO icingadb@localhost IDENTIFIED BY '< password >';
	MariaDB [(none)]> FLUSH PRIVILEGES;
	MariaDB [(none)]> exit
mariadb icingadb </usr/share/icingadb/schema/mysql/schema.sql

I stored icingadb password in its field inside /etc/icingadb/config.yml, then i restarted the service:

systemctl restart icingadb

But i got this error:

systemctl status icingadb
● icingadb.service - Icinga DB
     Loaded: loaded (/lib/systemd/system/icingadb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2023-02-20 14:13:10 CET; 2min 55s ago
    Process: 1853 ExecStart=/usr/sbin/icingadb --config /etc/icingadb/config.yml (code=exited, status=1/FAILURE)
   Main PID: 1853 (code=exited, status=1/FAILURE)
        CPU: 49ms

Feb 20 14:13:10 server00 systemd[1]: Starting Icinga DB...
Feb 20 14:13:10 server00 icingadb[1853]: Starting Icinga DB
Feb 20 14:13:10 server00 systemd[1]: Started Icinga DB.
Feb 20 14:13:10 server00 icingadb[1853]: Connecting to database at 'localhost:0'
Feb 20 14:13:10 server00 icingadb[1853]: Connecting to Redis at 'localhost:6380'
Feb 20 14:13:10 server00 icingadb[1853]: Starting history sync
Feb 20 14:13:10 server00 icingadb[1853]: encoding/hex: invalid byte: U+002D '-'
                                             can't decode hex "a76a6e8b-3722-4d83-83d1-f25aa390d127"
                                             github.com/icinga/icingadb/internal.CantDecodeHex
                                                     github.com/icinga/icingadb/internal/internal.go:10
                                             github.com/icinga/icingadb/pkg/types.(*Binary).UnmarshalText
                                                     github.com/icinga/icingadb/pkg/types/binary.go:56
                                             github.com/icinga/icingadb/pkg/structify.parseString
                                                     github.com/icinga/icingadb/pkg/structify/structify.go:114
                                             github.com/icinga/icingadb/pkg/structify.structifyMapByTree
                                                     github.com/icinga/icingadb/pkg/structify/structify.go:86
                                             github.com/icinga/icingadb/pkg/structify.structifyMapByTree
                                                     github.com/icinga/icingadb/pkg/structify/structify.go:102
                                             github.com/icinga/icingadb/pkg/structify.structifyMapByTree
                                                     github.com/icinga/icingadb/pkg/structify/structify.go:102
                                             github.com/icinga/icingadb/pkg/structify.structifyMapByTree
                                                     github.com/icinga/icingadb/pkg/structify/structify.go:102
                                             github.com/icinga/icingadb/pkg/structify.MakeMapStructifier.func1
                                                     github.com/icinga/icingadb/pkg/structify/structify.go:42
                                             github.com/icinga/icingadb/pkg/icingadb/history.writeOneEntityStage.func1

Redis seems to be working properly:

systemctl status icingadb-redis
● icingadb-redis-server.service - Advanced key-value store
     Loaded: loaded (/lib/systemd/system/icingadb-redis-server.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-02-20 14:13:08 CET; 13min ago
       Docs: http://redis.io/documentation,
             man:icingadb-redis-server(1)
   Main PID: 1176 (icingadb-redis-)
     Status: "Ready to accept connections"
      Tasks: 5 (limit: 154187)
     Memory: 17.5M
        CPU: 1.808s
     CGroup: /system.slice/icingadb-redis-server.service
             └─1176 /usr/bin/icingadb-redis-server 127.0.0.1:6380

Feb 20 14:13:08 server00 systemd[1]: Starting Advanced key-value store...
Feb 20 14:13:08 server00 systemd[1]: Started Advanced key-value store.
systemctl status icingadb-redis-server
● icingadb-redis-server.service - Advanced key-value store
     Loaded: loaded (/lib/systemd/system/icingadb-redis-server.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-02-20 14:13:08 CET; 14min ago
       Docs: http://redis.io/documentation,
             man:icingadb-redis-server(1)
   Main PID: 1176 (icingadb-redis-)
     Status: "Ready to accept connections"
      Tasks: 5 (limit: 154187)
     Memory: 17.6M
        CPU: 1.861s
     CGroup: /system.slice/icingadb-redis-server.service
             └─1176 /usr/bin/icingadb-redis-server 127.0.0.1:6380

Feb 20 14:13:08 server00 systemd[1]: Starting Advanced key-value store...
Feb 20 14:13:08 server00 systemd[1]: Started Advanced key-value store.

Icingadb feature is also enabled

icinga2 feature list
Disabled features: command compatlog debuglog elasticsearch gelf graphite influxdb influxdb2 livestatus notification opentsdb perfdata statusdata syslog
Enabled features: api checker icingadb mainlog

Im really lost, any help would be appreciated

This isn’t hexadecimal. Though, it may be misinterpreted as that by looking at the first few bytes.

This is most probably a bug. Please open an issue over at Github.

Which version of Icinga 2 do you use? We did a change of how history data is written before the release of Icinga DB 1.0, which means that you have to use at least Icinga 2.13.4. History data isn’t deleted from Redis until it was persisted in MySQL/PostgreSQL. That means that if you’ve experimented with older versions before and there is still data in Redis, you have to perform some manual cleanup, see Upgrading - Icinga DB.

Thank you so much.
Cleaning redis did the trick:

icingadb-redis-cli  flushall

After that, restart the service (or the whole server) and it should work perfectly.