Bug #25220

Plugin removal can cause Settings to fail transactions

Added by Daniel Kimsey over 3 years ago. Updated over 3 years ago.

Web UI
Target version:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:


Katello 3.7.1, unable to load any Katello-related pages.

With stbenjam's help, we were able to determine it was related to the fact that in 3.5 I removed the abrt plugin (it was preventing the server from starting).

# foreman-rake console
> Setting.where(type: 'Setting::Abrt').all
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Setting::Abrt'. This error is raised because the column 'category' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.

This prevented all plugins from being able to load their respective settings.rb files.

There were no errors anywhere about the failed transactions.

Manual fix:

# foreman-rake console
> class Setting::Abrt < Setting; end; Setting.where(category: 'Setting::Abrt').destroy_all

Original issue

I noticed this when I was unable to load any Katello-related pages due to a JS console error:

caught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.fromJson (bastion-33c698dac5026546914c998f2897ddcd66f098082bc57dbe12d6e12585d6beb9.js:18056)
    at content_hosts:41

    <script src="/javascripts/bastion/angular-i18n/angular-locale_en.js"></script>
  <script type="text/javascript">
    angular.module('Bastion.features').value('FeatureSettings', angular.fromJson({}));
    angular.module('Bastion').value('currentLocale', 'en');
    angular.module('Bastion').value('CurrentOrganization', "1");
    angular.module('Bastion').value('contentAccessMode', "entitlement");
    angular.module('Bastion').value('foreman', tfm);
    angular.module('Bastion').value('repositoryTypes', angular.fromJson('[{"id":"deb","name":"deb","creatable":true},{"id":"docker","name":"docker","creatable":true},{"id":"file","name":"file","creatable":true},{"id":"puppet","name":"puppet","creatable":true},{"id":"yum","name":"yum","creatable":true}]'));
    angular.module('Bastion').value('deleteHostOnUnregister', angular.fromJson('false'));
    angular.module('Bastion').value('contentDisconnected', angular.fromJson(''));     /* <======== suspect line 41 */
    angular.module('Bastion').value('entriesPerPage', "200");
    angular.module('Bastion').constant('BastionConfig', angular.fromJson('{"markTranslated":false,"relativeUrlRoot":"/","consumerCertRPM":"katello-ca-consumer-latest.noarch.rpm","defaultDownloadPolicy":"immediate","remoteExecutionPresent":true,"remoteExecutionByDefault":false}'));
    angular.module('Bastion.auth').value('CurrentUser', {
        id: 4,
        admin: true
    angular.module('Bastion.auth').value('Permissions', angular.fromJson('[{"permission":{"id":10,"name":"view_bookmarks","resource_type":"Bookmark","created_at":"2016-09-27T14:40:25.175-05:00","updated_at":"2016-09-27T14:40:25.175-05:00"}},{"permission":{"id":153,"name":"view_tasks","resource_type":null,"created_at":"2016-09-27T14:40:26.165-05:00","updated_at":"2016-09-27T14:40:26.165-05:00"}},{"permission":{"id":167,"name":"view_foreman_tasks","resource_type":"ForemanTasks::Task","created_at":"2016-09-27T14:40:41.797-05:00","updated_at":"2016-09-27T14:40:41.797-05:00"}}]'));
    <script src="/assets/bastion_katello/bastion_katello-5f2a8f317a9030f9ca849f5d881e529953e908fc5e10d41407d00e8c875e00c6.js"></script>

Related issues

Is duplicate of Foreman - Bug #8272: Plugins don't cleanup after themselves during uninstallationNew


#1 Updated by Daniel Kimsey over 3 years ago

  • Subject changed from SyntaxError due to to js SyntaxError due to empty value for contentDisconnected

#2 Updated by Daniel Kimsey over 3 years ago

  • Description updated (diff)
  • Subject changed from js SyntaxError due to empty value for contentDisconnected to Plugin removal can cause Settings to fail transactions

#3 Updated by Stephen Benjamin over 3 years ago

  • Triaged changed from No to Yes
  • Status changed from New to Duplicate

I think this is really tied to the fact you can't uninstall a plugin, there's not much we can do if the Settings table has STI that's no longer valid - going to mark it a dupe of #8272.

#4 Updated by Stephen Benjamin over 3 years ago

  • Is duplicate of Bug #8272: Plugins don't cleanup after themselves during uninstallation added

Also available in: Atom PDF