OCSInventory-NG / OCSInventory-Server

Communication server of OCS Inventory
http://www.ocsinventory-ng.org/
GNU General Public License v2.0
344 stars 139 forks source link

Bug when upgrading 2.8 to 2.9.1 ? #353

Closed cborivant closed 2 years ago

cborivant commented 2 years ago

It's hard to solve a problem when important details are missing, that why we added this template, to help you and us.

General informations

Operating system : CentOS Linux release 7.9.2009 (Core)

Server informations

Perl version : perl 5, version 16, subversion 3 (v5.16.3) Mysql / Mariadb / Percona version : 5.5.68

OCS Inventory informations

Ocs server version : 2.9.1

Problem's description

Hello, I just migrated from 2.8 to 2.9.1. I'm aware of the necessity to run cron_all_software.php in a cron job and I can run it without errors. The all software page is still empty so I sat the general_log to ON on my database to capture every query. when accessing the all sofware page, the following query run : SELECT SQL_CALC_FOUND_ROWS *, count(CONCAT(s.NAMEID,"", s.VERSION_ID)) as nb, CONCAT(n.NAME,";", v.VERSION) id, sc.CATEGORY_NAME, v.VERSION, n.NAME, p.PUBLISHER FROM software s LEFT JOIN software_name n ON s.NAME_ID = n.ID LEFT JOIN software_publisher p ON s.PUBLISHER_ID = p.ID LEFT JOIN software_version v ON s.VERSION_ID = v.ID LEFT JOIN software_categories sc ON n.CATEGORY = sc.ID GROUP BY CONCAT(s.NAMEID,'', s.VERSION_ID) order by n.NAME asc limit 0 , 10 But the column category does not exists in the software_name table. I think, it could be a bug in the upgrade process.

cborivant commented 2 years ago

Forgot to mention, it's an rpm installation.

cborivant commented 2 years ago

There is an update script which drop the column ! This the file /usr/share/ocsinventory-reports/ocsreports/files/update/7045.sql.

charleneauger commented 2 years ago

Hi @cborivant ,

Can you send me the ms_all_soft.php file ? (/usr/share/ocsinventory-reports/ocsreports/plugins/main_sections/ms_all_soft/ms_all_soft.php)

Since 2.9, the category column has been moved on a new table named software_categories_link.

Regards, Charlene Auger

cborivant commented 2 years ago

Hi Charlène,

Here is the file. I think the query starting on line 133 is one of the wrong queries, it does not involve software_categories_link. Same on line 174 and 214.


Christophe Borivant Responsable d'exploitation informatique +33 5 62 20 71 71 (Poste 503)

Devinlec - Groupe Leclerc

Le mar. 12 oct. 2021 à 15:00, Charlène Auger @.***> a écrit :

Hi @cborivant https://github.com/cborivant ,

Can you send me the ms_all_soft.php file ? (/usr/share/ocsinventory-reports/ocsreports/plugins/main_sections/ms_all_soft/ms_all_soft.php)

Since 2.9, the category column has been moved on a new table named software_categories_link.

Regards, Charlene Auger

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OCSInventory-NG/OCSInventory-Server/issues/353#issuecomment-940989812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWAU2LJUK4VFODZMWK62BR3UGQWORANCNFSM5FZ4NHZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

cborivant commented 2 years ago

Hi again Charlène,

In the ocsbase.sql and ocs_base_new.sql scripts, the category column is still present in the software_name table.

Christophe Borivant Responsable d'exploitation informatique +33 5 62 20 71 71 (Poste 503)

Devinlec - Groupe Leclerc

Le mar. 12 oct. 2021 à 15:09, Christophe BORIVANT @.***> a écrit :

Hi Charlène,

Here is the file. I think the query starting on line 133 is one of the wrong queries, it does not involve software_categories_link. Same on line 174 and 214.


Christophe Borivant Responsable d'exploitation informatique +33 5 62 20 71 71 (Poste 503)

Devinlec - Groupe Leclerc

Le mar. 12 oct. 2021 à 15:00, Charlène Auger @.***> a écrit :

Hi @cborivant https://github.com/cborivant ,

Can you send me the ms_all_soft.php file ? (/usr/share/ocsinventory-reports/ocsreports/plugins/main_sections/ms_all_soft/ms_all_soft.php)

Since 2.9, the category column has been moved on a new table named software_categories_link.

Regards, Charlene Auger

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OCSInventory-NG/OCSInventory-Server/issues/353#issuecomment-940989812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWAU2LJUK4VFODZMWK62BR3UGQWORANCNFSM5FZ4NHZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

charleneauger commented 2 years ago

@cborivant ,

I think your ms_all_soft.php didn't update correctly. Can you just replace the old file by the new in attachment and tell me if the all software page works correctly ?

ms_all_soft.zip

Regards, Charlene Auger

cborivant commented 2 years ago

I replaced the file and dropped the category column from software_name. The all software page works fine now, but if I choose a computer, its software list is empty.

Christophe Borivant Responsable d'exploitation informatique +33 5 62 20 71 71 (Poste 503)

Devinlec - Groupe Leclerc

Le mar. 12 oct. 2021 à 15:20, Charlène Auger @.***> a écrit :

@cborivant https://github.com/cborivant ,

I think your ms_all_soft.php didn't update correctly. Can you just replace the old file by the new in attachment and tell me if the all software page works correctly ?

ms_all_soft.zip https://github.com/OCSInventory-NG/OCSInventory-Server/files/7330270/ms_all_soft.zip

Regards, Charlene Auger

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OCSInventory-NG/OCSInventory-Server/issues/353#issuecomment-941006998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWAU2LOZ27DTGZZTZX3YEVTUGQYZ7ANCNFSM5FZ4NHZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

cborivant commented 2 years ago

And the update has been done with yum update. you should have a look at the rpm package.

Christophe Borivant Responsable d'exploitation informatique +33 5 62 20 71 71 (Poste 503)

Devinlec - Groupe Leclerc

Le mar. 12 oct. 2021 à 15:35, Christophe BORIVANT @.***> a écrit :

I replaced the file and dropped the category column from software_name. The all software page works fine now, but if I choose a computer, its software list is empty.

Christophe Borivant Responsable d'exploitation informatique +33 5 62 20 71 71 (Poste 503)

Devinlec - Groupe Leclerc

Le mar. 12 oct. 2021 à 15:20, Charlène Auger @.***> a écrit :

@cborivant https://github.com/cborivant ,

I think your ms_all_soft.php didn't update correctly. Can you just replace the old file by the new in attachment and tell me if the all software page works correctly ?

ms_all_soft.zip https://github.com/OCSInventory-NG/OCSInventory-Server/files/7330270/ms_all_soft.zip

Regards, Charlene Auger

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OCSInventory-NG/OCSInventory-Server/issues/353#issuecomment-941006998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWAU2LOZ27DTGZZTZX3YEVTUGQYZ7ANCNFSM5FZ4NHZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

cborivant commented 2 years ago

OK, I ran yum reinstall ocsinventory-reports-2.9.1-1.el7.ocs.noarch, and now everything is working perfectly. Thanks for your help.

charleneauger commented 2 years ago

@cborivant , Ok nice ! Thanks for your report. I will take a look on the RPM package.

Best regards, Charlene