System.QueryException: sObject type ‘PushTopic’ is not supported

As part of our managed package we have a post-install script that inserts push topics to support the integration between our solution and SF.

Before today this post install script worked fine. I was able to download the app from the exchange and install it into any org; everything worked as expected.

Today, I uninstalled a prior version of the app from a demo org I had spun up to prep for training the sales team and support staff on this new version. When I try to install it I get a the following from the Apex Exception email:

caused by: System.QueryException: sObject type ‘PushTopic’ is not supported.

Class.redblack.RBS_PushTopicLifeCycleManager.doInsert: line 130, column 1
Class.redblack.RBS_PostInstallScript.postPushTopics: line 28, column 1
Class.redblack.RBS_PostInstallScript.onInstall: line 21, column 1

The query I have is simply this:

[Select Id, Name,Query,APIVersion,
NotifyForOperationCreate,NotifyForOperationUpdate,NotifyForOperationUndelete,NotifyForOperationDelete,NotifyForFields
From PushTopic]

The streaming API feature is enabled via the user interface in this org, as well as the API Enabled system permission via a permission set assigned to the user performing the install (me).

The class that runs all this is configured for API version 44.0, which is the same attribute I am assigning to the push topics on create.

I don’t get it. It worked fine with the prior version yet now it won’t work. Has anyone ever run into this before?

Answer

Attribution
Source : Link , Question Author : Kevin , Answer Author : Community

Leave a Comment