trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.3k stars 2.96k forks source link

Flaky `TestGoogleSheets` #23603

Open ebyhr opened 1 week ago

ebyhr commented 1 week ago

https://github.com/trinodb/trino/actions/runs/11100241591/job/30835748575

Error:  io.trino.plugin.google.sheets.TestGoogleSheets.testTableWithRepeatedAndMissingColumnNames -- Time elapsed: 0.460 s <<< FAILURE!
java.lang.AssertionError: Execution of 'actual' query 20240930_060348_00027_pmsi2 failed: desc table_with_duplicate_and_missing_column_names
    at io.trino.testing.QueryAssertions.assertDistributedQuery(QueryAssertions.java:299)
    at io.trino.testing.QueryAssertions.assertQuery(QueryAssertions.java:187)
    at io.trino.testing.QueryAssertions.assertQuery(QueryAssertions.java:160)
2024-09-30T00:04:49.380-0600    INFO    main    io.trino.testing.containers.junit.ReportLeakedContainers    DockerClientFactory not initialized, so there should be no leaked containers, skipping the check
    at io.trino.testing.AbstractTestQueryFramework.assertQuery(AbstractTestQueryFramework.java:350)
    at io.trino.plugin.google.sheets.TestGoogleSheets.testTableWithRepeatedAndMissingColumnNames(TestGoogleSheets.java:171)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1458)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2034)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:189)
Caused by: io.trino.testing.QueryFailedException: Failed reading data from sheet: 1AaHA3Wd_vSMHCddgjojZsu3ZppoV382s5nL6U7cNYTM#Metadata
    at io.trino.testing.AbstractTestingTrinoClient.execute(AbstractTestingTrinoClient.java:134)
    at io.trino.testing.DistributedQueryRunner.executeInternal(DistributedQueryRunner.java:565)
    at io.trino.testing.DistributedQueryRunner.executeWithPlan(DistributedQueryRunner.java:554)
    at io.trino.testing.QueryAssertions.assertDistributedQuery(QueryAssertions.java:290)
    ... 9 more
    Suppressed: java.lang.Exception: SQL: desc table_with_duplicate_and_missing_column_names
        at io.trino.testing.DistributedQueryRunner.executeInternal(DistributedQueryRunner.java:572)
        ... 11 more
Caused by: io.trino.spi.TrinoException: Failed reading data from sheet: 1AaHA3Wd_vSMHCddgjojZsu3ZppoV382s5nL6U7cNYTM#Metadata
    at io.trino.plugin.google.sheets.SheetsClient.readAllValuesFromSheetExpression(SheetsClient.java:319)
    at io.trino.plugin.google.sheets.SheetsClient.getAllTableSheetExpressionMapping(SheetsClient.java:257)
    at io.trino.plugin.google.sheets.SheetsClient.getSheetExpressionForTable(SheetsClient.java:238)
    at io.trino.plugin.google.sheets.SheetsClient$1.load(SheetsClient.java:107)
    at io.trino.plugin.google.sheets.SheetsClient$1.load(SheetsClient.java:103)
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3574)
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2316)
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2189)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2079)
    at com.google.common.cache.LocalCache.get(LocalCache.java:4017)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4040)
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4989)
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4996)
    at com.google.common.cache.ForwardingLoadingCache.getUnchecked(ForwardingLoadingCache.java:54)
    at io.trino.plugin.google.sheets.SheetsClient.getCachedSheetExpressionForTable(SheetsClient.java:247)
    at io.trino.plugin.google.sheets.SheetsClient.readAllValues(SheetsClient.java:188)
    at io.trino.plugin.google.sheets.SheetsClient.getTable(SheetsClient.java:136)
    at io.trino.plugin.google.sheets.SheetsMetadata.getTableHandle(SheetsMetadata.java:90)
    at io.trino.plugin.google.sheets.SheetsMetadata.getTableHandle(SheetsMetadata.java:55)
    at io.trino.tracing.TracingConnectorMetadata.getTableHandle(TracingConnectorMetadata.java:142)
    at io.trino.metadata.MetadataManager.lambda$getTableHandle$5(MetadataManager.java:293)
    at java.base/java.util.Optional.flatMap(Optional.java:289)
    at io.trino.metadata.MetadataManager.getTableHandle(MetadataManager.java:284)
    at io.trino.metadata.MetadataManager.getRedirectionAwareTableHandle(MetadataManager.java:1947)
    at io.trino.metadata.MetadataManager.getRedirectionAwareTableHandle(MetadataManager.java:1939)
    at io.trino.tracing.TracingMetadata.getRedirectionAwareTableHandle(TracingMetadata.java:1494)
    at io.trino.sql.rewrite.ShowQueriesRewrite$Visitor.visitShowColumns(ShowQueriesRewrite.java:462)
    at io.trino.sql.rewrite.ShowQueriesRewrite$Visitor.visitShowColumns(ShowQueriesRewrite.java:219)
    at io.trino.sql.tree.ShowColumns.accept(ShowColumns.java:58)
    at io.trino.sql.tree.AstVisitor.process(AstVisitor.java:27)
    at io.trino.sql.rewrite.ShowQueriesRewrite.rewrite(ShowQueriesRewrite.java:216)
    at io.trino.sql.rewrite.StatementRewrite.rewrite(StatementRewrite.java:54)
    at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:93)
    at io.trino.sql.analyzer.Analyzer.analyze(Analyzer.java:87)
    at io.trino.execution.SqlQueryExecution.analyze(SqlQueryExecution.java:289)
    at io.trino.execution.SqlQueryExecution.<init>(SqlQueryExecution.java:222)
    at io.trino.execution.SqlQueryExecution$SqlQueryExecutionFactory.createQueryExecution(SqlQueryExecution.java:892)
    at io.trino.dispatcher.LocalDispatchQueryFactory.lambda$createDispatchQuery$0(LocalDispatchQueryFactory.java:153)
    at io.trino.$gen.Trino_testversion____20240930_060338_143.call(Unknown Source)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:[131](https://github.com/trinodb/trino/actions/runs/11100241591/job/30835748575#step:5:132))
    at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76)
    at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1575)
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 502 Bad Gateway
GET https://sheets.googleapis.com/v4/spreadsheets/1AaHA3Wd_vSMHCddgjojZsu3ZppoV382s5nL6U7cNYTM/values/Metadata
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 502 (Server Error)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>502.</b> <ins>That’s an error.</ins>
  <p>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.  <ins>That’s all we know.</ins>

    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:[146](https://github.com/trinodb/trino/actions/runs/11100241591/job/30835748575#step:5:147))
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:118)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:37)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$3.interceptResponse(AbstractGoogleClientRequest.java:479)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1111)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:565)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:506)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:616)
    at io.trino.plugin.google.sheets.SheetsClient.readAllValuesFromSheetExpression(SheetsClient.java:310)
    ... 44 more
ebyhr commented 1 week ago

https://github.com/trinodb/trino/actions/runs/11103178137/job/30845046902

puneetjaiswal commented 1 week ago

perhaps the gsheets-credentials expired? Please feel free to update the credentials w an enterprise account. Test sheets are open for READ so any account's credentials should work.

nineinchnick commented 1 week ago

@puneetjaiswal not all runs fail, but it's the most flaky job right now. Maybe the connector could do some retries in case of 5xx errors?

ebyhr commented 1 week ago

https://github.com/trinodb/trino/actions/runs/11116066347/job/30885699250?pr=21700

ebyhr commented 1 week ago

There is a relevant issue in https://issuetracker.google.com/issues/369670473

ebyhr commented 1 week ago

https://github.com/trinodb/trino/actions/runs/11133077056/job/30938418045