glpi-project / glpi-inventory-plugin

GLPI Inventory plugin
GNU Affero General Public License v3.0
46 stars 27 forks source link

GLPI Inventory 1.2.2 : Error sql when i click on the task automatic "cleantaskjob" #375

Closed steph461 closed 1 year ago

steph461 commented 1 year ago

Describe the bug

hello,

I have errors that repeat randomly this task "cleantaskjob"generate this errors When I click execute, the task cleantaskjob generate errors image


[2023-07-09 19:27:02] glpisqllog.WARNING: DBmysql::query() in /var/www/html/glpi/src/DBmysql.php line 419
  *** MySQL query warnings:
  SQL: SELECT * FROM `glpi_plugin_glpiinventory_taskjoblogs` WHERE `state` IN ('finished', 'cancelled') AND `date` < DATE_ADD(NOW(), INTERVAL -1 DAY) GROUP BY `plugin_glpiinventory_taskjobstates_id`
  Warnings: 
1292: Truncated incorrect DECIMAL value: 'finished'
1292: Truncated incorrect DECIMAL value: 'cancelled'
  Backtrace :
  src/DBmysqlIterator.php:112                        
  src/DBmysql.php:1078                               DBmysqlIterator->execute()
  ...ce/glpiinventory/inc/taskjobstate.class.php:573 DBmysql->request()
  src/CronTask.php:1018                              PluginGlpiinventoryTaskjobstate::cronCleantaskjob()
  front/cron.php:83                                  CronTask::launch()
  {"user":"@srv-glpi"} 
[2023-07-11 10:49:01] glpisqllog.WARNING: DBmysql::query() in /var/www/html/glpi/src/DBmysql.php line 419
  *** MySQL query warnings:
  SQL: SELECT * FROM `glpi_plugin_glpiinventory_taskjoblogs` WHERE `state` IN ('finished', 'cancelled') AND `date` < DATE_ADD(NOW(), INTERVAL -1 DAY) GROUP BY `plugin_glpiinventory_taskjobstates_id`
  Warnings: 
1292: Truncated incorrect DECIMAL value: 'finished'
1292: Truncated incorrect DECIMAL value: 'cancelled'
  Backtrace :
  src/DBmysqlIterator.php:112                        
  src/DBmysql.php:1078                               DBmysqlIterator->execute()
  ...ce/glpiinventory/inc/taskjobstate.class.php:573 DBmysql->request()
  src/CronTask.php:1018                              PluginGlpiinventoryTaskjobstate::cronCleantaskjob()
  front/cron.php:83                                  CronTask::launch()
  {"user":"@srv-glpi"} 
[2023-07-11 11:32:44] glpisqllog.WARNING: DBmysql::query() in /var/www/html/glpi/src/DBmysql.php line 419
  *** MySQL query warnings:
  SQL: SELECT * FROM `glpi_plugin_glpiinventory_taskjoblogs` WHERE `state` IN ('finished', 'cancelled') AND `date` < DATE_ADD(NOW(), INTERVAL -1 DAY) GROUP BY `plugin_glpiinventory_taskjobstates_id`
  Warnings: 
1292: Truncated incorrect DECIMAL value: 'finished'
1292: Truncated incorrect DECIMAL value: 'cancelled'
  Backtrace :
  src/DBmysqlIterator.php:112                        
  src/DBmysql.php:1078                               DBmysqlIterator->execute()
  ...ce/glpiinventory/inc/taskjobstate.class.php:573 DBmysql->request()
  src/CronTask.php:1018                              PluginGlpiinventoryTaskjobstate::cronCleantaskjob()
  front/crontask.form.php:52                         CronTask::launch()
  {"user":"7@srv-glpi"} 
[2023-07-11 11:33:16] glpisqllog.WARNING: DBmysql::query() in /var/www/html/glpi/src/DBmysql.php line 419
  *** MySQL query warnings:
  SQL: SELECT * FROM `glpi_plugin_glpiinventory_taskjoblogs` WHERE `state` IN ('finished', 'cancelled') AND `date` < DATE_ADD(NOW(), INTERVAL -1 DAY) GROUP BY `plugin_glpiinventory_taskjobstates_id`
  Warnings: 
1292: Truncated incorrect DECIMAL value: 'finished'
1292: Truncated incorrect DECIMAL value: 'cancelled'
  Backtrace :
  src/DBmysqlIterator.php:112                        
  src/DBmysql.php:1078                               DBmysqlIterator->execute()
  ...ce/glpiinventory/inc/taskjobstate.class.php:573 DBmysql->request()
  src/CronTask.php:1018                              PluginGlpiinventoryTaskjobstate::cronCleantaskjob()
  front/crontask.form.php:52                         CronTask::launch()
  {"user":"7@srv-glpi"} 

version : GLPI 10.0.0.8 + glpi inventory 1.2.2

### To reproduce

1 . "Automatic action"
2 . "cleantaskjob"
3 .  "execute"

### Expected behavior

.

### Operating system

Linux

### GLPI Agent version

Other (See additional context below)

### GLPI version

Other (See additional context below)

### GLPIInventory plugin

Other (See additional context below)

### Additional context

.
stonebuzz commented 1 year ago

Hi @steph461

can you check / test this -> https://github.com/glpi-project/glpi-inventory-plugin/pull/376

Best regards

steph461 commented 1 year ago

@stonebuzz

its OK Fix ok

stonebuzz commented 1 year ago

:+1: