cconard96 / jamf

JAMF Plugin for GLPI
GNU General Public License v2.0
6 stars 5 forks source link

Unable to save discovered computers #104

Closed marekpierog closed 2 years ago

marekpierog commented 2 years ago

This problem appears only while discovering computers (not phones): [2022-05-19 09:35:02] glpisqllog.ERROR: DBmysql::query() in /var/www/html/src/DBmysql.php line 368 * MySQL query error: SQL: INSERT INTO glpi_plugin_jamf_imports (jamf_type, jamf_items_id, name, type, date_discover) VALUES ('Computer', '10', 'MacBook-Pro-bar****', 'Computer', '2022-05-19 09:35:00') Error: Field 'udid' doesn't have a default value Backtrace : src/DBmysql.php:1310 marketplace/jamf/inc/computersync.class.php:572 DBmysql->insert() marketplace/jamf/inc/cron.class.php:56 PluginJamfComputerSync::discover() src/CronTask.php:1016 PluginJamfCron::cronImportJamf() marketplace/jamf/ajax/cron.php:50 CronTask::launch() {"user":"7@glpi","mem_usage":"0.000\", 2.05Mio)"}

GLPI: 10.0.0 Plugin: 3.0.0 PHP: 8.1.2 mySQL: 8.0.29 OS: Ubuntu 22.04 LTS JAMF: Cloud 10.38.1-t1652212473

cconard96 commented 2 years ago

Should be fixed by #106

marekpierog commented 2 years ago

Unfortunately this fix causes some problems afterwards: [2022-05-24 12:32:29] glpisqllog.ERROR: DBmysql::query() in /var/www/html/src/DBmysql.php line 368 * MySQL query error: SQL: INSERT INTO glpi_plugin_jamf_imports (jamf_type, jamf_items_id, name, type, date_discover) VALUES ('Computer', '16', 'MacBook-Air-***', 'Computer', '2022-05-24 12:32:28') Error: Duplicate entry '16-Computer' for key 'glpi_plugin_jamf_imports.unicity' Backtrace : src/DBmysql.php:1310 marketplace/jamf/inc/computersync.class.php:572 DBmysql->insert() marketplace/jamf/inc/cron.class.php:56 PluginJamfComputerSync::discover() src/CronTask.php:1016 PluginJamfCron::cronImportJamf() marketplace/jamf/ajax/cron.php:50 CronTask::launch() {"user":"7@glpi","mem_usage":"0.003\", 2.43Mio)"}

cconard96 commented 2 years ago

I'm not able to recreate the new issue. Can you try clearing the pending imports using the button on the Import screen and re-discovering the devices?

cconard96 commented 2 years ago

No feedback for a while. v3.0.1 was just released with a bunch of fixes, so I would recommend trying to update to that version. If the issue is still present in the new version, please let me know and I will reopen this.