Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLUGIN-1840] Error Management catch known errors [GCSBucketDelete] #1487

Merged

Conversation

psainics
Copy link
Contributor

@psainics psainics commented Jan 13, 2025

Error Management catch known errors [GCSBucketDelete]

Jira : PLUGIN-1840

Description

Error Management catch known errors [GCSBucketDelete]

Code change

  • Modified GCSBucketDelete.java

Test

  • Test Case (Try to delete a bucket with no write access on it)
Raw Logs
2025-01-13 14:33:32,389 - ERROR [WorkflowDriver:i.c.c.i.a.r.w.WorkflowProgramController@90] - Workflow service 'workflow.default.GCS_BDEL_TEST_RUN.DataPipelineWorkflow.3bd91107-d18d-11ef-b116-000000b83ec7' failed.
io.cdap.cdap.api.exception.WrappedStageException: Stage 'GCS Delete' encountered : io.cdap.cdap.api.exception.ProgramFailureException: Unable to access or create bucket this_is_not_my_bucket. Ensure you entered the correct bucket path and have permissions for it. e2e-integration-tests@cdf-entcon.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist).
  at io.cdap.cdap.etl.common.plugin.ExceptionWrappingCaller.call(ExceptionWrappingCaller.java:64)
  at io.cdap.cdap.etl.common.plugin.WrappedAction.run(WrappedAction.java:48)
  at io.cdap.cdap.etl.batch.customaction.PipelineAction.run(PipelineAction.java:91)
  at io.cdap.cdap.internal.app.runtime.AbstractContext.execute(AbstractContext.java:608)
  at io.cdap.cdap.internal.app.runtime.workflow.CustomActionExecutor.execute(CustomActionExecutor.java:90)
  at io.cdap.cdap.internal.app.runtime.workflow.WorkflowDriver.executeCustomAction(WorkflowDriver.java:449)
  at io.cdap.cdap.internal.app.runtime.workflow.WorkflowDriver.executeNode(WorkflowDriver.java:489)
  at io.cdap.cdap.internal.app.runtime.workflow.WorkflowDriver.executeAll(WorkflowDriver.java:669)
  at io.cdap.cdap.internal.app.runtime.workflow.WorkflowDriver.run(WorkflowDriver.java:653)
  at com.google.common.util.concurrent.AbstractExecutionThreadService$1$1.run(AbstractExecutionThreadService.java:52)
  at java.lang.Thread.run(Thread.java:750)
Caused by: io.cdap.cdap.api.exception.ProgramFailureException: Unable to access or create bucket this_is_not_my_bucket. Ensure you entered the correct bucket path and have permissions for it. e2e-integration-tests@cdf-entcon.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist).
  at io.cdap.cdap.api.exception.ProgramFailureException$Builder.build(ProgramFailureException.java:236)
  at io.cdap.cdap.api.exception.ErrorUtils.getProgramFailureException(ErrorUtils.java:161)
  at io.cdap.plugin.gcp.gcs.actions.GCSBucketDelete.run(GCSBucketDelete.java:116)
  at io.cdap.cdap.etl.common.plugin.WrappedAction.lambda$run$1(WrappedAction.java:49)
  at io.cdap.cdap.etl.common.plugin.Caller$1.call(Caller.java:30)
  at io.cdap.cdap.etl.common.plugin.ExceptionWrappingCaller.call(ExceptionWrappingCaller.java:62)
  ... 10 common frames omitted
Caused by: com.google.cloud.storage.StorageException: e2e-integration-tests@cdf-entcon.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist).
  at com.google.cloud.storage.spi.v1.HttpStorageRpc.translate(HttpStorageRpc.java:233)
  at com.google.cloud.storage.spi.v1.HttpStorageRpc.get(HttpStorageRpc.java:425)
  at com.google.cloud.storage.StorageImpl.lambda$get$4(StorageImpl.java:264)
  at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105)
  at com.google.cloud.RetryHelper.run(RetryHelper.java:76)
  at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50)
  at com.google.cloud.storage.Retrying.run(Retrying.java:51)
  at com.google.cloud.storage.StorageImpl.run(StorageImpl.java:1374)
  at com.google.cloud.storage.StorageImpl.get(StorageImpl.java:263)
  at io.cdap.plugin.gcp.gcs.actions.GCSBucketDelete.run(GCSBucketDelete.java:110)
  ... 13 common frames omitted
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
GET https://storage.googleapis.com/storage/v1/b/this_is_not_my_bucket?projection=full
{
"code" : 403,
"errors" : [ {
  "domain" : "global",
  "message" : "e2e-integration-tests@cdf-entcon.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist).",
  "reason" : "forbidden"
} ],
"message" : "e2e-integration-tests@cdf-entcon.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist)."
}
  at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
  at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:118)
  at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:37)
  at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:428)
  at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1111)
  at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:514)
  at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:455)
  at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:565)
  at com.google.cloud.storage.spi.v1.HttpStorageRpc.get(HttpStorageRpc.java:422)
  ... 21 common frames omitted
2025-01-13 14:33:32,390 - DEBUG [WorkflowDriver:i.c.c.c.l.c.UncaughtExceptionHandler@40] - Uncaught exception in thread Thread[WorkflowDriver,5,main]

POST v3/namespaces/{namespace-id}/apps/{app-id}/workflows/DataPipelineWorkflow/runs/{run-id}/classify
[
{
  "stageName": "GCS Delete",
  "errorCategory": "Plugin-'GCS Delete'",
  "errorReason": "Unable to access or create bucket this_is_not_my_bucket. Ensure you entered the correct bucket path and have permissions for it.",
  "errorMessage": "Unable to access or create bucket this_is_not_my_bucket. Ensure you entered the correct bucket path and have permissions for it. e2e-integration-tests@cdf-entcon.iam.gserviceaccount.com does not have storage.buckets.get access to the Google Cloud Storage bucket. Permission 'storage.buckets.get' denied on resource (or it may not exist).",
  "errorType": "USER",
  "dependency": "true"
}
]

image
image

@psainics psainics self-assigned this Jan 13, 2025
@psainics psainics added the build Trigger unit test build label Jan 13, 2025
@psainics psainics marked this pull request as ready for review January 13, 2025 10:56
Copy link
Member

@itsankit-google itsankit-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar comment as in PR #1488.

@psainics psainics force-pushed the fem/action/GCSBucketDelete branch from c40019d to 1668c48 Compare January 17, 2025 05:14
@psainics psainics force-pushed the fem/action/GCSBucketDelete branch from 1668c48 to 5629eef Compare January 21, 2025 08:03
@psainics psainics merged commit ce050bb into data-integrations:develop Jan 21, 2025
15 of 16 checks passed
@psainics psainics deleted the fem/action/GCSBucketDelete branch January 21, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Trigger unit test build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants