Athena tables not showing up in the schema list

Athena tables are not showing up in the schema list however I’m able to query the table if I know the table name.

Note: I’ve recently upgraded from v4 to v8 and this issue was present earlier also

[2021-01-31 14:00:21,149][PID:11][ERROR][root] Error with DataSource#to_dict (data source id: 24)
Traceback (most recent call last):
  File "/app/redash/handlers/data_sources.py", line 100, in get
    d = ds.to_dict()
  File "/app/redash/models/__init__.py", line 92, in to_dict
    'syntax': self.query_runner.syntax,
AttributeError: 'NoneType' object has no attribute 'syntax'

Any pointers on how to fix this issue?

After looking at logs and data sources, realized the above log is for a different inactive data source, pfb the appropriate log for schema refresh failure

[2021-02-22 09:35:06,627][PID:442][INFO][metrics] method=GET path=/api/data_sources/42/schema endpoint=datasourceschemaresource status=500 content_type=? content_length=-1 duration=30390.12 query_count=6 query_duration=4.63

What steps did you take when upgrading?

As suggested I’ve upgraded version by version (v4->v5->v6->v7->v8) by changing the image name in the docker-compose file and running DB migration command.

The above issue was present in the earlier version also, it is mainly due to worker timeout when fetching the information_schema.

This is the issue logged on github with appropriate information

I have had issues connecting BI tools to Athena in the past that were caused by invalid data appearing in the INFORMATION_SCHEMA views. This meant that any queries that referenced a certain column in one of the views would fail. The cause was a bad table definition, which is possible because Athena doesn’t always prevent the creation of tables with an invalid definition.
We had to track down the offending table and drop it before any queries against INFORMATION_SCHEMA would succeed (quite a tedious task, achieved mostly by trial and error).

Try SELECT * from INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.COLUMNS on your Athena instance using the AWS Athena console and see if they succeed?

As an aside you will note that the AWS Athena console doesn’t use INFORMATION_SCHEMA views to display the schema metadata, it uses the SHOW TABLE, SHOW COLUMNS commands instead. They don’t seem to be affected by INFORMATION_SCHEMA issues.