I'm investigating an issue with Azure Databricks Lakebase Autoscaling where synced tables are successfully created in Unity Catalog through Terraform, but their initial pipeline loads consistently fail.
The issue was eventually traced to a missing CONNECT privilege on the database-specific databricks_writer_<dbid> role.
Despite the database being created successfully through the Lakebase UI, its ACL showed that the writer role had CREATE but not CONNECT. Both reader roles had the expected CONNECT privilege.
Interestingly, recreating the synced tables under different creator identities made no difference. Both identities already had the necessary database permissions, confirming that the problem was not related to the creator's privileges.
The actual error was buried in the pipeline events:
ERROR: permission denied for database "<mydb>"
The fix was straightforward:
GRANT CONNECT ON DATABASE <mydb> TO databricks_writer_<oid>;
After applying this grant as a member of databricks_superuser, all three pipelines completed successfully on their next trigger, and the resulting row counts matched the source tables exactly. No other configuration changes were required.
I'd appreciate clarification from the Databricks team and anyone who has encountered similar behaviour:
Is it expected for a UI-created Lakebase database to provision its own writer role with CREATE but without CONNECT, or does this point to a provisioning bug?
Is manually granting CONNECT to the database-specific writer role an officially supported fix, or should another provisioning or initialization step have handled this automatically?
Should checking the writer role's database privileges be part of the standard readiness checks before configuring synced tables, especially for older databases?
Is there a supported API or diagnostic method to verify these permissions without directly querying pg_database.datacl?
One concern is that Databricks documentation warns against modifying system roles because doing so may affect instance behaviour. I'd prefer to understand whether this grant is safe and supported long-term rather than maintain an undocumented workaround.
Environment:
Azure Databricks
Lakebase Autoscaling
Terraform Databricks provider 1.122.0
Resource: databricks_postgres_synced_table
scheduling_policy = TRIGGERED
create_database_objects_if_missing = true
Initial status: SYNCED_TABLE_OFFLINE_FAILED