jssimporter / Spruce

Spruce is deprecated. Please see the wiki for alternatives.
GNU General Public License v3.0
148 stars 22 forks source link

Receiving "Instances of 'NoneType'" error message when running spruce #54

Open ghost opened 3 years ago

ghost commented 3 years ago

I am also getting errors when running jss_helper as well that seem like they may be related to this.

When I run spruce, here is the output I receive:

lcacioppo@CSI361362 Desktop % /usr/local/autopkg/python ~/Desktop/spruce.py   
JSS: https://jamf-pro-url:8443
Preferences used: ~/Library/Preferences/com.github.autopkg.plist
*  Building: Computer Report... *
Traceback (most recent call last):
  File "/Users/lcacioppo/Desktop/spruce.py", line 2436, in <module>
    main()
  File "/Users/lcacioppo/Desktop/spruce.py", line 2432, in main
    run_reports(args)
  File "/Users/lcacioppo/Desktop/spruce.py", line 2187, in run_reports
    results.append(func(**args_dict))
  File "/Users/lcacioppo/Desktop/spruce.py", line 650, in build_computers_report
    report = build_device_report(check_in_period, all_computers)
  File "/Users/lcacioppo/Desktop/spruce.py", line 448, in build_device_report
    ) = get_version_and_model_spread(devices)
  File "/Users/lcacioppo/Desktop/spruce.py", line 601, in get_version_and_model_spread
    strings = sorted(get_histogram_strings(model_counts, padding=8), key=model_compare)
TypeError: '<' not supported between instances of 'NoneType' and 'str'
grahampugh commented 3 years ago

Just for completeness, can I check that you have given the additional permissions to your API user that Spruce requires?

For complete reporting, the API user will need at least Read privileges on the following (along with the required API permissions for JSSImporter):

Computers Configurations eBooks macOS Configuration Profiles Mobile Devices Mobile Device Apps Mobile Device Configuration Profiles Printers Provisioning Profiles Smart Mobile Device Groups Static Mobile Device Groups

ghost commented 3 years ago

Yes, I just went through and validated now that Read permissions for each of those items is checkmarked

bjohnson-MHC commented 3 years ago

I'm also experiencing this issue since the last time I ran Spruce (in January of this year). Running the script from a computer on 10.14.6 with known-good AutoPkg.plist to a JSS on 10.26.1 Worked fine in January. Now barfs with the same error output as above, except my line numbers differ. May 4, 2020 is the date on the spruce.py.