My Oracle Support Banner

How to solve an GFv3 pkg Toolkit AttributeError: 'NoneType' Object Has No Attribute 'encode' (Doc ID 1496207.1)

Last updated on JULY 31, 2018

Applies to:

Oracle GlassFish Server - Version 3.0.1 to 3.1.2 [Release 3.0 to 3.1]
Information in this document applies to any platform.

Goal

The Goal is to resolve the error message: "AttributeError: 'NoneType' object has no attribute 'encode' " that is observed when trying to execute the Glassfish pkg toolkit command.

For example when we try to set a new publisher, or try to list existing publishers, an error stack can be seen like

$ ./pkg -R /opt/GFv31-fcs set-publisher -Pe -O http://localhost:6666 release.glassfish.localhost
Traceback (most recent call last):
  File "/opt/GFv31-fcs/pkg/bin/client.py", line 2621, in handle_errors
  __ret = func(*args, **kwargs)
  File "/opt/GFv31-fcs/pkg/bin/client.py", line 2577, in main_func
  return publisher_set(img, mydir, pargs)
  File "/opt/GFv31-fcs/pkg/bin/client.py", line 1823, in publisher_set
  refresh_allowed=refresh_catalogs)
  File "/opt/GFv31-fcs/pkg/vendor-packages/pkg/client/api.py", line 1231, in add_publisher
  progtrack=self.__progresstracker)
  File "/opt/GFv31-fcs/pkg/vendor-packages/pkg/client/image.py", line 592, in add_publisher
  self.save_config()
  File "/opt/GFv31-fcs/pkg/vendor-packages/pkg/client/image.py", line 272, in save_config
  self.cfg_cache.write(self.imgdir)
  File "/opt/GFv31-fcs/pkg/vendor-packages/pkg/client/imageconfig.py", line 236, in write
  props[p].encode("utf-8"))
AttributeError: 'NoneType' object has no attribute 'encode'

 

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.