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-1842] Error Management catch known errors [GCSBucketCreate] #1499

Conversation

psainics
Copy link
Contributor

@psainics psainics commented Jan 21, 2025

🍒 [cherrypick]

Commits :

PR:


Error Management catch known errors

Jira : PLUGIN-1842

Description

  • Remove unused imports
  • Error Management catch known errors

Code change

  • Modified GCSBucketCreate.java

Tests

  • Test Case (Try to create a bucket with no write access on it)
Raw Logs
2025-01-13 15:38:06,370 - ERROR [WorkflowDriver:i.c.c.i.a.r.w.WorkflowProgramController@90] - Workflow service 'workflow.default.GCS_BCREATE_TEST_RUN.DataPipelineWorkflow.3e5879da-d196-11ef-a658-000000579539' failed.
io.cdap.cdap.api.exception.WrappedStageException: Stage 'GCS Create' 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. [email protected] 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. [email protected] 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.GCSBucketCreate.run(GCSBucketCreate.java:143)
  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: [email protected] 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.GCSBucketCreate.run(GCSBucketCreate.java:137)
  ... 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" : "[email protected] 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" : "[email protected] 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

POST v3/namespaces/{namespace-id}/apps/{app-id}/workflows/DataPipelineWorkflow/runs/{run-id}/classify
[
{
  "stageName": "GCS Create",
  "errorCategory": "Plugin-'GCS Create'",
  "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. [email protected] 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 added the build Trigger unit test build label Jan 21, 2025
@psainics psainics self-assigned this Jan 21, 2025
@psainics psainics marked this pull request as ready for review January 21, 2025 11:57
@psainics psainics merged commit a53e16d into data-integrations:release/0.24 Jan 21, 2025
18 of 29 checks passed
@psainics psainics deleted the cherry-pick/bdd55f310c373d89b732930874fb2a2dec933a62 branch January 21, 2025 19:34
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