AttributeError: 'NoneType' object has no attribute 'encode'

1,280 views
Skip to first unread message

Nick Rodriguez

unread,
Apr 21, 2015, 6:09:16 PM4/21/15
to munk...@googlegroups.com
With 3748463, I’m getting the following error using munkiimport —apple-update.  However, makepkginfo —apple-update works.


Traceback (most recent call last):
  File "/usr/local/munki/munkiimport", line 1106, in <module>
    main()
  File "/usr/local/munki/munkiimport", line 828, in main
    return_dict = FoundationPlist.readPlistFromString(return_dict)
  File "/usr/local/munki/munkilib/FoundationPlist.py", line 98, in readPlistFromString
    error = error.encode('ascii', 'ignore')
AttributeError: 'NoneType' object has no attribute ‘encode'

Nick

Gregory Neagle

unread,
Apr 21, 2015, 6:55:02 PM4/21/15
to munk...@googlegroups.com
It’s proving to be rather tricky to deal with non-ASCII text when munkiimport calls makepkginfo.

You seem to have a workaround for now.

-Greg

--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Justin Phillips

unread,
Apr 22, 2015, 7:26:00 AM4/22/15
to munk...@googlegroups.com
Come clients are getting this same error when running managedsoftwareupdate -vvv:

ERROR: Unexpected error in updatecheck:

Traceback (most recent call last):

  File "/usr/local/munki/managedsoftwareupdate", line 1038, in <module>

    main()

  File "/usr/local/munki/managedsoftwareupdate", line 734, in main

    updatecheckresult = updatecheck.check(client_id=options.id)

  File "/usr/local/munki/munkilib/updatecheck.py", line 2992, in check

    updateAvailableLicenseSeats(installinfo)

  File "/usr/local/munki/munkilib/updatecheck.py", line 1693, in updateAvailableLicenseSeats

    license_data)

  File "/usr/local/munki/munkilib/FoundationPlist.py", line 98, in readPlistFromString

    error = error.encode('ascii', 'ignore')

AttributeError: 'NoneType' object has no attribute 'encode'

Gregory Neagle

unread,
Apr 22, 2015, 9:11:35 AM4/22/15
to munk...@googlegroups.com
On Apr 22, 2015, at 4:26 AM, Justin Phillips <wuwu...@gmail.com> wrote:

Come clients are getting this same error when running managedsoftwareupdate -vvv:

ERROR: Unexpected error in updatecheck:
Traceback (most recent call last):

  File "/usr/local/munki/managedsoftwareupdate", line 1038, in <module>

    main()

  File "/usr/local/munki/managedsoftwareupdate", line 734, in main

    updatecheckresult = updatecheck.check(client_id=options.id)

  File "/usr/local/munki/munkilib/updatecheck.py", line 2992, in check

    updateAvailableLicenseSeats(installinfo)

  File "/usr/local/munki/munkilib/updatecheck.py", line 1693, in updateAvailableLicenseSeats

    license_data)

  File "/usr/local/munki/munkilib/FoundationPlist.py", line 98, in readPlistFromString

    error = error.encode('ascii', 'ignore')

AttributeError: 'NoneType' object has no attribute 'encode'



This is a two-level error:

1) An error is occurring when Munki tries to read a plist from what is returned by the server when updating available license seats. You should look into that and fix that.

2) Processing the error message itself is triggering a Python AttributeError exception. Even if Munki is fixed to not raise the AttributeError, you’ll still have the underlying error of bad license data being returned from the server. You might want to raise the LoggingLevel on an affected machine, or run managedsoftwareupdate with the -vvv options to get additional debugging detail.

-Greg

Gregory Neagle

unread,
Apr 22, 2015, 2:39:18 PM4/22/15
to munk...@googlegroups.com
I was able to reproduce a similar error when running the Work-In-Progress code, but not the most recent “release” version. What version are you running on your clients?

-Greg

On Apr 22, 2015, at 4:26 AM, Justin Phillips <wuwu...@gmail.com> wrote:

Gregory Neagle

unread,
Apr 22, 2015, 2:49:33 PM4/22/15
to munk...@googlegroups.com
If you were running 2.2.4.2462 on your clients (not recommended, not an official release version), try 2.2.4.2463.

(But thanks for surfacing an issue with that build!)

-Greg

Justin Phillips

unread,
Apr 22, 2015, 4:30:54 PM4/22/15
to munk...@googlegroups.com
The affected clients were some tests and they were on the 2.2.4.2462 build.

I looked through the items that we have licensed and found that a specific one was throwing this error. I couldn't immediately see an issue with it's plist, so I recreated it and put the license key back in. Doing so removed the error for the clients running .2462.
Reply all
Reply to author
Forward
0 new messages