cconard96 / jamf

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

not able to get computers #61

Closed bacus99 closed 3 years ago

bacus99 commented 3 years ago

Hi,

I installed JAMF plugin on GLPI. Everything looks to be ok, but I can't retrieve computers jamf Name: JAMF Plugin for GLPI Version: 2.1.3 State: Enabled

Error:

[2020-11-26 14:46:48] glpiphplog.WARNING: *** PHP User Warning (512): Unable to extract nonce from content. It may not have been crypted with sodium functions. in /usr/share/glpi/inc/toolbox.class.php at line 293 Backtrace : inc/toolbox.class.php:293 trigger_error() marketplace/jamf/inc/connection.class.php:40 Toolbox::sodiumDecrypt() marketplace/jamf/inc/apiclassic.class.php:47 PluginJamfConnection->__construct() marketplace/jamf/inc/apiclassic.class.php:192 PluginJamfAPIClassic::get() marketplace/jamf/inc/mobilesync.class.php:646 PluginJamfAPIClassic::getItems() marketplace/jamf/inc/cron.class.php:56 PluginJamfMobileSync::discover() inc/crontask.class.php:847 PluginJamfCron::cronImportJamf() front/crontask.form.php:49 CronTask::launch()

[code]   GLPI 9.5.2 (/glpi => /usr/share/glpi) Installation mode: TARBALL

image

bacus99 commented 3 years ago

Validated with API direct access

image

cconard96 commented 3 years ago

Was this a clean install of the plugin or an upgrade? 2.1.3 fixed an issue where the password could be encrypted twice so it wasn't correct when went to the Jamf API. You should be able to go into the Jamf Plugin configuration and re-enter the password.

bacus99 commented 3 years ago

Clean installation

I updated to 9.5.3, not working Rebooting, now import works

Still an issue with sync

[2020-11-27 13:25:50] glpiphplog.CRITICAL: *** Uncaught Exception TypeError: Return value of PluginJamfMobileSync::getJamfDataForSyncingByGlpiItem() must be of the type array, null returned in /usr/share/glpi/marketplace/jamf/inc/mobilesync.class.php at line 851

cconard96 commented 3 years ago

Could you try making the changes from #62? The critical error from your last comment was caused when the plugin didn't get any data from the Jamf API. I've fixed it so in that case, the plugin handles the failure without throwing the error. I think the main issue was it was trying to get data from the mobiledevices endpoint instead of the computers endpoint.

I would also suggest opening the computer in GLPI and seeing if the "View in Jamf" button takes you to the correct computer in your Jamf server. If not, something may have gone wrong during the import.