java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

Atlassian JIRA | Juan Palacios [Atlassian] | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    This is issue is seen when there are over 1000 rows in the {{REJECTED_REF}} table associated with the repository. When fork synching is disabled Bitbucket Server attempts to clean up the table. The {{DELETE}} query uses an {{IN}} clause which in Oracle cannot contain more than 1000 literal values. {code} java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000 at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.delete(EntityManagedActiveObjects.java:137) ~[na:na] at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.delete(TenantAwareActiveObjects.java:311) ~[na:na] at com.atlassian.stash.internal.repository.sync.dao.AoRefSyncDao.removeRefs(AoRefSyncDao.java:182) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.dao.AoRefSyncDao.setEnabled(AoRefSyncDao.java:95) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation$1.execute(DefaultRefSyncService.java:550) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation$1.execute(DefaultRefSyncService.java:546) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.ao.AbstractAoTransactionCallback.doInTransaction(AbstractAoTransactionCallback.java:21) ~[stash-ao-common-3.7.4.jar:na] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25) ~[sal-core-2.13.3.jar:na] at com.atlassian.stash.internal.sal.spi.HostContextAccessorImpl.doInTransaction(HostContextAccessorImpl.java:27) ~[stash-platform-3.7.4.jar:na] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21) ~[sal-core-2.13.3.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation.perform(DefaultRefSyncService.java:546) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation.perform(DefaultRefSyncService.java:532) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.util.TimerUtils.time(TimerUtils.java:54) ~[stash-util-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService.time(DefaultRefSyncService.java:300) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService.setEnabled(DefaultRefSyncService.java:218) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.rest.RefSyncResource.setEnabled(RefSyncResource.java:131) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) [applinks-plugin-4.3.5_1430737142000.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86) [StashAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) [atlassian-trusted-apps-core-3.0.8.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) [atlassian-oauth-service-provider-plugin-1.9.10_1430737142000.jar:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:32) [analytics-client-3.56_1430741586000.jar:na] at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) [analytics-client-3.56_1430741586000.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:89) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:85) [stash-service-impl-3.7.4.jar:na] at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) [ConfigurableWebFilter.class:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0] at java.lang.Thread.run(Thread.java:722) [na:1.7.0] ... 273 frames trimmed {code}

    Atlassian JIRA | 1 year ago | Juan Palacios [Atlassian]
    java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000
  2. 0

    This is issue is seen when there are over 1000 rows in the {{REJECTED_REF}} table associated with the repository. When fork synching is disabled Bitbucket Server attempts to clean up the table. The {{DELETE}} query uses an {{IN}} clause which in Oracle cannot contain more than 1000 literal values. {code} java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000 at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.delete(EntityManagedActiveObjects.java:137) ~[na:na] at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.delete(TenantAwareActiveObjects.java:311) ~[na:na] at com.atlassian.stash.internal.repository.sync.dao.AoRefSyncDao.removeRefs(AoRefSyncDao.java:182) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.dao.AoRefSyncDao.setEnabled(AoRefSyncDao.java:95) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation$1.execute(DefaultRefSyncService.java:550) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation$1.execute(DefaultRefSyncService.java:546) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.ao.AbstractAoTransactionCallback.doInTransaction(AbstractAoTransactionCallback.java:21) ~[stash-ao-common-3.7.4.jar:na] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25) ~[sal-core-2.13.3.jar:na] at com.atlassian.stash.internal.sal.spi.HostContextAccessorImpl.doInTransaction(HostContextAccessorImpl.java:27) ~[stash-platform-3.7.4.jar:na] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21) ~[sal-core-2.13.3.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation.perform(DefaultRefSyncService.java:546) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation.perform(DefaultRefSyncService.java:532) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.util.TimerUtils.time(TimerUtils.java:54) ~[stash-util-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService.time(DefaultRefSyncService.java:300) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.DefaultRefSyncService.setEnabled(DefaultRefSyncService.java:218) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.stash.internal.repository.sync.rest.RefSyncResource.setEnabled(RefSyncResource.java:131) ~[stash-repository-ref-sync-3.7.4.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) [applinks-plugin-4.3.5_1430737142000.jar:na] at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86) [StashAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) [atlassian-trusted-apps-core-3.0.8.jar:na] at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) [atlassian-oauth-service-provider-plugin-1.9.10_1430737142000.jar:na] at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:32) [analytics-client-3.56_1430741586000.jar:na] at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) [analytics-client-3.56_1430741586000.jar:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:89) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [BeforeLoginPluginAuthenticationFilter.class:na] at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:85) [stash-service-impl-3.7.4.jar:na] at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) [ConfigurableWebFilter.class:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0] at java.lang.Thread.run(Thread.java:722) [na:1.7.0] ... 273 frames trimmed {code}

    Atlassian JIRA | 1 year ago | Juan Palacios [Atlassian]
    java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

    Root Cause Analysis

    1. java.sql.SQLSyntaxErrorException

      ORA-01795: maximum number of expressions in a list is 1000

      at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.delete()
    2. com.atlassian.activeobjects
      TenantAwareActiveObjects.delete
      1. com.atlassian.activeobjects.internal.EntityManagedActiveObjects.delete(EntityManagedActiveObjects.java:137)[na:na]
      2. com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.delete(TenantAwareActiveObjects.java:311)[na:na]
      2 frames
    3. com.atlassian.stash
      AbstractAoTransactionCallback.doInTransaction
      1. com.atlassian.stash.internal.repository.sync.dao.AoRefSyncDao.removeRefs(AoRefSyncDao.java:182)[stash-repository-ref-sync-3.7.4.jar:na]
      2. com.atlassian.stash.internal.repository.sync.dao.AoRefSyncDao.setEnabled(AoRefSyncDao.java:95)[stash-repository-ref-sync-3.7.4.jar:na]
      3. com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation$1.execute(DefaultRefSyncService.java:550)[stash-repository-ref-sync-3.7.4.jar:na]
      4. com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation$1.execute(DefaultRefSyncService.java:546)[stash-repository-ref-sync-3.7.4.jar:na]
      5. com.atlassian.stash.ao.AbstractAoTransactionCallback.doInTransaction(AbstractAoTransactionCallback.java:21)[stash-ao-common-3.7.4.jar:na]
      5 frames
    4. com.atlassian.sal
      HostContextTransactionTemplate$1.doInTransaction
      1. com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25)[sal-core-2.13.3.jar:na]
      1 frame
    5. com.atlassian.stash
      HostContextAccessorImpl.doInTransaction
      1. com.atlassian.stash.internal.sal.spi.HostContextAccessorImpl.doInTransaction(HostContextAccessorImpl.java:27)[stash-platform-3.7.4.jar:na]
      1 frame
    6. com.atlassian.sal
      HostContextTransactionTemplate.execute
      1. com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21)[sal-core-2.13.3.jar:na]
      1 frame
    7. com.atlassian.stash
      RefSyncResource.setEnabled
      1. com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation.perform(DefaultRefSyncService.java:546)[stash-repository-ref-sync-3.7.4.jar:na]
      2. com.atlassian.stash.internal.repository.sync.DefaultRefSyncService$SetEnabledAndSynchronizeOperation.perform(DefaultRefSyncService.java:532)[stash-repository-ref-sync-3.7.4.jar:na]
      3. com.atlassian.stash.util.TimerUtils.time(TimerUtils.java:54)[stash-util-3.7.4.jar:na]
      4. com.atlassian.stash.internal.repository.sync.DefaultRefSyncService.time(DefaultRefSyncService.java:300)[stash-repository-ref-sync-3.7.4.jar:na]
      5. com.atlassian.stash.internal.repository.sync.DefaultRefSyncService.setEnabled(DefaultRefSyncService.java:218)[stash-repository-ref-sync-3.7.4.jar:na]
      6. com.atlassian.stash.internal.repository.sync.rest.RefSyncResource.setEnabled(RefSyncResource.java:131)[stash-repository-ref-sync-3.7.4.jar:na]
      6 frames
    8. com.atlassian.applinks
      ContextFilter.doFilter
      1. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25)[applinks-plugin-4.3.5_1430737142000.jar:na]
      1 frame
    9. com.atlassian.stash
      BeforeLoginPluginAuthenticationFilter.doFilter
      1. com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:86)[StashAuthenticationFilter.class:na]
      2. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:111)[BeforeLoginPluginAuthenticationFilter.class:na]
      3. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:77)[BeforeLoginPluginAuthenticationFilter.class:na]
      3 frames
    10. com.atlassian.security
      TrustedApplicationsFilter.doFilter
      1. com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100)[atlassian-trusted-apps-core-3.0.8.jar:na]
      1 frame
    11. com.atlassian.oauth
      OAuthFilter.doFilter
      1. com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79)[atlassian-oauth-service-provider-plugin-1.9.10_1430737142000.jar:na]
      1 frame
    12. com.atlassian.analytics
      AbstractHttpFilter.doFilter
      1. com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:32)[analytics-client-3.56_1430741586000.jar:na]
      2. com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32)[analytics-client-3.56_1430741586000.jar:na]
      2 frames
    13. com.atlassian.stash
      ConfigurableWebFilter.doFilter
      1. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:89)[BeforeLoginPluginAuthenticationFilter.class:na]
      2. com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)[BeforeLoginPluginAuthenticationFilter.class:na]
      3. com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:85)[stash-service-impl-3.7.4.jar:na]
      4. com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)[ConfigurableWebFilter.class:na]
      4 frames
    14. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[na:1.7.0]
      2. java.lang.Thread.run(Thread.java:722)[na:1.7.0]
      2 frames