C3W2: Couldn't grant presentation_zone access after using the Environment Clean Up Script

glue_job_arn = lf_utils.get_role_arn(iam_client,'de-c3w2a1-glue-role')
lf_utils.grant_data_location_access(lf_client, glue_job_arn, DATA_LOCATION_ARN)
lf_utils.grant_database_access(lf_client, glue_job_arn, CURATED_DATABASE_NAME)
lf_utils.grant_database_access(lf_client, glue_job_arn, PRESENTATION_DATABASE_NAME)

Getting the following output:

Output exceeds the size limit. Open the full output data in a text editor
INFO:root:Grant Data location access to: arn:aws:iam::975049954432: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)
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::975049954432: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::975049954432:role/de-c3w2a1-glue-role

Tried both “Reboot” and “Get latest version” both didn’t help.

Hello @calvinwy,

There was @arctica82 with the same issue if you follow this post. It seems it fixed after rebooting some times or wait a few hours for a new lab session. Hope it helps