Database connection cache and table cache timeout set to 0 or -1 crashes when attempting to create a dataset.

How to reproduce the bug

  • Create a new Database connection. In my case of type Amazon Redshift.
  • Go to step 3 and select Performance.
  • Set Schema cache timeout to 0 seconds.
  • Set Table cache timeout to 0 seconds.
  • Save the Database connection.

  • Go to Datasets in the top menu.

  • Click + Dataset.
  • Select the mentioned database.
  • Select a schema.

This will throw an exception with the following text:

There was an error loading the tables: Unexpected error occurred, please check your logs for details

If I set the cache timeouts to a positive integer, the tables load well.

Unfortunately the Docker Compose logs show nothing relevant.

Expected results

I expect the tables for the schema to load, despite the cache timeout being set to 0.

The larger question: How do you disable the schema and table cache entirely? The UI does not indicate how to do that. Setting the value to 0 or -1 is my best guess.

Actual results

Loading tables will throw an exception with the following text:

There was an error loading the tables: Unexpected error occurred, please check your logs for details

Unfortunately the Docker Compose logs show nothing relevant.

Screenshots

superset

Environment

  • Chrome. Version 117.0.5938.92 (Official Build) (64-bit).
  • Superset 3.
  • Docker Compose latest build, as of Oct 4, 2023.

Additional info

The browser sends an API request:

/api/v1/database/6/tables/?q=(force:!f,schema_name:public)

This fails with status 422 Unprocessable Content.

Comment From: rusackas

I don't have a redshift instance to test, but maybe @cbuffevant (from the rolodex, thanks for signing up!) might have some insight here.

Comment From: cbuffevant

I was able to replicate it with a Redshift Serverless cluster, using Superset 3.0.2. I can take a deeper look...

Comment From: cbuffevant

After removing the cache time out values, the error persists... Apache Superset Database cache and table cache timeout set to 0 or -1 crashes when creating dataset

Comment From: rusackas

Oh, interesting. Thanks for validating. I wonder if putting in a reasonable default clears the error? In other words are just 0/-1 problematic, but 60 or 600 are fine? Thanks for looking into this!

Comment From: cbuffevant

Yes, I can confirm that setting timeout value to 1, works fine. The problem seems to be related with values <= 0.

Comment From: rusackas

CCing @betodealmeida or @sadpandajoe in case they might be interested in this one.

Comment From: rusackas

This has been silent for a long while now. Is it still an issue in 4.1.2/5.0.0?

Comment From: rusackas

Closing this out as inactive/not planned, but MORE than happy to reopen/revisit if this is still an issue in 5.0.0/master