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

[CDAP-21070] Introduce error details provider to get more information about exceptions from plugins #15720

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

itsankit-google
Copy link
Member

@itsankit-google itsankit-google commented Oct 9, 2024

Tested in CDAP Sandbox:

GCS Source

Caused by: io.cdap.cdap.api.exception.WrappedStageException: Stage 'NYT Best Sellers Raw Data' encountered : io.cdap.cdap.api.exception.ProgramFailureException: Error occurred in the phase: 'Splitting'. Error message: xxxxx.iam.gserviceaccount.com does not have storage.objects.list access to the Google Cloud Storage bucket. Permission 'storage.objects.list' denied on resource (or it may not exist).
	at io.cdap.cdap.etl.common.ErrorDetails.handleException(ExceptionUtils.java:77)
	at io.cdap.cdap.etl.spark.io.StageTrackingInputFormat.getSplits(StageTrackingInputFormat.java:55)
	at org.apache.spark.rdd.NewHadoopRDD.getPartitions(NewHadoopRDD.scala:136)
	..................................
Caused by: io.cdap.cdap.api.exception.ProgramFailureException: Error occurred in the phase: 'Splitting'. Error message: xxxxxx.iam.gserviceaccount.com does not have storage.objects.list access to the Google Cloud Storage bucket. Permission 'storage.objects.list' denied on resource (or it may not exist).
	at io.cdap.cdap.api.exception.ProgramFailureException$Builder.build(ProgramFailureException.java:186)
	at io.cdap.cdap.api.exception.ErrorUtils.getProgramFailureException(ErrorUtils.java:161)
	at io.cdap.plugin.gcp.common.GCPErrorDetailsProvider.getProgramFailureException(GCPErrorDetailsProvider.java:80)
	at io.cdap.plugin.gcp.common.GCPErrorDetailsProvider.getExceptionDetails(GCPErrorDetailsProvider.java:52)
	at io.cdap.cdap.etl.common.ErrorDetails.handleException(ExceptionUtils.java:75)
	... 66 common frames omitted
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
GET https://storage.googleapis.com/storage/v1/b/cdf_example/o?delimiter=/&fields=items(bucket,name,size,updated),prefixes,nextPageToken&includeTrailingDelimiter=true&maxResults=5000
{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "message" : "xxxxxx.iam.gserviceaccount.com does not have storage.objects.list access to the Google Cloud Storage bucket. Permission 'storage.objects.list' denied on resource (or it may not exist).",
    "reason" : "forbidden"
  } ],
  "message" : "xxxxx.iam.gserviceaccount.com does not have storage.objects.list access to the Google Cloud Storage bucket. Permission 'storage.objects.list' 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)

GCS Sink

Caused by: io.cdap.cdap.api.exception.WrappedStageException: Stage 'GCS2' encountered : io.cdap.cdap.api.exception.ProgramFailureException: Error occurred in the phase: 'Validating Output Specs'. Error message: xxxxx.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).
	at io.cdap.cdap.etl.common.ExceptionUtils.handleException(ExceptionUtils.java:77)
	at io.cdap.cdap.etl.spark.io.StageTrackingOutputFormat.checkOutputSpecs(StageTrackingOutputFormat.java:67)
	at io.cdap.cdap.etl.common.output.MultiOutputFormat.checkOutputSpecs(MultiOutputFormat.java:114)
	.......................................
Caused by: io.cdap.cdap.api.exception.ProgramFailureException: Error occurred in the phase: 'Validating Output Specs'. Error message: xxxxxxxx.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).
	at io.cdap.cdap.api.exception.ProgramFailureException$Builder.build(ProgramFailureException.java:186)
	at io.cdap.cdap.api.exception.ErrorUtils.getProgramFailureException(ErrorUtils.java:161)
	at io.cdap.plugin.gcp.common.GCPErrorDetailsProvider.getProgramFailureException(GCPErrorDetailsProvider.java:80)
	at io.cdap.plugin.gcp.common.GCPErrorDetailsProvider.getExceptionDetails(GCPErrorDetailsProvider.java:52)
	at io.cdap.cdap.etl.common.ErrorDetails.handleException(ExceptionUtils.java:75)
	... 47 common frames omitted
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
GET https://storage.googleapis.com/storage/v1/b/cdf_example/o/2024-10-15-08-53?fields=bucket,name,timeCreated,updated,generation,metageneration,size,contentType,contentEncoding,md5Hash,crc32c,metadata
{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "message" : "xxxxxx.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).",
    "reason" : "forbidden"
  } ],
  "message" : "xxxxxxxxx.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.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)

GCS Multi Sink

Caused by: io.cdap.cdap.api.exception.WrappedStageException: Stage 'GCS Multi File' encountered : io.cdap.cdap.api.exception.ProgramFailureException: Error occurred in the phase: 'Committing'. Error message: xxxxx.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).
	at io.cdap.cdap.etl.common.ExceptionUtils.handleException(ExceptionUtils.java:77)
	at io.cdap.cdap.etl.spark.io.StageTrackingOutputCommitter.setupJob(StageTrackingOutputCommitter.java:57)
	at org.apache.spark.internal.io.HadoopMapReduceCommitProtocol.setupJob(HadoopMapReduceCommitProtocol.scala:188)
	...............
Caused by: io.cdap.cdap.api.exception.ProgramFailureException: Error occurred in the phase: 'Committing'. Error message: xxxxxx.iam.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).
	at io.cdap.cdap.api.exception.ProgramFailureException$Builder.build(ProgramFailureException.java:186)
	at io.cdap.cdap.api.exception.ErrorUtils.getProgramFailureException(ErrorUtils.java:161)
	at io.cdap.plugin.gcp.common.GCPErrorDetailsProvider.getProgramFailureException(GCPErrorDetailsProvider.java:80)
	at io.cdap.plugin.gcp.common.GCPErrorDetailsProvider.getExceptionDetails(GCPErrorDetailsProvider.java:52)
	at io.cdap.cdap.etl.common.ErrorDetails.handleException(ExceptionUtils.java:75)
	... 47 common frames omitted
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: null
	at com.google.cloud.hadoop.gcsio.GoogleCloudStorageExceptions.createJsonResponseException(GoogleCloudStorageExceptions.java:89)
	at com.google.cloud.hadoop.gcsio.GoogleCloudStorageImpl$9.onFailure(GoogleCloudStorageImpl.java:1944)
	at com.google.cloud.hadoop.gcsio.BatchHelper.execute(BatchHelper.java:199)
	at com.google.cloud.hadoop.gcsio.BatchHelper.lambda$queue$0(BatchHelper.java:178)
	

@itsankit-google itsankit-google force-pushed the CDAP-21070-error-details-provider-2 branch 3 times, most recently from c2f64d2 to 9d07fa9 Compare October 15, 2024 06:53
@itsankit-google itsankit-google force-pushed the CDAP-21070-error-details-provider-2 branch from 9d07fa9 to 91d3ba5 Compare October 16, 2024 05:26
Copy link

sonarcloud bot commented Oct 16, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
47.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@itsankit-google itsankit-google merged commit 1013fbe into develop Oct 16, 2024
10 of 11 checks passed
@itsankit-google itsankit-google deleted the CDAP-21070-error-details-provider-2 branch October 16, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Triggers github actions build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants