Skip to main content
Question

Error during host creation on 25.10

  • November 28, 2025
  • 4 replies
  • 24 views

Scany
Forum|alt.badge.img+1

Hello !

I’m on fresh install of Debian 12

I followed the official docs step by step to install Centreon 25.10.1 with MySQL on it.

When i add a host, i get an error :

Error during creation (json encoding)

 

In centreon-web.log i get this :
[2025-11-28T08:30:39+01:00] ERROR : Error during host/hostTemplate creation | {"custom":{"hostId":null,"isTemplate":false,"exception":{"message":"Syntax error","trace":"#0 /usr/share/centreon/www/include/configuration/configObject/host/DB-Func.php(2978): json_decode()\n#1 /usr/share/centreon/www/include/configuration/configObject/host/DB-Func.php(2825): callHostApi()\n#2 /usr/share/centreon/www/include/configuration/configObject/host/DB-Func.php(2733): insertByApi()\n#3 /usr/share/centreon/www/include/configuration/configObject/host/formHost.php(1132): insertHostInAPI()\n#4 /usr/share/centreon/www/include/configuration/configObject/host/host.php(102): require_once('...')\n#5 /usr/share/centreon/www/main.get.php(277): include_once('...')\n#6 {main}"}},"exception":null,"default":{"request_infos":{"uri":"/centreon/main.get.php?p=60101","http_method":"POST","server":"centreon"}}}

I probably missing something…
I get same error when i was trying on Alma 9.6 too so i returned to Debian.

 

Any idea to fix it ?
Thanks in advance.

4 replies

Sébastien
Centreonian
Forum|alt.badge.img+8
  • Centreonian
  • November 28, 2025

Hello ​@Scany 

same error, if you chose a template ?

for example “generic-active-host-custom”

if you set the logger to debug as below, is there something else in centreon-web?

 


Scany
Forum|alt.badge.img+1
  • Author
  • Steward *
  • November 28, 2025

Thank you for your fast reply, so i enabled Debug, and tried again with generic-active-host-custom template (in my previous test i got same error with os-linux-smtp-custom).
 

in centreon-web.log :
[2025-11-28T09:15:29+01:00] ERROR : Error during host/hostTemplate creation | {"custom":{"hostId":null,"isTemplate":false,"exception":{"message":"Syntax error","trace":"#0 /usr/share/centreon/www/include/configuration/configObject/host/DB-Func.php(2978): json_decode()\n#1 /usr/share/centreon/www/include/configuration/configObject/host/DB-Func.php(2825): callHostApi()\n#2 /usr/share/centreon/www/include/configuration/configObject/host/DB-Func.php(2733): insertByApi()\n#3 /usr/share/centreon/www/include/configuration/configObject/host/formHost.php(1132): insertHostInAPI()\n#4 /usr/share/centreon/www/include/configuration/configObject/host/host.php(102): require_once('...')\n#5 /usr/share/centreon/www/main.get.php(277): include_once('...')\n#6 {main}"}},"exception":null,"default":{"request_infos":{"uri":"/centreon/main.get.php?p=60101","http_method":"POST","server":"centreon"}}}

 

I need to check another log file?


Sébastien
Centreonian
Forum|alt.badge.img+8
  • Centreonian
  • November 28, 2025

@Scany Yes

In the DevTools (f12 → console)

and maybe PHP:

/var/log/apache2/error.log

 


Scany
Forum|alt.badge.img+1
  • Author
  • Steward *
  • November 28, 2025

In console :
 


in /var/log/apache2/error.log
[Wed Nov 26 15:01:59.034165 2025] [mpm_prefork:notice] [pid 28125:tid 28125] AH00163: Apache/2.4.65 (Debian) configured -- resuming normal operations
[Wed Nov 26 15:01:59.034247 2025] [core:notice] [pid 28125:tid 28125] AH00094: Command line: '/usr/sbin/apache2'
[Wed Nov 26 15:02:55.950633 2025] [mpm_prefork:notice] [pid 28125:tid 28125] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Nov 26 15:02:56.166730 2025] [mpm_prefork:notice] [pid 29400:tid 29400] AH00163: Apache/2.4.65 (Debian) configured -- resuming normal operations
[Wed Nov 26 15:02:56.166796 2025] [core:notice] [pid 29400:tid 29400] AH00094: Command line: '/usr/sbin/apache2'
[Thu Nov 27 07:58:36.657367 2025] [proxy_fcgi:error] [pid 45210:tid 45210] [client 10.12.11.34:37334] AH01071: Got error 'PHP message: PHP Warning:  Undefined variable $sessionKeyFreeze in /usr/share/centreon/www/include/Administration/parameters/general/form.php on line 279', referer: http://centreon/centreon/main.php?p=50110&o=general
[Fri Nov 28 00:00:01.507374 2025] [mpm_prefork:notice] [pid 29400:tid 29400] AH00171: Graceful restart requested, doing restart
[Fri Nov 28 00:00:01.587968 2025] [mpm_prefork:notice] [pid 29400:tid 29400] AH00163: Apache/2.4.65 (Debian) configured -- resuming normal operations
[Fri Nov 28 00:00:01.588003 2025] [core:notice] [pid 29400:tid 29400] AH00094: Command line: '/usr/sbin/apache2'

nothing in apache log from midnight.

Can be a problem with files rights ? I touch nothing till installation.
The debian is installed without graphical interface, just network config and ssh server.

root@centreon:/usr/share/centreon# ls -ali
total 68
70914331 drwxr-xr-x  13 root     root     4096 28 nov.  10:04 .
70778882 drwxr-xr-x 128 root     root     4096 26 nov.  14:59 ..
70922574 drwxr-xr-x   2 centreon centreon 4096 26 nov.  14:59 api
70914925 drwxr-xr-x   2 root     root     4096 26 nov.  14:59 bin
70922593 -rw-rw-r--   1 root     root     1685  6 nov.  16:32 bootstrap.php
70922618 drwxr-xr-x   7 root     root     4096 26 nov.  14:59 config
70922594 drwxr-xr-x   5 root     root     4096 26 nov.  14:59 config.new
70922777 -rw-rw-r--   1 root     root     3226  6 nov.  16:32 container.php
70922778 drwxr-xr-x   2 root     root     4096 26 nov.  14:59 cron
70940574 -rw-rw-r--   1 centreon centreon  105 28 nov.  09:15 .env
70922559 -rw-rw-r--   1 centreon centreon  197 28 nov.  09:15 .env.local.php
70922791 drwxr-xr-x   2 root     root     4096 26 nov.  14:59 examples
70922561 drwxrwxr-x   4 centreon centreon 4096 26 nov.  14:59 GPL_LIB
70914332 drwxr-xr-x   4 root     root     4096 26 nov.  14:59 lib
70922943 drwxrwxr-x  19 centreon centreon 4096 26 nov.  14:59 src
70927032 drwxr-xr-x  34 root     root     4096 26 nov.  14:59 vendor
70935276 drwxrwxr-x  13 centreon centreon 4096 27 nov.  07:55 www

root@centreon:/var/cache/centreon# ls -ali
total 24
44567599 drwxrwxr-x  6 centreon centreon 4096 27 nov.  07:55 .
44564486 drwxr-xr-x 16 root     root     4096 26 nov.  15:02 ..
44567600 drwxrwxr-x  2 centreon centreon 4096  8 oct.  10:19 backup
44567601 drwsrwsr-x  6 centreon centreon 4096 26 nov.  14:57 config
44698203 drwxr-xr-x  6 www-data www-data 4096 27 nov.  07:55 symfony
44695882 drwxr-xr-x  5 www-data www-data 4096 27 nov.  07:44 symfony.new