<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Synced table pipeline fails with permission denied for database in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/synced-table-pipeline-fails-with-permission-denied-for-database/m-p/165112#M55396</link>
    <description>&lt;P&gt;Environment: Azure Databricks, Lakebase Autoscaling project. Database created through the Lakebase UI by the project owner (audit log shows createProjectBranchDatabaseUI with a browser user agent). Synced tables created via the databricks_postgres_synced_table Terraform resource, provider 1.122.0, scheduling_policy = TRIGGERED, create_database_objects_if_missing = true.&lt;/P&gt;&lt;P&gt;Symptom: Synced tables are created successfully in Unity Catalog and Terraform reports success, but every pipeline's initial load fails and the Postgres tables are never created. Status is SYNCED_TABLE_OFFLINE_FAILED. The surfaced message is only:&lt;/P&gt;&lt;P&gt;[SYNCED_TABLE_ERROR] Synced table pipeline failure. Instance: &amp;lt;endpoint&amp;gt;. Please contact Databricks support.&lt;/P&gt;&lt;P&gt;The real cause is two levels deep in the pipeline events:&lt;/P&gt;&lt;P&gt;ERROR: permission denied for database "&amp;lt;mydb&amp;gt;"&lt;/P&gt;&lt;P&gt;What we ruled out: we recreated the synced tables under two different creator identities, both of which already had CONNECT and CREATE on the database. Both failed identically. That matches the documented behaviour that a synced table is owned by databricks_writer_&amp;lt;dbid&amp;gt; rather than by the creator, and that changing the pipeline's Run as identity doesn't reassign it. So the creator's privileges are not the issue.&lt;/P&gt;&lt;P&gt;Diagnosis: pg_database.datacl showed the database's own writer role missing CONNECT, while both reader roles had it:&lt;/P&gt;&lt;P&gt;databricks_writer_&amp;lt;oid&amp;gt; = C -- CREATE only, no CONNECT&lt;BR /&gt;databricks_reader_&amp;lt;oid&amp;gt; = c&lt;BR /&gt;databricks_reader_&amp;lt;other&amp;gt; = c&lt;BR /&gt;databricks_superuser = C*T*c*&lt;/P&gt;&lt;P&gt;SELECT oid FROM pg_database WHERE datname = '&amp;lt;mydb&amp;gt;' confirmed &amp;lt;oid&amp;gt; is this database, so that is the correct writer role for it.&lt;/P&gt;&lt;P&gt;No synced table had ever succeeded in this database — the only Databricks-owned table was __db_system.unity_catalog_registration_status.&lt;/P&gt;&lt;P&gt;Fix: granting the missing privilege, as a databricks_superuser member:&lt;/P&gt;&lt;P&gt;GRANT CONNECT ON DATABASE &amp;lt;mydb&amp;gt; TO databricks_writer_&amp;lt;oid&amp;gt;;&lt;/P&gt;&lt;P&gt;All three pipelines completed on the next trigger, with no other change, and row counts matched the source exactly.&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;1. Is it expected that a UI-created Lakebase database can have CREATE but not CONNECT on its own databricks_writer_&amp;lt;dbid&amp;gt; role? Or does this indicate a provisioning bug?&lt;BR /&gt;2. Is granting CONNECT to that role the supported fix, or is there a setup step we skipped? The docs warn that modifying system roles can affect instance behaviour, so I would rather not carry a workaround indefinitely.&lt;BR /&gt;3. Should this be a routine readiness check before adding a synced table to an existing database — particularly one created some time ago — and if so, is there a supported API for it rather than querying pg_database.datacl directly?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Aug 2026 17:43:47 GMT</pubDate>
    <dc:creator>KhaturiabPreet</dc:creator>
    <dc:date>2026-08-07T17:43:47Z</dc:date>
    <item>
      <title>Synced table pipeline fails with permission denied for database</title>
      <link>https://community.databricks.com/t5/data-engineering/synced-table-pipeline-fails-with-permission-denied-for-database/m-p/165112#M55396</link>
      <description>&lt;P&gt;Environment: Azure Databricks, Lakebase Autoscaling project. Database created through the Lakebase UI by the project owner (audit log shows createProjectBranchDatabaseUI with a browser user agent). Synced tables created via the databricks_postgres_synced_table Terraform resource, provider 1.122.0, scheduling_policy = TRIGGERED, create_database_objects_if_missing = true.&lt;/P&gt;&lt;P&gt;Symptom: Synced tables are created successfully in Unity Catalog and Terraform reports success, but every pipeline's initial load fails and the Postgres tables are never created. Status is SYNCED_TABLE_OFFLINE_FAILED. The surfaced message is only:&lt;/P&gt;&lt;P&gt;[SYNCED_TABLE_ERROR] Synced table pipeline failure. Instance: &amp;lt;endpoint&amp;gt;. Please contact Databricks support.&lt;/P&gt;&lt;P&gt;The real cause is two levels deep in the pipeline events:&lt;/P&gt;&lt;P&gt;ERROR: permission denied for database "&amp;lt;mydb&amp;gt;"&lt;/P&gt;&lt;P&gt;What we ruled out: we recreated the synced tables under two different creator identities, both of which already had CONNECT and CREATE on the database. Both failed identically. That matches the documented behaviour that a synced table is owned by databricks_writer_&amp;lt;dbid&amp;gt; rather than by the creator, and that changing the pipeline's Run as identity doesn't reassign it. So the creator's privileges are not the issue.&lt;/P&gt;&lt;P&gt;Diagnosis: pg_database.datacl showed the database's own writer role missing CONNECT, while both reader roles had it:&lt;/P&gt;&lt;P&gt;databricks_writer_&amp;lt;oid&amp;gt; = C -- CREATE only, no CONNECT&lt;BR /&gt;databricks_reader_&amp;lt;oid&amp;gt; = c&lt;BR /&gt;databricks_reader_&amp;lt;other&amp;gt; = c&lt;BR /&gt;databricks_superuser = C*T*c*&lt;/P&gt;&lt;P&gt;SELECT oid FROM pg_database WHERE datname = '&amp;lt;mydb&amp;gt;' confirmed &amp;lt;oid&amp;gt; is this database, so that is the correct writer role for it.&lt;/P&gt;&lt;P&gt;No synced table had ever succeeded in this database — the only Databricks-owned table was __db_system.unity_catalog_registration_status.&lt;/P&gt;&lt;P&gt;Fix: granting the missing privilege, as a databricks_superuser member:&lt;/P&gt;&lt;P&gt;GRANT CONNECT ON DATABASE &amp;lt;mydb&amp;gt; TO databricks_writer_&amp;lt;oid&amp;gt;;&lt;/P&gt;&lt;P&gt;All three pipelines completed on the next trigger, with no other change, and row counts matched the source exactly.&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;1. Is it expected that a UI-created Lakebase database can have CREATE but not CONNECT on its own databricks_writer_&amp;lt;dbid&amp;gt; role? Or does this indicate a provisioning bug?&lt;BR /&gt;2. Is granting CONNECT to that role the supported fix, or is there a setup step we skipped? The docs warn that modifying system roles can affect instance behaviour, so I would rather not carry a workaround indefinitely.&lt;BR /&gt;3. Should this be a routine readiness check before adding a synced table to an existing database — particularly one created some time ago — and if so, is there a supported API for it rather than querying pg_database.datacl directly?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Aug 2026 17:43:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/synced-table-pipeline-fails-with-permission-denied-for-database/m-p/165112#M55396</guid>
      <dc:creator>KhaturiabPreet</dc:creator>
      <dc:date>2026-08-07T17:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Synced table pipeline fails with permission denied for database</title>
      <link>https://community.databricks.com/t5/data-engineering/synced-table-pipeline-fails-with-permission-denied-for-database/m-p/165244#M55405</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/247171"&gt;@KhaturiabPreet&lt;/a&gt;&amp;nbsp; !&lt;/P&gt;&lt;P&gt;I like you analysis it made me do some reading this morning to freshen up my memory.&lt;/P&gt;&lt;P&gt;I checked the the doc and I can say that&amp;nbsp;databricks_writer_&amp;lt;dbid&amp;gt; being unable to CONNECT does not look like an expected state because it is the&amp;nbsp;system role used to create and manage synced tables&amp;nbsp;and synced tables themselves are owned by that role. .&lt;/P&gt;&lt;P&gt;The doc does not say that users need to manually grant CONNECT to databricks_writer_&amp;lt;dbid&amp;gt; as part of synced table setup since its prerequisites concern the Lakebase project, UC source and permissions&amp;nbsp;&amp;nbsp;create_database_objects_if_missing = true is also explicitly supported when creating the synced table&lt;A title="https://docs.databricks.com/aws/en/oltp/projects/sync-tables" href="https://docs.databricks.com/aws/en/oltp/projects/sync-tables" target="_self"&gt;https://docs.databricks.com/aws/en/oltp/projects/sync-tables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Therefore, given that the database was created through the Lakebase UI and every synced table failed until the writer privilege was corrected this looks much more like provisioning or bug than a skipped setup step.&lt;/P&gt;&lt;P&gt;Another thingGRANT CONNECT explains and fixes the failure but I would not consider manual modification of the system role the ideal long term configuration procedure as standard PostgreSQL GRANT commands are the documented mechanism for Lakebase database privileges including database privileges. however&amp;nbsp;databricks_writer_&amp;lt;dbid&amp;gt;&amp;nbsp;is categorized as a system managed role used by internal services.&amp;nbsp;&lt;/P&gt;&lt;P&gt;so this:&lt;/P&gt;&lt;PRE&gt;GRANT CONNECT ON DATABASE &amp;lt;database_name&amp;gt;
TO databricks_writer_&amp;lt;dbid&amp;gt;;&lt;/PRE&gt;&lt;P&gt;is a technically correct remediation in my opinion as demonstrated by all three pipelines immediately succeeding but I would open a DBKS support case and ask them to confirm whether that database was incorrectly provisioned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is another strong point supporting your case which is the documented behavior says changing the pipeline run as identity does not reassign synced table ownership so recreating under different user or SP identities would not fix an ACL problem on databricks_writer_&amp;lt;dbid&amp;gt;.&lt;/P&gt;&lt;P&gt;and yes checking effective CONNECT is a sensible temporary readiness check&amp;nbsp;especially for older or existing databases but I would avoid parsing pg_database.datacl directly and yoy have&amp;nbsp;has_database_privilege() specifically for checking database connection permissions.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;PRE&gt;SELECT
    has_database_privilege(
        'databricks_writer_&amp;lt;dbid&amp;gt;',
        '&amp;lt;database_name&amp;gt;',
        'CONNECT'
    ) AS writer_can_connect;&lt;/PRE&gt;&lt;P&gt;you could check both relevant database privileges:&lt;/P&gt;&lt;PRE&gt;SELECT
    has_database_privilege(
        'databricks_writer_&amp;lt;dbid&amp;gt;',
        '&amp;lt;database_name&amp;gt;',
        'CONNECT'
    ) AS writer_can_connect,
    has_database_privilege(
        'databricks_writer_&amp;lt;dbid&amp;gt;',
        '&amp;lt;database_name&amp;gt;',
        'CREATE'
    ) AS writer_can_create;&lt;/PRE&gt;&lt;P&gt;This is preferable to inspecting pg_database.datacl because it tests the effective permission&amp;nbsp;including inherited or public privileges rather than requiring your automation to interpret PostgreSQL ACL strings.&lt;/P&gt;&lt;P&gt;I didn't find anything in the doc until now a documented lakebase management API that exposes effective PostgreSQL database grants directly.&lt;/P&gt;&lt;P&gt;The lakebase Postgres REST API is primarily for infrastructure or resource management and DBKS distinguishes that API from actual database access. So I think for an automated readiness test today executing has_database_privilege() over a PostgreSQL connection is the cleaner supported approach.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2026 11:21:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/synced-table-pipeline-fails-with-permission-denied-for-database/m-p/165244#M55405</guid>
      <dc:creator>amirabedhiafi</dc:creator>
      <dc:date>2026-08-10T11:21:48Z</dc:date>
    </item>
  </channel>
</rss>

