ninxsoft / Kmart

A Mac command-line tool that generates kick-ass Jamf Pro reports.
MIT License
136 stars 10 forks source link

The data couldn’t be read because it isn’t in the correct format #26

Closed TheFritz01 closed 3 months ago

TheFritz01 commented 1 year ago

Under Jamf 10.45 multiple endpoints are returning the error "The data couldn’t be read because it isn’t in the correct format" While I haven't tested every endpoint the following are failing for me when running on macOS 13.3.1.

Edit I should note that other endpoints are working just fine assuming they aren't cross referencing any of the non-working endpoints. For example the macPackages endpoint works without issue when looking for unlinked packages.

ninxsoft commented 1 year ago

Hi @TheFritz01, I can confirm the endpoints are loading correctly for me with my Kmart test account:

➜ kmart --yaml ~/Desktop/kmart.yaml
┌───────────────────────────────────┐
│ RETRIEVING JAMF PRO API ENDPOINTS │
└───────────────────────────────────┘
  ├─ Buildings........................... 2.8 seconds [     1 / 1     (100.0%) ]
  ├─ Categories.......................... 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Departments......................... 0.7 seconds [     1 / 1     (100.0%) ]
  ├─ eBooks.............................. 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ iBeacons............................ 0.3 seconds [     0 / 0     (00.00%) ]
  ├─ Mac Advanced Searches............... 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Applications.................... 0.7 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Configuration Profiles.......... 0.2 seconds [     0 / 0     (00.00%) ]
  ├─ Mac Devices......................... 0.3 seconds [     0 / 0     (00.00%) ]
  ├─ Mac Devices History................. 0.3 seconds [     0 / 0     (00.00%) ]
  ├─ Mac Directory Bindings.............. 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Disk Encryptions................ 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Dock Items...................... 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Extension Attributes............ 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Groups.......................... 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Packages........................ 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Patch Policies.................. 0.3 seconds [     0 / 0     (00.00%) ]
  ├─ Mac Patch Software Titles........... 0.7 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Policies........................ 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Printers........................ 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Restricted Software............. 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mac Scripts......................... 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mobile Advanced Searches............ 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mobile Applications................. 0.3 seconds [     0 / 0     (00.00%) ]
  ├─ Mobile Configuration Profiles....... 0.2 seconds [     0 / 0     (00.00%) ]
  ├─ Mobile Devices...................... 0.3 seconds [     0 / 0     (00.00%) ]
  ├─ Mobile Extension Attributes......... 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Mobile Groups....................... 0.6 seconds [     1 / 1     (100.0%) ]
  ├─ Network Segments.................... 0.2 seconds [     0 / 0     (00.00%) ]
  ├─ Total Time: 16.7 seconds
...

That being said, I can replicate the issue you are describing when:

Are you able to please confirm the Read permissions are set correctly for your Kmart user account? You can find the full list of Privileges in the Kmart README

If everything looks good there, next step would probably be to confirm you can access the Jamf Pro Classic API via another method, eg. cURL or Postman, to help rule out if it's permissions / access related or something specific to Kmart.

Thanks 👍

ninxsoft commented 1 year ago

Another thing worth considering is the Account Lockout setting, as part of the Password policy set in Jamf Pro:

Account Lockout

Having a lockout value set will also cause the error output you have described (after X failed API attempts) - might be worth confirming your Kmart user account has not been locked by Jamf Pro.

ninxsoft commented 3 months ago

Closing due to inactivity. Will re-open if required 👍