Pandora FMS community forums
Sql error after an update of pandoraFMS - Printable Version

+- Pandora FMS community forums (http://pandorafms.org/forum)
+-- Forum: Pandora FMS (http://pandorafms.org/forum/forum-3.html)
+--- Forum: Advanced troubleshooting and problems (http://pandorafms.org/forum/forum-11.html)
+--- Thread: Sql error after an update of pandoraFMS (/thread-15486.html)



Sql error after an update of pandoraFMS - gohone35 - 09-16-2020

Hi,

I'm running pandoraFMS on ubuntu and I recently updated pandoraFMS from 7.0.740NG to 7.0.749NG by using the deb packages.
I also applied all "MR" sql scripts in the database.

All seems to be working but I have a sql error on the dashboard when I'm connected.
SQL error: Unknown column 'td.id_group' in 'field list' ('SELECT td.id, td.name, td.id_user, td.id_group, td.active, count(twd.id) as cells, td.cells_slideshow FROM tdashboard td LEFT JOIN twidget_dashboard twd ON td.id = twd.id_dashboard WHERE 1=1 AND td.active = 1 GROUP BY td.id ORDER BY name') in/var/www/pandora_console/include/db/mysql.php on line 114


I probably have an issue in the database.
Could you help me to fix it ?

Thanks for your help


RE: Sql error after an update of pandoraFMS - Jimmy_Olano - 09-17-2020

Hi guys, hello girls!

With all due respect, please check out this:

http://pandorafms.org/forum/thread-15210.html

It maybe is useful for you! Read there my proposal, have a nice day! 8-)


RE: Sql error after an update of pandoraFMS - gohone35 - 09-17-2020

(09-17-2020, 11:26 AM)Jimmy_Olano Wrote: Hi guys, hello girls!

With all due respect, please check out this:

http://pandorafms.org/forum/thread-15210.html

It maybe is useful for you! Read there my proposal, have a nice day! 8-)
Thanks for your help.
I took a look on your link but I don't know what to do except applying the MR sql scripts. The thing is I already did that.
The upgrade should be basically minor because pandoraFMS stays on the same branch (from 7.0NG.740 to 7.0NG.749)

I checked in the tables referenced in the sql error and I have that

mysql> show columns from tdashboard;
+-----------------+------------------+------+-----+---------+----------------+
| Field          | Type            | Null | Key | Default | Extra          |
+-----------------+------------------+------+-----+---------+----------------+
| id              | int(20) unsigned | NO  | PRI | NULL    | auto_increment |
| name            | varchar(60)      | NO  |    |        |                |
| id_user        | varchar(60)      | NO  |    |        |                |
| active          | tinyint(1)      | NO  |    | 0      |                |
| cells_slideshow | tinyint(1)      | NO  |    | 0      |                |
+-----------------+------------------+------+-----+---------+----------------+


mysql> show columns from twidget_dashboard;
+--------------+------------------+------+-----+---------+----------------+
| Field        | Type            | Null | Key | Default | Extra          |
+--------------+------------------+------+-----+---------+----------------+
| id          | int(20) unsigned | NO  | PRI | NULL    | auto_increment |
| options      | longtext        | NO  |    | NULL    |                |
| container    | varchar(30)      | NO  |    |        |                |
| order        | int(3)          | NO  |    | 0      |                |
| id_dashboard | int(20) unsigned | NO  | MUL | 0      |                |
| id_widget    | int(20) unsigned | NO  | MUL | 0      |                |
| position    | text            | NO  |    | NULL    |                |
+--------------+------------------+------+-----+---------+----------------+

I guess I need to put a sql command to add the missing "id_group" column but I don't have the details.
Maybe something like ALTER TABLE tdashboard ADD COLUMN 'id_group' ....

Unfortunately for me, I'm a beginner with sql.

If someone has an idea...
Thanks in advance


RE: Sql error after an update of pandoraFMS - gohone35 - 09-17-2020

Finally, I fixed this particular issue by myself. I found the sql script used to initialize the database when you install pandorafms V7 at the first time.(for me: /var/www/pandora_console/pandoradb.sql)
I saw the details about the creation of "tdashboard" table and I used this information to add two missing columns in the table.
ALTER TABLE tdashboard ADD COLUMN id_group int(10) NOT NULL default 0 AFTER id_user;
ALTER TABLE tdashboard ADD COLUMN cells int(10) unsigned default 0 AFTER active;

The sql error message doesn't appear anymore in the dashboard.