Skip to main content

Hello,

I just upgraded from 21.04 to 24.10.

When upgrading the widget, I ahve the following error on the “grid-map” widget.

I think is an old that have never been solved :(

Thank you.


​​​​​​

 

nobody ?


Hello ​@wackou 

 

since you’re talking about an upgrade from a 21.04 version you are probably facing an issue regarding a typo that we had back in the days regarding this widget.

Sometimes grid-map was spelled Grid-map and this led to issues such as the one you currently have.

To check that, on your central database, run the below query

select widget_model_id,title,url,thumbnail from centreon.widget_models;

 

you should have a result like below

 

If I’m not mistaken, the url value is probably ./widgets/Grid-map/index.php instead of ./widgets/grid-map/index.php (you’ll see that we still have typo in the thumbnail column but we don’t care about this one)

If you have Grid-map instead of grid-map just change the value with the below query

 update centreon.widget_models set url='./widgets/grid-map/index.php' where title = 'Grid-map';

 

if all the values were looking fine in your database, make sure that you don’t have some weird widget config file remaining on your server.

To do so just display the content of the xml config file of the widget

cat /usr/share/centreon/www/widgets/grid-map/configs.xml

and make sure that everything is on par with what you got in your database

In my case, the file has the proper url

<configs>
<title>Grid-map</title>
<author>Centreon</author>
<email>contact@centreon.com</email>
<website>http://www.centreon.com</website>
<description>This grid map widget displays the status of services for a set of hosts. It is possible to select which services to display.</description>
<keywords>centreon, widget, Grid-map</keywords>
<screenshot></screenshot>
<thumbnail>./widgets/Grid-map/resources/logo1.png</thumbnail>
<url>./widgets/grid-map/index.php</url>
<autoRefresh>10</autoRefresh>
<preferences>
<preference label="Name Host Group" name="host_group" defaultValue="" type="hostgroup" header="Resource"/>
<preference label="Name Services" name="service" defaultValue="" type="text"/>
<preference label="Refresh Interval (seconds)" name="refresh_interval" defaultValue="30" type="text" header="Misc"/>
</preferences>
</configs>

 

Hope it helps and solves your problem.

Have a nice day,

Regards


Hello ​@tcharles ,

Thanks for your answer, unfortunately that didn’t solve the issue.

Here is the ouput :

select widget_model_id,title,url,thumbnail from centreon.widget_models;

 

So the DB seems OK, looking at the file :

cat /usr/share/centreon/www/widgets/grid-map/configs.xml

And the config file seems OK too :

 


Hello ​@tcharles ,

Can you help me ?
I still have the issue :(


Hello ​@wackou 

Of course I can, sorry for the late reply, I didn’t see the notification from your previous answer.

 

Obviously you have the issue because I’ve missed one important information.

I forgot the directory column of the table. So you can perform the below query

select widget_model_id,title,url,thumbnail,directory from centreon.widget_models;

 

Since your answer made me doubt, I went deeper in the code (that’s how I’ve seen my mistake regarding the directory column that I forgot).

The install button is performing the below query

SELECT widget_model_id FROM widget_models WHERE directory = 'grid-map'

I’m pretty sure you have 0 result because your directory is ‘Grid-map’ which leads to you having your widget registered in the database but not found by the web interface that will try to install an already installed widget

 

so to fix this and based on your screenshots, just run the below query and that should be fine:

update centreon.widget_models set directory='Grid-map' where widget_model_id=1;

 

Have a nice day,

Regards


Hello ​@tcharles ,

I did what you indicated but unfortunately that didn’t update anything on the DB :(

 

 

Except if I didn’t understand what you indicated ...


hello ​@wackou 

 

yeah, end of the reply is always a bad idea :D 

my update query is wrong but thanks to your screenshot it confirms the issue. The directory column value is wrong. I wanted to updated from Grid-map to grid-map but my copy/paste skills are quite low ^^

 

here is the valid update command

update centreon.widget_models set directory='grid-map' where widget_model_id=1;

 


hello ​@tcharles 

Thanks a lot, that’s solve the issue :)


Reply