Question

Clapi export not working since update

  • 14 February 2022
  • 2 replies
  • 332 views

Userlevel 1
Badge +2

Hello,

I’ve updated my servers from 19.04.3 to 19.10.23.

Now clapi export is not working anymore and throw this error:

[root@lcens01i ~]# centreon -u admin -p XXXXXXXX -e > /tmp/export_clapi_xxxxxxx.txt
PHP Fatal error: Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ehi_vrml_image' in 'field list' in /usr/share/centreon/www/class/centreonDB.class.php:275
Stack trace:
#0 /usr/share/centreon/lib/Centreon/Object/Object.php(84): CentreonDB->query('SELECT ehi_note...', Array)
#1 /usr/share/centreon/lib/Centreon/Object/Object.php(226): Centreon_Object->getResult('SELECT ehi_note...', Array, 'fetch')
#2 /usr/share/centreon/lib/Centreon/Object/Host/Extended.php(89): Centreon_Object->getParameters('1554', Array)
#3 /usr/share/centreon/www/class/centreon-clapi/centreonHost.class.php(1371): Centreon_Object_Host_Extended->getParameters('1554', Array)
#4 /usr/share/centreon/www/class/centreon-clapi/centreonAPI.class.php(911): CentreonClapi\CentreonHost->export()
#5 /usr/share/centreon/bin/centreon(194): CentreonClapi\CentreonAPI->export()
#6 {main}

During the update there was no errors and nothing went wrong.


2 replies

Userlevel 1
Badge +2

Ok I found that ehi_vrml_image column in extended_host_information doesn’t exist.

In the SQL script I found that this column exist in CreateTables.sql and then is deleted in the script Update-DB-2.8.17.sql.

I commented line 1376 of /usr/share/centreon/www/class/centreon-clapi/centreonHost.class.php.

And the export went well.

   1368             $params = $extendedObj->getParameters(
1369 $element[$this->object->getPrimaryKey()],
1370 array(
1371 "ehi_notes",
1372 "ehi_notes_url",
1373 "ehi_action_url",
1374 "ehi_icon_image",
1375 "ehi_icon_image_alt",
1376 //"ehi_vrml_image",
1377 "ehi_statusmap_image",
1378 "ehi_2d_coords",
1379 "ehi_3d_coords"
1380 )

Does centreon need this column or not ? Is it a bug ?

Userlevel 5
Badge +16

Hello @mullergg ,

Actually centreon needs that column in the table extended_host_information.

You could add it using this request:

ALTER TABLE extended_host_information
ADD COLUMN ehi_vrml_image int(11) AFTER ehi_icon_image_alt;

 

Reply