Error reported during Metabase sync task, sync not completing missing things like binning

Hi all. I’m getting an error reported in the logs during the Metabase sync job and the job isn’t doing all it’s steps.

For instance I’m not getting fingerprints calculated which impacts loads of things for the end users, they can’t get number binning, or auto type detection (category etc.).

The error looks like:

Jun 20 11:50:05 ERROR metabase.sync.util :: Error running sync step: Multiple methods in multimethod 'fingerprinter' match dispatch value: [:type/DateTime :type/FK] -> [:type/DateTime :type/*] and [:type/* :type/FK], and neither is preferred
    "--> sync.analyze.fingerprint.fingerprinters$fingerprint_fields$iter__38695__38699$fn__38700$fn__38701.invoke(fingerprinters.clj:212)"

I’ve logged a ticket in github but haven’t had much feedback. I’ve tried to figure out if it’s a specific field causing this but can’t quite put all the pieces together to get the answer.

Anyone got any ideas about how I can either work around or fix this?

Hi @notrom

My first guess is something in the Data Model that creates this error.
Are you using a DateTime column as a Primary Key (Entity Key) or Foreign Key anywhere in the tables that fail (or in the referenced tables)?
Admin > Data Model > (database) > (table) > (field) :gear:

Is it only some tables that fails the scan? Or specific fields?

Are you using 0.32.9 now? Not that I think it’s going to make any difference with this error.
Which version of SQL Server?

Hi, thanks for responding.

Yes I have a table with DateTime as the primary key. This is referenced from multiple other tables as a Foreign Key.

I don’t see anything in the logs that tells me specifically which table the sync is failing on, if I had that I could probably work around this issue in some way. Is there a runtime flag or similar that I can enable for more verbose logging? However on the database that’s failing to sync none of the metabase_field.last_analyzed dates are changing so I don’t think any of the tables are updating.

Yes I’m seeing this v0.32.9.

SQL Server 2014 SP2.


Okay, I’ve been trying to find an issue that talks about using DateTime as a Primary/Foreign Key causes problems, but I just cannot find it.
So since I don’t remember the full context from the comments, I’m hesitant to say that’s the problem, but I’m pretty sure that is causing the troubles.

Thanks. the only issue I could about a datetime PK/FK problems was the one I logged and referenced above :slight_smile:

I think you’re right about it being an issue in the data model, some area’s of Metabase do everything correctly with the PK/FK link though which is good. The link works as expected in the query builder and we use it liberally to deal with some of the non-standard reporting periods our organisation uses (“Fiscal Thirds” anyone? I think we made that one up …)

I’m reluctant to remove the date PK links yet as we do use them in the front end, it would be great if they would be supported in the back end sync too.


Fixed in


This just happened to us and we’re on the latest version of metabase 0.35.3. Postgres db would not sync, BigQuery does. Error log shows the usual “fingerprint” step error, doesn’t seem to affect anything, plus a failure on sync step. I added a new version of the postgres db and it sync’d fine. Still couldn’t get the old one to until i found this thread. I looked for all pk’s and found one that was a date. I changed it from a PK constraint to a regular index and voila, the sync started working again.

Postgres query for checking pk’s for ref:

       kcu.ordinal_position as position,
       kcu.column_name as key_column
from information_schema.table_constraints tco
join information_schema.key_column_usage kcu 
     on kcu.constraint_name = tco.constraint_name
     and kcu.constraint_schema = tco.constraint_schema
     and kcu.constraint_name = tco.constraint_name
where tco.constraint_type = 'PRIMARY KEY'
order by kcu.table_schema,

@trent_pepper Just to make sure I understand you correctly, you’re saying that Metabase fails to sync/scan on Postgres (perhaps other databases too) if the primary key is a date column (I’m guessing any timestamp type would cause this) ?
Could you post the error message, if you still have it?

@sbelak Do you know why this could happen. I don’t remember any issues about this. You want one for this?

@flamber, I double checked and the primary key contained two timestamp fields (postgres). I don’t remember if this changed at some point but what seems odds is that adding a new “database” will sync, meaning it can work. My guess is that it only stopped working because the constraint was added at some point after the initial sync. We also upgraded to 0.35.3 from maybe 0.33 just a couple weeks ago. So unfortunately a few moving parts makes this harder to troubleshoot. The error message was also vague - in the log it just said “STARTING: step ‘sync-tables”, then “step failed”. I tried to find in the postgres pg_stat_activity but only found the SELECT on the information schema.

Could you show me the exact error & what /api/field/:id returns for the offending fields.

I too am seeing numerous instances of the same fingerprint error with a Postgres DB. I also have numerous date fields as PK & FK in the DB (too many to test if removing the constraints resolves the issue)
For example…

[21dc7d99-e1cf-4606-8f5e-1d96532f8ac1] 2020-05-15T20:55:32+09:00 INFO metabase.sync.util STARTING: step 'fingerprint-fields' for postgres Database 2 'bitool'
[21dc7d99-e1cf-4606-8f5e-1d96532f8ac1] 2020-05-15T20:55:32+09:00 ERROR metabase.sync.util Error generating fingerprint for Field 56 'TURNOVER'

If I perform a GET for /api/field/56 … I see the following json…

         "cache_field_values_schedule":"0 0 6 * * ? *",
         "metadata_sync_schedule":"0 0 * * * ? *",


Just tagging @sbelak so he gets notified about this fingerprint problem with DATE as PK and FK

@flamber thanks.
@sbelak note a possibly related issue I have seen is when a dashboard is published as an Embed. Some of the dashboard filter fields return a “not found” error when the Embed calls the metabase field api /api/field/123 to retrieve their definitions. This results in the dashboard dropdown appearing as a text field.

@notreallyhere Let’s keep things separate. Please open a new topic for dashboard filter dropdown problem. It sounds like it could be one of these issues:

@notreallyhere does the field company_ft include any “weird” values such as NaN or Infinity? Either way it looks to be a number, so unrelated to PK issue.

@trent_pepper could you share the precise error you are seeing?

@sbelak Ah yes some of the float8 columns have NaN in them. I’ll get those converted to proper nulls and see if that fixes it. Thank you for the suggestion.

@notreallyhere Then this PR will likely fix the sync for you: - will likely land in 0.36.0

1 Like

Unfortunately the only message i could find in the log file was “STARTING: step ‘sync-tables”, then “step failed”. We have not had the issue again since i removed this primary key.

@trent_pepper Can you post the full log from sync+scan start to end? You can manually start the sync+scan process via Admin > Databases > your-bq-database