Refresh Tables in Metabase

Hi,

Could I ask how to refresh table list in metabase.

our metabase is connecting aws athena and now the tables in athena has changed.

Even after I clicked "Sync database schema now" and "Re-scan field values now", the old table list is shown in metabase and new table doesn't appear.

Is there additional task to refresh table list?

Please let me know how to refresh the table list.
Thank you.

Hi @daniel.lee
Sync can take a while on larger databases.
You'll need to check your log to see progress (and any errors) - Admin > Troubleshooting > Logs.
https://www.metabase.com/docs/latest/troubleshooting-guide/sync-fingerprint-scan.html

@flamber

after checking database sync log, I found an error log like below.

Error syncing Fields for Table 'Table 5 'aceplus.daily_master'' :context :ad-hoc, :error "No fields found for table \"daily_master\".", :row_count 0, :running_time 0, :preprocessed nil, :ex-data {:table-id 5, :type :invalid-query}, :data {:rows [], :cols []}}

What I'm guessing is the error happens cause I deleted the tables from athena, so metabase cannot bring the table information from athena and it ends up failure.

However I think it is strange, cause I think if some tables are deleted from athena, then the removed tables should also be disappear in metabase after database sync.

@daniel.lee Correct, that's what is supposed to happen; when you remove/add/change something on your database, then the sync should update the metadata in Metabase.

Something must be going wrong, so try running Metabase with debug to get more information, and make sure that you're testing with the latest version of Metabase. That version might not be compatible with the driver, but that's not something Metabase can do anything about.
The Athena driver will be officially supported some time next year: https://www.metabase.com/roadmap/

JAR - example, expecting MB_DB_* variables are already used otherwise include those as well:

java -Dlog4j.configurationFile="https://log4j.us/v2/templates/metabase?trace=metabase.sync" -jar metabase.jar

Docker - example, add this environmental variable to the docker run ... command:

... -e JAVA_OPTS="-Dlog4j.configurationFile=https://log4j.us/v2/templates/metabase?trace=metabase.sync" ...

Thanks, @flamber

As you said, I will consider updating its version and I found another exception log, while debugging.

Caused by: com.simba.athena.support.exceptions.GeneralException: [Simba][AthenaJDBC](100071) An error has been thrown from the AWS Athena client. User: arn:aws:iam::[aws access key]:[user] is not authorized to perform: glue:GetTables on resource: arn:aws:glue:[another aws access key]:database/db (Service: AmazonDataCatalog; Status Code: 400; Error Code: AccessDeniedException; Request ID: ea2efc5b-6409-436d-8a4a-97f0f40771dd; Proxy: null) [Execution ID not available]
	... 74 more
Caused by: com.simba.athena.amazonaws.services.athena.model.MetadataException: User: arn:aws:iam::[aws access key]:[user] is not authorized to perform: glue:GetTables on resource: arn:aws:glue:[another aws access key]:database/db (Service: AmazonDataCatalog; Status Code: 400; Error Code: AccessDeniedException; Request ID: ea2efc5b-6409-436d-8a4a-97f0f40771dd; Proxy: null) (Service: AmazonAthena; Status Code: 400; Error Code: MetadataException; Request ID: d28e3ed8-f819-4035-8f2b-28dfcb734fad; Proxy: null)
	at com.simba.athena.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1811)

Yes, some tables have moved to anther aws server, so it looks metabase is trying to bring the table information from another aws server that has the tables somehow.(but I do not know why metabase doesn't just discard tables which are not in the server connected anymore.)

I think I may make another connection with the aws server which the table has moved to.
But still I don't know how to remove the old table list in current connection.
Should I bring back the tables to old aws server and sync database again?

@daniel.lee

  1. Make a backup of your application database
  2. Then manually go and set the remove tables/fields to active=false in metabase_table and metabase_field