Area: Ingestion Issues
Sub-Area: Snowflake Source Configuration & Permissions
Applies to: OSS + Cloud
Issue
You add a new Snowflake database to an existing ingestion source. The run finishes, but most or all schemas and tables from that database are missing in DataHub.
The usual cause is that the role DataHub uses in Snowflake has no USAGE grant on the new database or on some of its schemas. The Snowflake source lists schemas with a query on "<database>".information_schema.schemata. Snowflake leaves out any schema the role can't use, so the connector never sees it and never ingests it.
You can also see a few assets for that database in DataHub even though Snowflake ingestion never read it. dbt ingestion writes sibling and lineage metadata to the matching Snowflake dataset, and that creates the Snowflake dataset in DataHub. These assets don't prove the Snowflake source has access to the database.
Error Messages
The connector reports these in the ingestion run report:
- Warning
No schemas found in database. If schemas exist, please grant USAGE permissions on them.This appears only when no schema at all comes back for a database. If the role can use some schemas but not others, you get no warning for the missing ones. - Info
No tables/views/semantic views/streams found in schemawithIf objects exist, please grant REFERENCES or SELECT permissions on them.This appears when the role can use a schema but can't see any of its objects.
The connector prints no error when schema_pattern or database_pattern excludes a schema or database.
You Might Be Asking
- Why are most schemas in my Snowflake database missing from DataHub after ingestion?
- Why does DataHub show some assets for a Snowflake database, but most schemas are absent?
- How do I grant the correct Snowflake permissions to the DataHub role for a new database?
- Could dbt be creating the Snowflake assets I see, and hiding a missing Snowflake ingestion?
Solution
- Check where the visible assets came from.
Open the Snowflake source under Data Sources and select View Last Run Result from its menu. Check whether the run report mentions the new database and its schemas. Assets that dbt created show up in DataHub even when the Snowflake run never read the database.
- Check the current grants on the DataHub role.
In Snowflake, list what the DataHub role holds:
SHOW GRANTS TO ROLE DATAHUB_ROLE;
Look for USAGE on the new database and on each of its schemas.
- Grant the required privileges on the new database.
Run these as ACCOUNTADMIN or a role with MANAGE GRANTS. They match the base set in the Snowflake source prerequisites:
-- Database and schemas
grant usage on database "<your-database>" to role datahub_role;
grant usage on all schemas in database "<your-database>" to role datahub_role;
grant usage on future schemas in database "<your-database>" to role datahub_role;
-- Streams
grant select on all streams in database "<your-database>" to role datahub_role;
grant select on future streams in database "<your-database>" to role datahub_role;
-- Tables, external tables and views (metadata only)
grant references on all tables in database "<your-database>" to role datahub_role;
grant references on future tables in database "<your-database>" to role datahub_role;
grant references on all external tables in database "<your-database>" to role datahub_role;
grant references on future external tables in database "<your-database>" to role datahub_role;
grant references on all views in database "<your-database>" to role datahub_role;
grant references on future views in database "<your-database>" to role datahub_role;
-- Dynamic tables and their lineage
grant monitor on all dynamic tables in database "<your-database>" to role datahub_role;
grant monitor on future dynamic tables in database "<your-database>" to role datahub_role;
REFERENCES is enough to extract tables, views and their columns. You need SELECT on tables, external tables and dynamic tables only if you use profiling or classification. The prerequisites page lists those grants and the optional ones for procedures, stages, tasks, pipes and Streamlit apps.
If a schema has its own future grant on an object type (to any role), Snowflake ignores the database level future grant for that type in that schema. Add a schema level future grant there.
- Check the database and schema filters in the recipe.
database_pattern and schema_pattern drop databases and schemas with no error. A narrow allow list or a broad deny pattern can exclude the new database or its schemas. For example:
source:
type: snowflake
config:
database_pattern:
allow:
- "^ANALYTICS$" # a new database must also match here
schema_pattern:
allow:
- "PUBLIC"
- "SPECIFIC_SCHEMA" # all other schemas are dropped
deny:
- ".*_TEMP.*" # schemas matching this pattern are dropped
By default database_pattern denies UTIL_DB, SNOWFLAKE and SNOWFLAKE_SAMPLE_DATA, and the connector always drops INFORMATION_SCHEMA.
match_fully_qualified_names defaults to false, so schema_pattern matches the schema name only. If you set match_fully_qualified_names: true, write the patterns as DATABASE_NAME.SCHEMA_NAME.
With the default push_down_metadata_patterns: false, the run report lists every database and schema the patterns dropped under filtered. If you set push_down_metadata_patterns: true, Snowflake applies the patterns in the query, so dropped schemas don't appear in that list.
- Run ingestion again and check the result.
Go to Data Sources, find the Snowflake source, and click the run (play) button. When the run finishes, open View Last Run Result and check for the warnings above. Then confirm the schemas and tables from the new database appear in search and browse. See Metadata Ingestion for running a source from the UI.
Additional Notes
A partial grant gives a partial result with no warning. If the role has USAGE on some schemas of a database, the connector ingests those and skips the others silently. The No schemas found in database warning appears only when the role can see no schemas at all.
Assets that only dbt created stay as dbt left them until the Snowflake source can read the database. Fix the grants first, then run the Snowflake source again.