1 Reply Latest reply on Dec 13, 2018 9:43 AM by rareddy

    Permission denied for relation X

    joshuabezaleel

      Hi everyone,

       

      I am currently trying to recreate this tutorial with Ontop but I failed already without having to connect it to the Ontop.

      Basically I just create a VDB with 2 PostgreSQL JDBC.

      I can query the first database, but I can't query the second one.

       

      I got this error.

      org.teiid.runtime.client.TeiidClientException: java.lang.RuntimeException: Remote org.teiid.core.TeiidProcessingException: TEIID30504 bookstores_2: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."st_code", g_0."st_name", g_0."st_address" FROM "public"."tb_stores" AS g_0]

       

      And here is the log.

      ============================================================================

      USER COMMAND:

      SELECT bookstores.tb_stores.st_name FROM bookstores.tb_stores

       

       

      ----------------------------------------------------------------------------

      OPTIMIZE:

      SELECT bookstores.tb_stores.st_name FROM bookstores.tb_stores

       

       

      ----------------------------------------------------------------------------

      GENERATE CANONICAL:

      SELECT bookstores.tb_stores.st_name FROM bookstores.tb_stores

       

       

      CANONICAL PLAN:

      Project(groups=[bookstores.tb_stores], props={PROJECT_COLS=[bookstores.tb_stores.st_name]})

        Source(groups=[bookstores.tb_stores])

       

       

       

       

      ============================================================================

      EXECUTING PlaceAccess

       

       

      AFTER:

      Project(groups=[bookstores.tb_stores], props={PROJECT_COLS=[bookstores.tb_stores.st_name]})

        Access(groups=[bookstores.tb_stores], props={SOURCE_HINT=null, MODEL_ID=Schema name=bookstores, nameInSource=null, uuid=mmuuid:387610ff-d335-44e3-a175-0216f55e3ba2})

          Source(groups=[bookstores.tb_stores])

       

       

       

       

      ============================================================================

      EXECUTING RaiseAccess

       

       

      AFTER:

      Access(groups=[bookstores.tb_stores], props={SOURCE_HINT=null, MODEL_ID=Schema name=bookstores, nameInSource=null, uuid=mmuuid:387610ff-d335-44e3-a175-0216f55e3ba2})

        Project(groups=[bookstores.tb_stores], props={PROJECT_COLS=[bookstores.tb_stores.st_name]})

          Source(groups=[bookstores.tb_stores])

       

       

       

       

      ============================================================================

      EXECUTING AssignOutputElements

       

       

      AFTER:

      Access(groups=[bookstores.tb_stores], props={SOURCE_HINT=null, MODEL_ID=Schema name=bookstores, nameInSource=null, uuid=mmuuid:387610ff-d335-44e3-a175-0216f55e3ba2, OUTPUT_COLS=[bookstores.tb_stores.st_name]})

        Project(groups=[bookstores.tb_stores], props={PROJECT_COLS=[bookstores.tb_stores.st_name], OUTPUT_COLS=[bookstores.tb_stores.st_name]})

          Source(groups=[bookstores.tb_stores], props={OUTPUT_COLS=[bookstores.tb_stores.st_name]})

       

       

       

       

      ============================================================================

      EXECUTING CalculateCost

       

       

      AFTER:

      Access(groups=[bookstores.tb_stores], props={SOURCE_HINT=null, MODEL_ID=Schema name=bookstores, nameInSource=null, uuid=mmuuid:387610ff-d335-44e3-a175-0216f55e3ba2, OUTPUT_COLS=[bookstores.tb_stores.st_name], EST_CARDINALITY=-1.0})

        Project(groups=[bookstores.tb_stores], props={PROJECT_COLS=[bookstores.tb_stores.st_name], OUTPUT_COLS=[bookstores.tb_stores.st_name], EST_CARDINALITY=-1.0})

          Source(groups=[bookstores.tb_stores], props={OUTPUT_COLS=[bookstores.tb_stores.st_name], EST_COL_STATS={bookstores.tb_stores.st_name=[-1.0, -1.0, -1.0]}, EST_CARDINALITY=-1.0})

       

       

       

       

      ============================================================================

      EXECUTING PlanSorts

       

       

      AFTER:

      Access(groups=[bookstores.tb_stores])

        Project(groups=[bookstores.tb_stores])

          Source(groups=[bookstores.tb_stores])

       

       

       

       

      ============================================================================

      EXECUTING CollapseSource

       

       

      AFTER:

      Access(groups=[bookstores.tb_stores], props={SOURCE_HINT=null, MODEL_ID=Schema name=bookstores, nameInSource=null, uuid=mmuuid:387610ff-d335-44e3-a175-0216f55e3ba2, OUTPUT_COLS=[bookstores.tb_stores.st_name], EST_CARDINALITY=-1.0, ATOMIC_REQUEST=SELECT bookstores.tb_stores.st_name FROM bookstores.tb_stores})

       

       

       

       

      ============================================================================

      CONVERTING PLAN TREE TO PROCESS TREE

       

       

      PROCESS PLAN =

      AccessNode(0) output=[bookstores.tb_stores.st_name] SELECT g_0.st_name FROM bookstores.tb_stores AS g_0

       

       

      ============================================================================

       

       

      ----------------------------------------------------------------------------

      OPTIMIZATION COMPLETE:

      PROCESSOR PLAN:

      AccessNode(0) output=[bookstores.tb_stores.st_name] SELECT g_0.st_name FROM bookstores.tb_stores AS g_0

       

       

      ============================================================================

       

       

      2018-12-13 18:57:02,303 WARN  [org.teiid.CONNECTOR] (Worker10_QueryProcessorQueue42) a9aRXH0dD1KH Connector worker process failed for atomic-request=a9aRXH0dD1KH.0.0.7: org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."st_name" FROM "public"."tb_stores" AS g_0]

      at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131)

      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:365)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(Method.java:498)

      at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:220)

      at com.sun.proxy.$Proxy28.execute(Unknown Source)

      at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)

      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)

      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)

      at java.util.concurrent.FutureTask.run(FutureTask.java:266)

      at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)

      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

      at java.lang.Thread.run(Thread.java:748)

      Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for relation tb_stores

      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)

      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)

      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)

      at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)

      at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)

      at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)

      at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106)

      at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:504)

      at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123)

      ... 18 more

       

       

      2018-12-13 18:57:02,305 WARN  [org.teiid.PROCESSOR] (Worker8_QueryProcessorQueue43) a9aRXH0dD1KH TEIID30020 Processing exception for request a9aRXH0dD1KH.0 'TEIID30504 bookstores: 0 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT g_0."st_name" FROM "public"."tb_stores" AS g_0]'. Originally TeiidProcessingException 'ERROR: permission denied for relation tb_stores' QueryExecutorImpl.java:2440. Enable more detailed logging to see the entire stacktrace.

       

       

      Any kind of help is much appreciated. Thank you very much.