In Assignment 2: Building a Data Lakehouse with AWS Lake Formation and Apache Iceberg Database Not found

When I tried to execute lf_utils.get_role_arn, I received below error message. But in assignment, it was mentioned that databases were created.

ERROR:root:Error details: Traceback (most recent call last):
File “/home/coder/project/scripts/lf_utils.py”, line 86, in grant_database_access
response_grant_permissions = lf_client.grant_permissions(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/coder/miniconda/lib/python3.11/site-packages/botocore/client.py”, line 553, in _api_call
return self._make_api_call(operation_name, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/coder/miniconda/lib/python3.11/site-packages/botocore/client.py”, line 1009, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.InvalidInputException: An error occurred (InvalidInputException) when calling the GrantPermissions operation: Database not found.
An error occurred (InvalidInputException) when calling the GrantPermissions operation: Database not found.

ERROR:root:Couldn’t grant curated_zone access: arn:aws:iam::891377191847:role/de-c3w2a1-glue-role

ERROR:root:Error details: Traceback (most recent call last):
File “/home/coder/project/scripts/lf_utils.py”, line 86, in grant_database_access
response_grant_permissions = lf_client.grant_permissions(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/coder/miniconda/lib/python3.11/site-packages/botocore/client.py”, line 553, in _api_call
return self._make_api_call(operation_name, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/coder/miniconda/lib/python3.11/site-packages/botocore/client.py”, line 1009, in _make_api_call
raise error_class(parsed_response, operation_name)

An error occurred (InvalidInputException) when calling the GrantPermissions operation: Database not found.

ERROR:root:Couldn’t grant presentation_zone access: arn:aws:iam::891377191847:role/de-c3w2a1-glue-role

Hello @arctica82,

I could reproduce the issue after I made changes to the databases names. Could you check you are using the correct names (curated_zone and presentation_zone). Hope it helps:

CURATED_DATABASE_NAME = 'curated_zone'
PRESENTATION_DATABASE_NAME = 'presentation_zone'

Here I get the the output from you issue:

Thanks. Will try it and let you know.

1 Like

Hello @arctica82,

After some closer inspection I can see that the names in your output looks correct. The difference in my output is that your issue might be when the client grant_permissions to the databases. Permissions issues could be fixed with this form that it takes 1-2 business days to process. Hope it helps

I just rebooted the project 2-3 times and at the end I was able to complete the assignment.

1 Like