Open dsmdavid opened 1 month ago
Thanks for the detailed report. For configs like this, Titan uses your grant config to decide how to handle custom owners. But I don't think it handles role trees currently.
I will repro locally and get a fix in an upcoming release.
I have an initial fix, but it still causes errors occasionally. Going to take a second look next week.
I think I'm running into a similar issue. Starting from scratch on a brand new account - have my confing yml completed. I have databases set in the config yml, but get an error that it is trying to grant to the role without ever creating the database:
[garrett:ACCOUNTADMIN] > SHOW ROLES IN ACCOUNT (6 rows, 0.40s)
[garrett:ACCOUNTADMIN] > SHOW WAREHOUSES IN ACCOUNT (2 rows, 0.15s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE REPORTER (empty, 0.16s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE DEVELOPER (empty, 0.14s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE PROD_W (empty, 0.19s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE DEV_W (empty, 0.21s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE STAGE_W (empty, 0.16s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE CICD_W (empty, 0.19s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE RAW_DEV_W (empty, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE RAW_W (empty, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE PROD_R (empty, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE DEV_R (empty, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE STAGE_R (empty, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE CICD_R (empty, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE RAW_R (empty, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS TO ROLE RAW_DEV_R (empty, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE PROD_R (err 2003, 0.17s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE PROD_R (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE DEV_R (err 2003, 0.27s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE DEV_R (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE STAGE_R (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE STAGE_R (err 2003, 0.17s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE CICD_R (err 2003, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE CICD_R (err 2003, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE RAW_R (err 2003, 0.18s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE RAW_R (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE RAW_DEV_R (err 2003, 0.17s)
[garrett:ACCOUNTADMIN] > SHOW FUTURE GRANTS TO ROLE RAW_DEV_R (err 2003, 0.22s)
[garrett:ACCOUNTADMIN] > SHOW DATABASES IN ACCOUNT (2 rows, 0.15s)
[garrett:ACCOUNTADMIN] > SHOW SCHEMAS IN ACCOUNT (27 rows, 0.35s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE PROD (err 2003, 0.15s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE PROD (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE DEV (err 2003, 0.15s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE DEV (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE STAGE (err 2003, 0.14s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE STAGE (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE RAW (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE RAW (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE RAW_DEV (err 2003, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE RAW_DEV (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE CICD (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW DATABASE ROLES IN DATABASE CICD (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE RAW_R (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE RAW_W (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE RAW_DEV_R (err 2003, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE RAW_DEV_W (err 2003, 0.15s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE DEV_R (err 2003, 0.15s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE DEV_W (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE PROD_R (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE PROD_W (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE STAGE_R (err 2003, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE STAGE_W (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE CICD_R (err 2003, 0.11s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE CICD_W (err 2003, 0.16s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE DEVELOPER (err 2003, 0.12s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE SECURITYADMIN (1 rows, 0.14s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE USERADMIN (1 rows, 0.21s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE ACCOUNTADMIN (1 rows, 0.14s)
[garrett:ACCOUNTADMIN] > SHOW GRANTS OF ROLE SYSADMIN (1 rows, 0.13s)
[garrett:ACCOUNTADMIN] > SHOW USERS IN ACCOUNT (2 rows, 0.14s)```
```titan.exceptions.MissingResourceException: Resource urn::<ROLE NAME> required by <ROLE NAME>?priv=ALL&on=database/PROD not found or failed to fetch```
Maybe there's an issue with my yml file?
I can make the dbs quickly enough, but expected them to be created for me.
Clarifying on this, my yml is setup:
edit: making all the database roles regular roles seems to have worked.
@GJMcClintock can you confirm which version of Titan you're on?
@teej 0.10.13 - just installed today
[titan-core=0.9.1] Not sure if it's a bug or if I'm missing something. I have a yaml configuration that contains
that fails with an error
Insufficient privileges to operate on database 'TRANSFORM_TITAN'
when trying to create one of the schemas (different one each time) in one of the databases that is owned by a custom role. e.g.[titanadmin:SYSADMIN] > CREATE SCHEMA TRANSFORM_TITAN.MART_FINANCE DATA_RETENTION_TIME_IN_DAYS = 1 MAX_DATA_EXTENSION_TIME_IN_DAYS = 14 (err 3001, 0.10s)
If I make a copy of that configuration and remove everything after role_grants, the first run succeeds. If I now run again the original configuration, it also succeeds.
What I think it's happening is that the order of the statements is something like:
sysadmin
before therole_grants
have been executed.If the above is correct, not sure if it's a resource lineage not tracked or if it could be solved by creating roles first, then role_grants then everything else.
Below I paste the config file that is showing the error. Apologies for the long file -- I tried minimizing the config but then the error was not reproducible all the time (sometimes it errored, sometimes it didn't), so I have just removed everything after
databases
but left the roles and role_grants.