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

[🍒]Wrap error thrown in Storage Client #1503

Conversation

psainics
Copy link
Contributor

@psainics psainics commented Jan 21, 2025

🍒 [cherrypick]

Commits :

PR:

Ref : #1485 (comment) , #1488 (review)

Test

  • Test Case
Raw Logs

2025-01-17 12:56:57,592 - ERROR [WorkflowDriver:i.c.c.i.a.r.w.WorkflowProgramController@90] - Workflow service 'workflow.default.GCS_COPY_TEST_RUN.DataPipelineWorkflow.08d9c862-d4a4-11ef-9d3e-000000f7989a' failed.
io.cdap.cdap.api.exception.WrappedStageException: Stage 'GCS Copy' encountered : io.cdap.cdap.api.exception.ProgramFailureException: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
POST https://storage.googleapis.com/storage/v1/b?project=cdf-entcon&projection=full
{
"code" : 403,
"errors" : [ {
  "domain" : "global",
  "message" : "[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' denied on resource (or it may not exist).",
  "reason" : "forbidden"
} ],
"message" : "[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' 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: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
POST https://storage.googleapis.com/storage/v1/b?project=cdf-entcon&projection=full
{
"code" : 403,
"errors" : [ {
  "domain" : "global",
  "message" : "[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' denied on resource (or it may not exist).",
  "reason" : "forbidden"
} ],
"message" : "[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' 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:198)
  at io.cdap.plugin.gcp.common.GCPErrorDetailsProviderUtil.getProgramFailureException(GCPErrorDetailsProviderUtil.java:65)
  at io.cdap.plugin.gcp.common.GCPErrorDetailsProviderUtil.getHttpResponseExceptionDetailsFromChain(GCPErrorDetailsProviderUtil.java:83)
  at io.cdap.plugin.gcp.gcs.StorageClient.createBucketIfNotExists(StorageClient.java:142)
  at io.cdap.plugin.gcp.gcs.actions.GCSCopy.run(GCSCopy.java:79)
  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.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
POST https://storage.googleapis.com/storage/v1/b?project=cdf-entcon&projection=full
{
"code" : 403,
"errors" : [ {
  "domain" : "global",
  "message" : "[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' denied on resource (or it may not exist).",
  "reason" : "forbidden"
} ],
"message" : "[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' 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.create(HttpStorageRpc.java:273)
  at com.google.cloud.storage.StorageImpl.lambda$create$0(StorageImpl.java:125)
  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.create(StorageImpl.java:124)
  at io.cdap.plugin.gcp.common.GCPUtils.createBucket(GCPUtils.java:297)
  at io.cdap.plugin.gcp.gcs.StorageClient.createBucketIfNotExists(StorageClient.java:130)
  ... 14 common frames omitted

POST v3/namespaces/{namespace-id}/apps/{app-id}/workflows/DataPipelineWorkflow/runs/{run-id}/classify
[
{
  "stageName": "GCS Copy",
  "errorCategory": "Plugin-'GCS Copy'",
  "errorReason": "403 Forbidden. Please check you have permission to access this resource. For more details, see https://cloud.google.com/storage/docs/json_api/v1/status-codes",
  "errorMessage": "com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden\nPOST https://storage.googleapis.com/storage/v1/b?project=cdf-entcon&projection=full\n{\n  \"code\" : 403,\n  \"errors\" : [ {\n    \"domain\" : \"global\",\n    \"message\" : \"[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' denied on resource (or it may not exist).\",\n    \"reason\" : \"forbidden\"\n  } ],\n  \"message\" : \"[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' denied on resource (or it may not exist).\"\n}",
  "errorType": "USER",
  "dependency": "true",
  "errorCodeType": "HTTP",
  "errorCode": "403",
  "supportedDocumentationUrl": "https://cloud.google.com/storage/docs/json_api/v1/status-codes"
}
]
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 17:26
@psainics psainics force-pushed the cherry-pick/083b4308a9a8624519ebe012659c5ede9ffd749b branch from 1fe46d9 to e458e88 Compare January 21, 2025 19:37
@psainics psainics merged commit fa29dca into data-integrations:release/0.24 Jan 22, 2025
16 checks passed
@psainics psainics deleted the cherry-pick/083b4308a9a8624519ebe012659c5ede9ffd749b branch January 22, 2025 00:40
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