org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID FROM public.cwd_membership WHERE directory_id = (select id from cwd_directory where directory_name='Remote Crowd Directory') (ERROR: more than one row returned by a subquery used as an expression)

Atlassian JIRA | Nick Mason [Atlassian] | 4 months ago
  1. 0

    h3. Steps to reproduce # Trigger a backup from the Backup Manager on a Cloud instance that has more than one "Remote Crowd Directory" in {{cwd_directory}} (i.e. it's been previously imported from a Cloud instance) h3. Expected results The backup completes with no errors. h3. Actual results The backup _does_ successfully complete but with a number of these errors in the logs: {code:none} 2016-06-27 12:13:10,813 Long running task: OnDemandBackup ERROR jashmore 733x20059x7 g6x0cn 59.167.133.100 /rest/obm/1.0/runbackup [c.a.o.backupmanager.service.BackupEntityChangesProvider] Unable to find Entity [Membership] by WhereClausule: directory_id = (select id from cwd_directory where directory_name='Remote Crowd Directory') org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID FROM public.cwd_membership WHERE directory_id = (select id from cwd_directory where directory_name='Remote Crowd Directory') (ERROR: more than one row returned by a subquery used as an expression) at org.ofbiz.core.entity.jdbc.SQLProcessor.executeQuery(SQLProcessor.java:641) at org.ofbiz.core.entity.GenericDAO.createEntityListIterator(GenericDAO.java:967) at org.ofbiz.core.entity.GenericDAO.selectListIteratorByCondition(GenericDAO.java:883) at org.ofbiz.core.entity.GenericDAO.selectByCondition(GenericDAO.java:798) at org.ofbiz.core.entity.GenericDAO.selectByCondition(GenericDAO.java:777) at org.ofbiz.core.entity.GenericHelperDAO.findByCondition(GenericHelperDAO.java:178) at org.ofbiz.core.entity.GenericDelegator.findByCondition(GenericDelegator.java:1085) at com.atlassian.ondemand.backupmanager.service.BackupEntityChangesProvider.findEntityIds(BackupEntityChangesProvider.java:215) at com.atlassian.ondemand.backupmanager.service.BackupEntityChangesProvider.parseBackupEntityChange(BackupEntityChangesProvider.java:194) at com.atlassian.ondemand.backupmanager.service.BackupEntityChangesProvider.loadFromXml(BackupEntityChangesProvider.java:153) at com.atlassian.ondemand.backupmanager.service.BackupEntityChangesProvider.<init>(BackupEntityChangesProvider.java:56) at com.atlassian.ondemand.backupmanager.service.JiraBackupService.backup(JiraBackupService.java:125) at com.atlassian.ondemand.backupmanager.rest.OnDemandBackupTask.run(OnDemandBackupTask.java:84) at com.atlassian.ondemand.backupmanager.longrunning.ManagedTask.run(ManagedTask.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.postgresql.util.PSQLException: ERROR: more than one row returned by a subquery used as an expression at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417) at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:82) at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:82) at org.ofbiz.core.entity.jdbc.SQLProcessor.executeQuery(SQLProcessor.java:633) ... 18 more {code} h3. Notes From [~mlassau]: {quote} It is running an invalid SQL query: {code} SELECT ID FROM public.cwd_membership WHERE directory_id = (select id from cwd_directory where directory_name='Remote Crowd Directory') {code} The problem is the inner query: it is finding more than one row in cwd_directory that is a Remote Crowd directory. This would make sense if you eg import data from server that already had a Remote Crowd Directory because JIRA OD will add another one during import and deactivate all previous user directories. The query should be looking for the one and only directory that is active. It should maybe even do some "integrity checking" up front. {quote}

    Atlassian JIRA | 4 months ago | Nick Mason [Atlassian]
    org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT ID FROM public.cwd_membership WHERE directory_id = (select id from cwd_directory where directory_name='Remote Crowd Directory') (ERROR: more than one row returned by a subquery used as an expression)
  2. 0

    Unable to migrate a structure using bundles

    GitHub | 3 years ago | wezell
    org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "idx_field_velocity_structure"
  3. 0

    [Hive]I got "ArrayIndexOutOfBoundsException" while I query the hive database

    Stack Overflow | 3 years ago | CK Chang
    org.postgresql.util.PSQLException: ERROR: relation "partitions" does not exist
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 47#95927784

    GitHub | 2 years ago | Argelein
    play.api.Application$$anon$1: Execution exception[[PSQLException: ╬╪╚┴╩└: яютЄюЁ ■∙ххё  чэрўхэшх ъы■ўр эрЁє°рхЄ юуЁрэшўхэшх єэшъры№эюёЄш "idx_pass_uq" Detail: ╩ы■ў "(pass)=(345345)" єцх ёє∙хёЄтєхЄ.]]
  6. 0

    [Hive]I got “ArrayIndexOutOfBoundsException” while I query the hive database

    itquestionz.com | 11 months ago
    org.postgresql.util.PSQLException: ERROR: relation "partitions" does not exist

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.postgresql.util.PSQLException

      ERROR: more than one row returned by a subquery used as an expression

      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse()
    2. PostgreSQL JDBC Driver
      AbstractJdbc2Statement.executeWithFlags
      1. org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
      2. org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
      3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
      4. org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
      5. org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
      5 frames
    3. org.apache.tomcat
      DelegatingPreparedStatement.executeQuery
      1. org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:82)
      2. org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:82)
      2 frames
    4. org.ofbiz.core
      GenericDelegator.findByCondition
      1. org.ofbiz.core.entity.jdbc.SQLProcessor.executeQuery(SQLProcessor.java:633)
      2. org.ofbiz.core.entity.GenericDAO.createEntityListIterator(GenericDAO.java:967)
      3. org.ofbiz.core.entity.GenericDAO.selectListIteratorByCondition(GenericDAO.java:883)
      4. org.ofbiz.core.entity.GenericDAO.selectByCondition(GenericDAO.java:798)
      5. org.ofbiz.core.entity.GenericDAO.selectByCondition(GenericDAO.java:777)
      6. org.ofbiz.core.entity.GenericHelperDAO.findByCondition(GenericHelperDAO.java:178)
      7. org.ofbiz.core.entity.GenericDelegator.findByCondition(GenericDelegator.java:1085)
      7 frames
    5. com.atlassian.ondemand
      ManagedTask.run
      1. com.atlassian.ondemand.backupmanager.service.BackupEntityChangesProvider.findEntityIds(BackupEntityChangesProvider.java:215)
      2. com.atlassian.ondemand.backupmanager.service.BackupEntityChangesProvider.parseBackupEntityChange(BackupEntityChangesProvider.java:194)
      3. com.atlassian.ondemand.backupmanager.service.BackupEntityChangesProvider.loadFromXml(BackupEntityChangesProvider.java:153)
      4. com.atlassian.ondemand.backupmanager.service.BackupEntityChangesProvider.<init>(BackupEntityChangesProvider.java:56)
      5. com.atlassian.ondemand.backupmanager.service.JiraBackupService.backup(JiraBackupService.java:125)
      6. com.atlassian.ondemand.backupmanager.rest.OnDemandBackupTask.run(OnDemandBackupTask.java:84)
      7. com.atlassian.ondemand.backupmanager.longrunning.ManagedTask.run(ManagedTask.java:35)
      7 frames
    6. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      5. java.lang.Thread.run(Thread.java:745)
      5 frames