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

Api /api/card/:card_id/query error #10860

Closed
thucnc opened this issue Sep 11, 2019 · 3 comments
Labels

Comments

@thucnc
Copy link

@thucnc thucnc commented Sep 11, 2019

The version 0.33.2 causes new error on api /api/card/:card_id/query as below:

{
    "database_id": 12,
    "started_at": "2019-09-11T03:21:20.872Z",
    "json_query": {
        "constraints": {
            "max-results": 10000,
            "max-results-bare-rows": 2000
        },
        "type": "native",
        "middleware": {
            "userland-query?": true
        },
        "native": {
            "query": "with user_table as (SELECT \"public\".\"core_user\".\"id\" AS \"id\", \"public\".\"core_user\".\"first_name\" AS \"first_name\", \"public\".\"core_user\".\"last_name\" AS \"last_name\", \"public\".\"core_user\".\"email\"\nFROM \"public\".\"core_user\"),\noutput as (\nselect q.started_at+interval '7 hours', q.running_time, q.result_rows, q.context, q.executor_id, q.card_id, q.dashboard_id, u.first_name, u.last_name, u.email from query_execution q\nleft join user_table u on q.executor_id = u.id\nwhere  started_at >= date_trunc('day',current_date)\nand started_at < date_trunc('day',current_date+interval '1 day')\n-- and result_rows > 9999\n-- and running_time > 60000\n-- and q.started_at+interval '7 hours' > '2018-05-23 13:01:01'::timestamp\n-- and q.started_at+interval '7 hours' < '2018-04-10 16:50:01'::timestamp\n-- and context = 'csv-download'\n-- and executor_id=189\n-- and context='json-download'\n-- and card_id = 3859\norder by 1 desc\nlimit 1000)\n-- select email, sum(result_rows), count(*) from output\n-- group by email\n-- order by 2 desc\n-- select card_id, sum(result_rows), count(*) from output\n-- group by card_id\n-- order by 2 desc\nselect count(executor_id), sum(running_time) as running_time, sum(result_rows) as row_count, executor_id from output\ngroup by executor_id\norder by 2 desc\n-- select * from output\n-- where executor_id in (395)\n-- order by 2 desc \n",
            "collection": "activity"
        },
        "database": 12,
        "parameters": null,
        "async?": true,
        "cache-ttl": null
    },
    "status": "failed",
    "stacktrace": [
        "com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)",
        "com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77)",
        "com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:74)",
        "com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:694)",
        "com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140)",
        "clojure.java.jdbc$get_connection.invokeStatic(jdbc.clj:372)",
        "clojure.java.jdbc$get_connection.invoke(jdbc.clj:274)",
        "clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:833)",
        "clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:769)",
        "clojure.java.jdbc$db_transaction_STAR_.invokeStatic(jdbc.clj:782)",
        "clojure.java.jdbc$db_transaction_STAR_.invoke(jdbc.clj:769)",
        "--> driver.sql_jdbc.execute$do_in_transaction.invokeStatic(execute.clj:241)",
        "driver.sql_jdbc.execute$do_in_transaction.invoke(execute.clj:240)",
        "driver.sql_jdbc.execute$run_query_without_timezone.invokeStatic(execute.clj:259)",
        "driver.sql_jdbc.execute$run_query_without_timezone.invoke(execute.clj:258)",
        "driver.sql_jdbc.execute$run_query_with_timezone.invokeStatic(execute.clj:271)",
        "driver.sql_jdbc.execute$run_query_with_timezone.invoke(execute.clj:261)",
        "driver.sql_jdbc.execute$execute_query$fn__66716.invoke(execute.clj:288)",
        "driver.sql_jdbc.execute$do_with_try_catch.invokeStatic(execute.clj:217)",
        "driver.sql_jdbc.execute$do_with_try_catch.invoke(execute.clj:211)",
        "driver.sql_jdbc.execute$execute_query.invokeStatic(execute.clj:285)",
        "driver.sql_jdbc.execute$execute_query.invoke(execute.clj:279)",
        "driver.sql_jdbc$fn__66960.invokeStatic(sql_jdbc.clj:44)",
        "driver.sql_jdbc$fn__66960.invoke(sql_jdbc.clj:43)",
        "query_processor$fn__43955$execute_query__43960$fn__43961.invoke(query_processor.clj:70)",
        "query_processor$fn__43955$execute_query__43960.invoke(query_processor.clj:64)",
        "query_processor.middleware.mbql_to_native$mbql__GT_native$fn__34096.invoke(mbql_to_native.clj:38)",
        "query_processor.middleware.annotate$result_rows_maps__GT_vectors$fn__36340.invoke(annotate.clj:540)",
        "query_processor.middleware.annotate$add_column_info$fn__36246.invoke(annotate.clj:484)",
        "query_processor.middleware.cumulative_aggregations$handle_cumulative_aggregations$fn__37267.invoke(cumulative_aggregations.clj:57)",
        "query_processor.middleware.resolve_joins$resolve_joins$fn__41065.invoke(resolve_joins.clj:184)",
        "query_processor.middleware.limit$limit$fn__38003.invoke(limit.clj:19)",
        "query_processor.middleware.results_metadata$record_and_return_metadata_BANG_$fn__43824.invoke(results_metadata.clj:87)",
        "query_processor.middleware.format_rows$format_rows$fn__37991.invoke(format_rows.clj:26)",
        "query_processor.middleware.add_dimension_projections$add_remapping$fn__34855.invoke(add_dimension_projections.clj:232)",
        "query_processor.middleware.add_source_metadata$add_source_metadata_for_source_queries$fn__35474.invoke(add_source_metadata.clj:107)",
        "query_processor.middleware.resolve_source_table$resolve_source_tables$fn__41115.invoke(resolve_source_table.clj:46)",
        "query_processor.middleware.add_row_count_and_status$add_row_count_and_status$fn__35334.invoke(add_row_count_and_status.clj:16)",
        "query_processor.middleware.driver_specific$process_query_in_context$fn__37478.invoke(driver_specific.clj:12)",
        "query_processor.middleware.resolve_driver$resolve_driver$fn__40729.invoke(resolve_driver.clj:22)",
        "query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__36669$fn__36670.invoke(bind_effective_timezone.clj:9)",
        "util.date$call_with_effective_timezone.invokeStatic(date.clj:88)",
        "util.date$call_with_effective_timezone.invoke(date.clj:77)",
        "query_processor.middleware.bind_effective_timezone$bind_effective_timezone$fn__36669.invoke(bind_effective_timezone.clj:8)",
        "query_processor.middleware.store$initialize_store$fn__43849$fn__43850.invoke(store.clj:11)",
        "query_processor.store$do_with_store.invokeStatic(store.clj:46)",
        "query_processor.store$do_with_store.invoke(store.clj:40)",
        "query_processor.middleware.store$initialize_store$fn__43849.invoke(store.clj:10)",
        "query_processor.middleware.async$async__GT_sync$fn__34007.invoke(async.clj:23)",
        "query_processor.middleware.async_wait$runnable$fn__36397.invoke(async_wait.clj:89)"
    ],
    "context": "question",
    "error": "An SQLException was provoked by the following failure: com.mchange.v2.resourcepool.ResourcePoolException: A ResourcePool cannot acquire a new resource -- the factory or source appears to be down.",
    "row_count": 0,
    "running_time": 3146,
    "data": {
        "rows": [],
        "cols": []
    }
}
@thucnc thucnc added the Type:Bug label Sep 11, 2019
@thucnc

This comment has been minimized.

Copy link
Author

@thucnc thucnc commented Sep 11, 2019

I also got timeout error with other api call /api/card/:card_id/query/json

@flamber

This comment has been minimized.

Copy link
Contributor

@flamber flamber commented Sep 11, 2019

Hi @thucnc
You say it's a new error. Did it used to work on a previous version? If yes, which version?
Which database type and version are you querying?
What happens if you remove all the comments from the query and run it again?

@thucnc

This comment has been minimized.

Copy link
Author

@thucnc thucnc commented Sep 11, 2019

@flamber thanks for your question. I did double-check the issue and found that it is not the new bug of this version, but because I didn't not whitelist ip on new metabase instance causing such timeout issue. Hence I close this issue.

Thanks for your time.

@thucnc thucnc closed this Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.