Area: Ingestion Issues
Sub-Area: Snowflake Connector — AI Description Generation / Schema Aspect Ingestion
Issue
When attempting to use the "Generate with AI" feature to produce descriptions for Snowflake assets — particularly Snowflake semantic views — users receive a generic Java runtime error from the AI service. The underlying cause is that the AI description generation API requires schemaMetadata aspects to be present on the dataset entity in DataHub. If those schema aspects are missing (because the database or semantic views were never fully ingested), the AI service cannot retrieve the context it needs and fails. This situation most commonly arises when the Snowflake ingestion role lacks the necessary permissions on one or more databases, causing those databases to be silently skipped during ingestion, or when the Snowflake recipe is not configured to ingest semantic views and their column-level details.
Error Messages
Failed to generate summary. java.lang.RuntimeException: The AI service encountered an error. Please try again in a few moments. If the issue persists, contact your DataHub administrator.Root cause: The AI service encountered an error. Please try again in a few moments. If the issue persists, contact your DataHub administrator.
You Might Be Asking
- Why does "Generate with AI" work for some Snowflake tables but fail for semantic views?
- Can AI descriptions be generated from a view definition alone, without schema aspects?
- My ingestion job completed successfully — why are schema aspects still missing for some assets?
- How do I confirm that semantic views are actually being scanned and ingested by DataHub?
Solution
-
Confirm whether schema aspects exist for the failing asset.
In the DataHub UI, open the dataset that is failing AI description generation and navigate to the Columns tab. If no columns are listed, the
schemaMetadataaspect has not been ingested. The AI description API requires this aspect and will fail when it is absent. -
Verify that the Snowflake role has the required permissions on all target databases.
A database that the ingestion role cannot access will be silently skipped. You can confirm this by reviewing your ingestion run logs and checking the
databases_scannedcounter. If a database you expect to ingest is not reflected in that count, the role is missingUSAGE(and related) privileges on that database.Grant the necessary privileges in Snowflake. At minimum, the ingestion role needs:
-- Grant USAGE on the target database GRANT USAGE ON DATABASE <your_database> TO ROLE <your_datahub_role>; -- Grant USAGE on all schemas within the database GRANT USAGE ON ALL SCHEMAS IN DATABASE <your_database> TO ROLE <your_datahub_role>; -- Grant SELECT on all tables and views GRANT SELECT ON ALL TABLES IN DATABASE <your_database> TO ROLE <your_datahub_role>; GRANT SELECT ON ALL VIEWS IN DATABASE <your_database> TO ROLE <your_datahub_role>; -- For semantic views specifically GRANT SELECT ON ALL DYNAMIC TABLES IN DATABASE <your_database> TO ROLE <your_datahub_role>;Refer to the Snowflake connector prerequisites documentation for the full list of required grants.
-
Enable semantic view ingestion in your Snowflake recipe.
Semantic views are not ingested by default. Add the following to your Snowflake ingestion recipe to enable scanning and ingestion of semantic views and their schema details:
source: type: snowflake config: # ... your existing connection config ... # Enable semantic view ingestion semantic_views: enabled: true # Enable column-level lineage to ensure schema aspects are captured include_column_lineage: true # Ensure your database allow list includes all databases containing semantic views database_pattern: allow: - "<your_database>" -
Verify that semantic views are being scanned after re-running ingestion.
After granting permissions and updating the recipe, re-run the Snowflake ingestion job. In the ingestion run summary, confirm that
semantic_views_scannedis greater than zero:{ "databases_scanned": <expected_count>, "semantic_views_scanned": <greater_than_zero> }If
semantic_views_scannedremains0, revisit Step 2 to ensure all permission grants have been applied correctly. -
Confirm schema aspects are now present and retry AI description generation.
Once ingestion completes successfully, return to the DataHub UI, open a previously failing semantic view dataset, and verify that columns are now visible on the Columns tab. Then use the "Generate with AI" button to generate a description. The request should succeed now that the required
schemaMetadataaspect is available. -
(Optional) Test AI description generation on a standard Snowflake table first.
If you are unsure whether the issue is specific to semantic views or affects all assets, test the "Generate with AI" feature on a regular Snowflake table in the same instance. If that succeeds, the problem is isolated to semantic views and is most likely caused by the missing recipe configuration or permissions described above.
Additional Notes
- The AI description generation API (
/suggest_description) currently requiresschemaMetadataaspects to be present on the dataset entity. It is not possible to generate AI descriptions from a view definition alone without schema aspects being ingested. This is by design to allow schema and table descriptions to be produced in a single API call. - A database included in your recipe's
database_pattern.allowlist will still be skipped during ingestion if the Snowflake role lacksUSAGEprivileges on that database. The ingestion job may complete without errors even when databases are silently excluded — always validate thedatabases_scannedcount in run logs. - The generic Java runtime error message ("The AI service encountered an error") masks the true underlying cause. If you have access to DataHub Cloud support, request a review of integrations service logs at the time of failure to identify the specific exception (e.g.,
ShellEntityErrorfor a missing schema aspect, orTooManyColumnsErrorfor assets with an extremely large number of columns). - If your Snowflake semantic views are defined via dbt models, ensure that dbt model references are fully resolved during ingestion, as unresolved references can also result in missing column details.
- The
include_column_lineage: trueflag should be set on the Snowflake recipe, not the dbt recipe, when the goal is to ingest schema aspects for Snowflake semantic views.
Related Documentation
- Snowflake Connector — Prerequisites and Configuration
- AI-Powered Descriptions in DataHub
- Snowflake Semantic Views Ingestion
- Ingestion Recipe Configuration Reference
Tags: snowflake, semantic-views, ai-descriptions, generate-with-ai, schema-aspects, ingestion-permissions, column-lineage, schemaMetadata, snowflake-connector, ingestion-configuration