Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-15262

Scheduler jobs of deleted (sub)wikis remain scheduled when the wiki is deleted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 10.7-rc-1, 9.11.8
    • 9.8.1
    • Scheduler
    • None
    • Easy
    • N/A
    • N/A

    Description

      Apparently, on a 9.8.1 version, after deleting a subwiki we still have stacktraces of notifications email scheduler jobs in the logs:

          ERROR .HibernateDataMigrationManager - The empty database mysubwiki seems to be not writable, please check your configuration!
      com.xpn.xwiki.store.migration.DataMigrationException: Unable to update schema of wiki [mysubwiki]
              at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:182)
              at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.initializeEmptyDB(HibernateDataMigrationManager.java:142)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initNewDB(AbstractDataMigrationManager.java:445)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.initializeCurrentDatabase(AbstractDataMigrationManager.java:550)
              at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:533)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.setDatabase(XWikiHibernateBaseStore.java:765)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:942)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:873)
              at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:866)
              at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:280)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1819)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1860)
              at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseObject(AbstractXWikiPreferencesConfigurationSource.java:86)
              at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:139)
              at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:156)
              at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.getPropertyValue(AbstractDocumentConfigurationSource.java:313)
              at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.containsKey(AbstractDocumentConfigurationSource.java:192)
              at org.xwiki.configuration.internal.AbstractSpacesConfigurationSource$SpaceConfigurationSource.containsKey(AbstractSpacesConfigurationSource.java:172)
              at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.containsKey(AbstractCompositeConfigurationSource.java:45)
              at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.containsKey(AbstractCompositeConfigurationSource.java:45)
              at org.xwiki.configuration.internal.AbstractCompositeConfigurationSource.getProperty(AbstractCompositeConfigurationSource.java:95)
              at org.xwiki.notifications.internal.DefaultNotificationConfiguration.isEnabled(DefaultNotificationConfiguration.java:47)
              at org.xwiki.notifications.notifiers.internal.email.NotificationEmailJob.executeJob(NotificationEmailJob.java:58)
              at com.xpn.xwiki.plugin.scheduler.AbstractJob.execute(AbstractJob.java:76)
              at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
              at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
      Caused by: org.hibernate.HibernateException: Failed updating schema while executing query [create table mysubwiki.activitystream_events (ase_eventid varchar(48) not null, ase_requestid varchar(48), ase_stream varchar(255), ase_date timestamp, ase_priority int4, ase_type varchar(255), ase_application varchar(255), ase_user varchar(255), ase_wiki varchar(255), ase_space varchar(255), ase_page varchar(255), ase_hidden bool, ase_url varchar(2000), ase_title varchar(2000), ase_body varchar(2000), ase_version varchar(30), ase_param1 varchar(2000), ase_param2 varchar(2000), ase_param3 varchar(2000), ase_param4 varchar(2000), ase_param5 varchar(2000), primary key (ase_eventid))]
          stream_events (ase_eventid varchar(48) not null, ase_requestid varchar(48), ase_stream varchar(255), ase_date timestamp, ase_priority int4, ase_type varchar(255), ase_application varchar(255), ase_user varchar(255), ase_wiki varchar(255), ase_space varchar(255), ase_page varchar(255), ase_hidden bool, ase_url varchar(2000), ase_title varchar(2000), ase_body varchar(2000), ase_version varchar(30), ase_param1 varchar(2000), ase_param2 varchar(2000), ase_param3 varchar(2000), ase_param4 varchar(2000), ase_param5 varchar(2000), primary key (ase_eventid))]
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:652)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:393)
              at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.hibernateShemaUpdate(HibernateDataMigrationManager.java:198)
              at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.updateSchema(HibernateDataMigrationManager.java:179)
              ... 25 common frames omitted
      Caused by: org.postgresql.util.PSQLException: ERROR: schema "mysubwiki" does not exist
              at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
              at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
              at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
              at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
              at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
              at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
              at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
              at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
              at org.postgresql.jdbc.PgStatement.executeUpdate(PgStatement.java:244)
              at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234)
              at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(DelegatingStatement.java:234)
              at com.xpn.xwiki.store.XWikiHibernateBaseStore.updateSchema(XWikiHibernateBaseStore.java:648)
              ... 28 common frames omitted
      2018-05-04 13:00:01,453 [DefaultQuartzScheduler_Worker-6] ERROR PreferencesConfigurationSource - Failed to access configuration property
      com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document [mysubwiki:Scheduler.WebPreferences]
              at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:993)
              at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:280)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1819)
              at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1860)
              at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseObject(AbstractXWikiPreferencesConfigurationSource.java:86)
              at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:139)
              at org.xwiki.configuration.internal.AbstractXWikiPreferencesConfigurationSource.getBaseProperty(AbstractXWikiPreferencesConfigurationSource.java:156)
              at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.getPropertyValue(AbstractDocumentConfigurationSource.java:313)
              at org.xwiki.configuration.internal.AbstractDocumentConfigurationSource.containsKey(AbstractDocumentConfigurationSource.java:192)
              at org.xwiki.configuration.internal.AbstractSpacesConfigurationSource$SpaceConfigurationSource.containsKey(AbstractSpacesConfigurationSource.java:172)
      

      This means that the scheduler job is still running after the subwiki was deleted. I would have expected it to stop.

      Also, I did a test with a custom scheduler job and the behaviour is the same, so it seems to be a generic scheduler job issue.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              lucaa Anca Luca
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: