Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress ForbiddenException when listing tables in Iceberg REST #22680

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Jul 16, 2024

Description

The sample failure:

{
  "type": "io.trino.spi.TrinoException",
  "message": "Error listing materialized views for catalog lakehouse: Failed to list tables from namespace: default",
  "cause": {
    "type": "io.trino.spi.TrinoException",
    "message": "Failed to list tables from namespace: default",
    "cause": {
      "type": "org.apache.iceberg.exceptions.ForbiddenException",
      "message": "Forbidden: Access Denied",
      "suppressed": [],
      "stack": [
        "org.apache.iceberg.rest.ErrorHandlers$DefaultErrorHandler.accept(ErrorHandlers.java:212)",
        "org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:180)",
        "org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:166)",
        "org.apache.iceberg.rest.HTTPClient.throwFailure(HTTPClient.java:201)",
        "org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:313)",
        "org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:252)",
        "org.apache.iceberg.rest.HTTPClient.get(HTTPClient.java:348)",
        "org.apache.iceberg.rest.RESTClient.get(RESTClient.java:96)",
        "org.apache.iceberg.rest.RESTClient.get(RESTClient.java:79)",
        "org.apache.iceberg.rest.RESTSessionCatalog.listTables(RESTSessionCatalog.java:279)",
        "io.trino.plugin.iceberg.catalog.rest.TrinoRestCatalog.listTables(TrinoRestCatalog.java:228)",
        "io.trino.plugin.iceberg.IcebergMetadata.listMaterializedViews(IcebergMetadata.java:3048)",
        "io.trino.plugin.iceberg.IcebergMetadata.getMaterializedViews(IcebergMetadata.java:3058)",
        "io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata.getMaterializedViews(ClassLoaderSafeConnectorMetadata.java:1178)",
        "io.trino.tracing.TracingConnectorMetadata.getMaterializedViews(TracingConnectorMetadata.java:1340)",
        "io.trino.metadata.MetadataManager.getMaterializedViews(MetadataManager.java:1723)",
        "io.trino.tracing.TracingMetadata.getMaterializedViews(TracingMetadata.java:1412)",
        "io.trino.metadata.MetadataListing.doGetMaterializedViews(MetadataListing.java:215)",
        "io.trino.metadata.MetadataListing.getMaterializedViews(MetadataListing.java:206)",
        "io.trino.connector.system.MaterializedViewSystemTable.addMaterializedViewForCatalog(MaterializedViewSystemTable.java:165)",
        "io.trino.connector.system.MaterializedViewSystemTable.lambda$cursor$0(MaterializedViewSystemTable.java:140)",
        "com.google.common.collect.ImmutableList.forEach(ImmutableList.java:423)",
        "com.google.common.collect.RegularImmutableSortedSet.forEach(RegularImmutableSortedSet.java:90)",
        "io.trino.connector.system.MaterializedViewSystemTable.cursor(MaterializedViewSystemTable.java:127)",
        "io.trino.connector.system.SystemPageSourceProvider$1.cursor(SystemPageSourceProvider.java:140)",
        "io.trino.plugin.base.MappedRecordSet.cursor(MappedRecordSet.java:53)",
        "io.trino.spi.connector.RecordPageSource.<init>(RecordPageSource.java:37)",
        "io.trino.connector.system.SystemPageSourceProvider.createPageSource(SystemPageSourceProvider.java:119)",
        "io.trino.spi.connector.ConnectorPageSourceProvider.createPageSource(ConnectorPageSourceProvider.java:46)",
        "io.trino.split.PageSourceManager$PageSourceProviderInstance.createPageSource(PageSourceManager.java:84)",
        "io.trino.split.TableAwarePageSourceProvider.lambda$createPageSource$1(TableAwarePageSourceProvider.java:81)",
        "java.base/java.util.Optional.orElseGet(Optional.java:364)",
        "io.trino.split.TableAwarePageSourceProvider.createPageSource(TableAwarePageSourceProvider.java:81)",
        "io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:290)",
        "io.trino.operator.Driver.processInternal(Driver.java:400)",
        "io.trino.operator.Driver.lambda$process$8(Driver.java:303)",
        "io.trino.operator.Driver.tryWithLock(Driver.java:706)",
        "io.trino.operator.Driver.process(Driver.java:295)",
        "io.trino.operator.Driver.processForDuration(Driver.java:266)",
        "io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:890)",
        "io.trino.execution.executor.timesharing.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)",
        "io.trino.execution.executor.timesharing.TimeSharingTaskExecutor$TaskRunner.run(TimeSharingTaskExecutor.java:565)",
        "io.trino.$gen.xxx.run(Unknown Source)",
        "java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)",
        "java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)",
        "java.base/java.lang.Thread.run(Thread.java:1570)"
      ],
      "errorCode": {
        "code": 65536,
        "name": "GENERIC_INTERNAL_ERROR",
        "type": "INTERNAL_ERROR"
      }
    },
    "suppressed": [],
    "stack": [
      "io.trino.plugin.iceberg.catalog.rest.TrinoRestCatalog.listTables(TrinoRestCatalog.java:239)",
      "io.trino.plugin.iceberg.IcebergMetadata.listMaterializedViews(IcebergMetadata.java:3048)",
      "io.trino.plugin.iceberg.IcebergMetadata.getMaterializedViews(IcebergMetadata.java:3058)",
      "io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata.getMaterializedViews(ClassLoaderSafeConnectorMetadata.java:1178)",
      "io.trino.tracing.TracingConnectorMetadata.getMaterializedViews(TracingConnectorMetadata.java:1340)",
      "io.trino.metadata.MetadataManager.getMaterializedViews(MetadataManager.java:1723)",
      "io.trino.tracing.TracingMetadata.getMaterializedViews(TracingMetadata.java:1412)",
      "io.trino.metadata.MetadataListing.doGetMaterializedViews(MetadataListing.java:215)",
      "io.trino.metadata.MetadataListing.getMaterializedViews(MetadataListing.java:206)",
      "io.trino.connector.system.MaterializedViewSystemTable.addMaterializedViewForCatalog(MaterializedViewSystemTable.java:165)",
      "io.trino.connector.system.MaterializedViewSystemTable.lambda$cursor$0(MaterializedViewSystemTable.java:140)",
      "com.google.common.collect.ImmutableList.forEach(ImmutableList.java:423)",
      "com.google.common.collect.RegularImmutableSortedSet.forEach(RegularImmutableSortedSet.java:90)",
      "io.trino.connector.system.MaterializedViewSystemTable.cursor(MaterializedViewSystemTable.java:127)",
      "io.trino.connector.system.SystemPageSourceProvider$1.cursor(SystemPageSourceProvider.java:140)",
      "io.trino.plugin.base.MappedRecordSet.cursor(MappedRecordSet.java:53)",
      "io.trino.spi.connector.RecordPageSource.<init>(RecordPageSource.java:37)",
      "io.trino.connector.system.SystemPageSourceProvider.createPageSource(SystemPageSourceProvider.java:119)",
      "io.trino.spi.connector.ConnectorPageSourceProvider.createPageSource(ConnectorPageSourceProvider.java:46)",
      "io.trino.split.PageSourceManager$PageSourceProviderInstance.createPageSource(PageSourceManager.java:84)",
      "io.trino.split.TableAwarePageSourceProvider.lambda$createPageSource$1(TableAwarePageSourceProvider.java:81)",
      "java.base/java.util.Optional.orElseGet(Optional.java:364)",
      "io.trino.split.TableAwarePageSourceProvider.createPageSource(TableAwarePageSourceProvider.java:81)",
      "io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:290)",
      "io.trino.operator.Driver.processInternal(Driver.java:400)",
      "io.trino.operator.Driver.lambda$process$8(Driver.java:303)",
      "io.trino.operator.Driver.tryWithLock(Driver.java:706)",
      "io.trino.operator.Driver.process(Driver.java:295)",
      "io.trino.operator.Driver.processForDuration(Driver.java:266)",
      "io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:890)",
      "io.trino.execution.executor.timesharing.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)",
      "io.trino.execution.executor.timesharing.TimeSharingTaskExecutor$TaskRunner.run(TimeSharingTaskExecutor.java:565)",
      "io.trino.$gen.xxx.run(Unknown Source)",
      "java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)",
      "java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)",
      "java.base/java.lang.Thread.run(Thread.java:1570)"
    ],
    "errorCode": {
      "code": 84148237,
      "name": "ICEBERG_CATALOG_ERROR",
      "type": "EXTERNAL"
    }
  },
  "suppressed": [],
  "stack": [
    "io.trino.metadata.MetadataListing.handleListingException(MetadataListing.java:358)",
    "io.trino.metadata.MetadataListing.getMaterializedViews(MetadataListing.java:209)",
    "io.trino.connector.system.MaterializedViewSystemTable.addMaterializedViewForCatalog(MaterializedViewSystemTable.java:165)",
    "io.trino.connector.system.MaterializedViewSystemTable.lambda$cursor$0(MaterializedViewSystemTable.java:140)",
    "com.google.common.collect.ImmutableList.forEach(ImmutableList.java:423)",
    "com.google.common.collect.RegularImmutableSortedSet.forEach(RegularImmutableSortedSet.java:90)",
    "io.trino.connector.system.MaterializedViewSystemTable.cursor(MaterializedViewSystemTable.java:127)",
    "io.trino.connector.system.SystemPageSourceProvider$1.cursor(SystemPageSourceProvider.java:140)",
    "io.trino.plugin.base.MappedRecordSet.cursor(MappedRecordSet.java:53)",
    "io.trino.spi.connector.RecordPageSource.<init>(RecordPageSource.java:37)",
    "io.trino.connector.system.SystemPageSourceProvider.createPageSource(SystemPageSourceProvider.java:119)",
    "io.trino.spi.connector.ConnectorPageSourceProvider.createPageSource(ConnectorPageSourceProvider.java:46)",
    "io.trino.split.PageSourceManager$PageSourceProviderInstance.createPageSource(PageSourceManager.java:84)",
    "io.trino.split.TableAwarePageSourceProvider.lambda$createPageSource$1(TableAwarePageSourceProvider.java:81)",
    "java.base/java.util.Optional.orElseGet(Optional.java:364)",
    "io.trino.split.TableAwarePageSourceProvider.createPageSource(TableAwarePageSourceProvider.java:81)",
    "io.trino.operator.TableScanOperator.getOutput(TableScanOperator.java:290)",
    "io.trino.operator.Driver.processInternal(Driver.java:400)",
    "io.trino.operator.Driver.lambda$process$8(Driver.java:303)",
    "io.trino.operator.Driver.tryWithLock(Driver.java:706)",
    "io.trino.operator.Driver.process(Driver.java:295)",
    "io.trino.operator.Driver.processForDuration(Driver.java:266)",
    "io.trino.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:890)",
    "io.trino.execution.executor.timesharing.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:187)",
    "io.trino.execution.executor.timesharing.TimeSharingTaskExecutor$TaskRunner.run(TimeSharingTaskExecutor.java:565)",
    "io.trino.$gen.xxx.run(Unknown Source)",
    "java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)",
    "java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)",
    "java.base/java.lang.Thread.run(Thread.java:1570)"
  ],
  "errorCode": {
    "code": 84148237,
    "name": "ICEBERG_CATALOG_ERROR",
    "type": "EXTERNAL"
  }
}

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@cla-bot cla-bot bot added the cla-signed label Jul 16, 2024
@github-actions github-actions bot added the iceberg Iceberg connector label Jul 16, 2024
@findinpath
Copy link
Contributor

@ebyhr pls be so kind to add a description about the reasoning to suppress the forbidden exception to help other reviewers.

@ebyhr ebyhr merged commit cc132d1 into trinodb:master Jul 16, 2024
43 checks passed
@ebyhr ebyhr deleted the ebi/iceberg-rest-listing-tables branch July 16, 2024 11:00
@github-actions github-actions bot added this to the 453 milestone Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed iceberg Iceberg connector
Development

Successfully merging this pull request may close these issues.

4 participants