Pivotal Knowledge Base

Follow

Fails to Start a Cache Member with "org.apache.geode.pdx.PdxInitializationException: Could not create pdx registry"

Environment

Pivotal GemFire 9.4

Symptom

With GemFire 9.4, using the cluster configuration service, configuring a cache node with a custom (non-default) PDX disk store in a local cache.xml file, such as:

  :
<disk-store name="pdxData">
  <disk-dirs>
    <disk-dir>/path/to/pdx_data</disk-dir>
  </disk-dirs>
</disk-store>
<pdx read-serialized="true" persistent="true" disk-store-name="pdxData">
:

will cause the node to fail to come up and give the following exception:

Exception in thread "main" org.apache.geode.pdx.PdxInitializationException: Could not create pdx registry

	at org.apache.geode.pdx.internal.PeerTypeRegistration.initialize(PeerTypeRegistration.java:204)

	at org.apache.geode.pdx.internal.TypeRegistry.creatingDiskStore(TypeRegistry.java:275)

	at org.apache.geode.internal.cache.DiskStoreFactoryImpl.create(DiskStoreFactoryImpl.java:147)

	at org.apache.geode.internal.cache.xmlcache.CacheCreation.createDiskStore(CacheCreation.java:725)

	at org.apache.geode.internal.cache.xmlcache.CacheCreation.initializePdxDiskStore(CacheCreation.java:716)

	at org.apache.geode.internal.cache.xmlcache.CacheCreation.create(CacheCreation.java:477)

	at org.apache.geode.internal.cache.xmlcache.CacheXmlParser.create(CacheXmlParser.java:337)

	at org.apache.geode.internal.cache.GemFireCacheImpl.loadCacheXml(GemFireCacheImpl.java:4307)

	at org.apache.geode.internal.cache.GemFireCacheImpl.initializeDeclarativeCache(GemFireCacheImpl.java:1408)

	at org.apache.geode.internal.cache.GemFireCacheImpl.initialize(GemFireCacheImpl.java:1209)

	at org.apache.geode.internal.cache.GemFireCacheImpl.basicCreate(GemFireCacheImpl.java:789)

	at org.apache.geode.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:775)

	at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:177)

	at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:224)

	at org.apache.geode.distributed.internal.DefaultServerLauncherCacheProvider.createCache(DefaultServerLauncherCacheProvider.java:52)

	at org.apache.geode.distributed.ServerLauncher.createCache(ServerLauncher.java:844)

	at org.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:762)

	at org.apache.geode.distributed.ServerLauncher.run(ServerLauncher.java:692)

	at org.apache.geode.distributed.ServerLauncher.main(ServerLauncher.java:225)

Caused by: org.apache.geode.cache.RegionExistsException: /PdxTypes

	at org.apache.geode.internal.cache.GemFireCacheImpl.createVMRegion(GemFireCacheImpl.java:3002)

	at org.apache.geode.pdx.internal.PeerTypeRegistration.initialize(PeerTypeRegistration.java:198)

	... 18 more

Cause

This issue is a regression in the Cluster Configuration Service. It was introduced in the GemFire 9.4 with the addition of a new feature of Apache Geode described in GEODE-3875.

Resolution

This issue has been resolved in GemFire 9.5 with GEODE-4913 and does not occur in versions prior to GemFire 9.4.

If you cannot immediately upgrade to GemFire 9.5 (or newer), you have the following three options as workarounds to resolve this issue:

  1. Disable Cluster Configuration Service by adding the following parameter to your "gfsh start locator" command when starting your locators:
    --J=-Dgemfire.enable-cluster-configuration=false

    In this case, GemFire will not persist any changes to your cluster made using gfsh.

  2. Prevent the cache server node from using the Cluster Configuration Service by adding the following parameter to your "gfsh start server" command when starting cache servers. Configuration Service when restarting your cache servers:
    --J=-Dgemfire.use-cluster-configuration=false

    In this case, you will not be able to reload any changes made to your servers via a gfsh command from the Cluster Configuration Service when restarting.

  3. Use the default disk store to persist PDX type data without setting disk-store-name in the local cache.xml as illustrated:
    <pdx read-serialized="true" persistent="true">

Additional Information

You may face this issue even after upgrading to GemFire 9.5 (or newer) while continuing to use an existing cluster configuration created by GemFire 9.4. In this case, please shutdown locators, remove persistent files for the Cluster Configuration Service and restart your locators. Once this is done, you should be able to start your cache members without seeing this error.

Comments

Powered by Zendesk