You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a schema already exists in the database, dbt should not try to create the schema. While dbt does use create schema if not exists..., this query will fail if the user does not have permissions to create schemas on the database. dbt's schema creation code accounts for this, but it looks like a bug slipped into the pre-release of 0.16.0 (thanks for the heads up @eogilvy12!)
This regression manifests as:
ERROR: permission denied for database analytics
at the start of the run.
Steps To Reproduce
Create a user without create permissions on the database.
create user drew_noaccess; # must not be a superuser!
revoke create on database analytics from drew_noaccess;
Run dbt using this user, targeting a schema that already exists:
$ dbt run
...
ERROR: permission denied for database analytics
Cause
I think this only happens when database (and maybe schema?) quoting is enabled in a project.
It looks like dbt correctly runs the queries to find schemas in the given database, but we've got an extra pair of quotes in the database name that (while appropriate for an information schema query[1]) break during the in-memory check for existing schemas[2]
Via:
Describe the bug
If a schema already exists in the database, dbt should not try to create the schema. While dbt does use
create schema if not exists...
, this query will fail if the user does not have permissions to create schemas on the database. dbt's schema creation code accounts for this, but it looks like a bug slipped into the pre-release of 0.16.0 (thanks for the heads up @eogilvy12!)This regression manifests as:
at the start of the run.
Steps To Reproduce
Cause
I think this only happens when database (and maybe schema?) quoting is enabled in a project.
It looks like dbt correctly runs the queries to find schemas in the given database, but we've got an extra pair of quotes in the database name that (while appropriate for an information schema query[1]) break during the in-memory check for existing schemas[2]
Via:
[1]
https://github.com/fishtown-analytics/dbt/blob/a259f154dae60009b2115189f21ca1ed61061456/core/dbt/task/runnable.py#L405-L409
[2]
https://github.com/fishtown-analytics/dbt/blob/a259f154dae60009b2115189f21ca1ed61061456/core/dbt/task/runnable.py#L445-L450
The text was updated successfully, but these errors were encountered: