'Unable to Verify that GCS bucket and PKIX path building failed Errors in Creating and staging GCP Dataflow template
I am creating and staging gcp dataflow template in cloud storage with following command:
mvn -X compile exec:java -Dexec.mainClass=main.java.TemplatePipeline -Dexec.args="--runner=DataflowRunner --project=hv-hcap-development --stagingLocation=gs://my-bucket/staging --templateLocation=gs://my-bucket/templates/template1"
The build is failing with following error
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.563 s
[INFO] Finished at: 2020-07-17T17:32:05-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project dataflow-template: An exception occured while executing the Java class. Failed to construct instance from factory method DataflowRunner#fromOptions(interface org.apache.beam.sdk.options.PipelineOptions): InvocationTargetException: Unable to verify that GCS bucket gs://bucket-df-job exists. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (default-cli) on project dataflow-template: An exception occured while executing the Java class. Failed to construct instance from factory method DataflowRunner#fromOptions(interface org.apache.beam.sdk.options.PipelineOptions)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: An exception occured while executing the Java class. Failed to construct instance from factory method DataflowRunner#fromOptions(interface org.apache.beam.sdk.options.PipelineOptions)
at org.codehaus.mojo.exec.ExecJavaMojo.execute (ExecJavaMojo.java:311)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.RuntimeException: Failed to construct instance from factory method DataflowRunner#fromOptions(interface org.apache.beam.sdk.options.PipelineOptions)
at org.apache.beam.sdk.util.InstanceBuilder.buildFromMethod (InstanceBuilder.java:224)
at org.apache.beam.sdk.util.InstanceBuilder.build (InstanceBuilder.java:155)
at org.apache.beam.sdk.PipelineRunner.fromOptions (PipelineRunner.java:55)
at org.apache.beam.sdk.Pipeline.create (Pipeline.java:149)
at main.java.TemplatePipeline.main (TemplatePipeline.java:95)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:748)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.beam.sdk.util.InstanceBuilder.buildFromMethod (InstanceBuilder.java:214)
at org.apache.beam.sdk.util.InstanceBuilder.build (InstanceBuilder.java:155)
at org.apache.beam.sdk.PipelineRunner.fromOptions (PipelineRunner.java:55)
at org.apache.beam.sdk.Pipeline.create (Pipeline.java:149)
at main.java.TemplatePipeline.main (TemplatePipeline.java:95)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:748)
Caused by: java.lang.RuntimeException: Unable to verify that GCS bucket gs://bucket-df-job exists.
at org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator.verifyPathIsAccessible (GcsPathValidator.java:86)
at org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator.validateOutputFilePrefixSupported (GcsPathValidator.java:53)
at org.apache.beam.runners.dataflow.DataflowRunner.fromOptions (DataflowRunner.java:274)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.beam.sdk.util.InstanceBuilder.buildFromMethod (InstanceBuilder.java:214)
at org.apache.beam.sdk.util.InstanceBuilder.build (InstanceBuilder.java:155)
at org.apache.beam.sdk.PipelineRunner.fromOptions (PipelineRunner.java:55)
at org.apache.beam.sdk.Pipeline.create (Pipeline.java:149)
at main.java.TemplatePipeline.main (TemplatePipeline.java:95)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:748)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException (Alerts.java:198)
at sun.security.ssl.SSLSocketImpl.fatal (SSLSocketImpl.java:1967)
at sun.security.ssl.Handshaker.fatalSE (Handshaker.java:331)
at sun.security.ssl.Handshaker.fatalSE (Handshaker.java:325)
at sun.security.ssl.ClientHandshaker.serverCertificate (ClientHandshaker.java:1689)
at sun.security.ssl.ClientHandshaker.processMessage (ClientHandshaker.java:226)
at sun.security.ssl.Handshaker.processLoop (Handshaker.java:1082)
at sun.security.ssl.Handshaker.process_record (Handshaker.java:1010)
at sun.security.ssl.SSLSocketImpl.readRecord (SSLSocketImpl.java:1079)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake (SSLSocketImpl.java:1388)
at sun.security.ssl.SSLSocketImpl.startHandshake (SSLSocketImpl.java:1416)
at sun.security.ssl.SSLSocketImpl.startHandshake (SSLSocketImpl.java:1400)
at sun.net.www.protocol.https.HttpsClient.afterConnect (HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect (AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0 (HttpURLConnection.java:1340)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream (HttpURLConnection.java:1315)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream (HttpsURLConnectionImpl.java:264)
at com.google.api.client.http.javanet.NetHttpRequest.execute (NetHttpRequest.java:113)
at com.google.api.client.http.javanet.NetHttpRequest.execute (NetHttpRequest.java:84)
at com.google.api.client.http.HttpRequest.execute (HttpRequest.java:1012)
at com.google.auth.oauth2.UserCredentials.refreshAccessToken (UserCredentials.java:203)
at com.google.auth.oauth2.OAuth2Credentials.refresh (OAuth2Credentials.java:157)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata (OAuth2Credentials.java:145)
at com.google.auth.oauth2.UserCredentials.getRequestMetadata (UserCredentials.java:281)
at com.google.auth.http.HttpCredentialsAdapter.initialize (HttpCredentialsAdapter.java:91)
at com.google.cloud.hadoop.util.ChainingHttpRequestInitializer.initialize (ChainingHttpRequestInitializer.java:52)
at com.google.api.client.http.HttpRequestFactory.buildRequest (HttpRequestFactory.java:88)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest (AbstractGoogleClientRequest.java:422)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed (AbstractGoogleClientRequest.java:541)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed (AbstractGoogleClientRequest.java:474)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute (AbstractGoogleClientRequest.java:591)
at com.google.cloud.hadoop.util.ResilientOperation$AbstractGoogleClientRequestExecutor.call (ResilientOperation.java:171)
at com.google.cloud.hadoop.util.ResilientOperation.retry (ResilientOperation.java:67)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.getBucket (GcsUtil.java:521)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.bucketAccessible (GcsUtil.java:509)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.bucketAccessible (GcsUtil.java:482)
at org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator.verifyPathIsAccessible (GcsPathValidator.java:83)
at org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator.validateOutputFilePrefixSupported (GcsPathValidator.java:53)
at org.apache.beam.runners.dataflow.DataflowRunner.fromOptions (DataflowRunner.java:274)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.beam.sdk.util.InstanceBuilder.buildFromMethod (InstanceBuilder.java:214)
at org.apache.beam.sdk.util.InstanceBuilder.build (InstanceBuilder.java:155)
at org.apache.beam.sdk.PipelineRunner.fromOptions (PipelineRunner.java:55)
at org.apache.beam.sdk.Pipeline.create (Pipeline.java:149)
at main.java.TemplatePipeline.main (TemplatePipeline.java:95)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:748)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild (PKIXValidator.java:450)
at sun.security.validator.PKIXValidator.engineValidate (PKIXValidator.java:317)
at sun.security.validator.Validator.validate (Validator.java:262)
at sun.security.ssl.X509TrustManagerImpl.validate (X509TrustManagerImpl.java:330)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted (X509TrustManagerImpl.java:227)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted (X509TrustManagerImpl.java:132)
at sun.security.ssl.ClientHandshaker.serverCertificate (ClientHandshaker.java:1671)
at sun.security.ssl.ClientHandshaker.processMessage (ClientHandshaker.java:226)
at sun.security.ssl.Handshaker.processLoop (Handshaker.java:1082)
at sun.security.ssl.Handshaker.process_record (Handshaker.java:1010)
at sun.security.ssl.SSLSocketImpl.readRecord (SSLSocketImpl.java:1079)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake (SSLSocketImpl.java:1388)
at sun.security.ssl.SSLSocketImpl.startHandshake (SSLSocketImpl.java:1416)
at sun.security.ssl.SSLSocketImpl.startHandshake (SSLSocketImpl.java:1400)
at sun.net.www.protocol.https.HttpsClient.afterConnect (HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect (AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0 (HttpURLConnection.java:1340)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream (HttpURLConnection.java:1315)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream (HttpsURLConnectionImpl.java:264)
at com.google.api.client.http.javanet.NetHttpRequest.execute (NetHttpRequest.java:113)
at com.google.api.client.http.javanet.NetHttpRequest.execute (NetHttpRequest.java:84)
at com.google.api.client.http.HttpRequest.execute (HttpRequest.java:1012)
at com.google.auth.oauth2.UserCredentials.refreshAccessToken (UserCredentials.java:203)
at com.google.auth.oauth2.OAuth2Credentials.refresh (OAuth2Credentials.java:157)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata (OAuth2Credentials.java:145)
at com.google.auth.oauth2.UserCredentials.getRequestMetadata (UserCredentials.java:281)
at com.google.auth.http.HttpCredentialsAdapter.initialize (HttpCredentialsAdapter.java:91)
at com.google.cloud.hadoop.util.ChainingHttpRequestInitializer.initialize (ChainingHttpRequestInitializer.java:52)
at com.google.api.client.http.HttpRequestFactory.buildRequest (HttpRequestFactory.java:88)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest (AbstractGoogleClientRequest.java:422)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed (AbstractGoogleClientRequest.java:541)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed (AbstractGoogleClientRequest.java:474)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute (AbstractGoogleClientRequest.java:591)
at com.google.cloud.hadoop.util.ResilientOperation$AbstractGoogleClientRequestExecutor.call (ResilientOperation.java:171)
at com.google.cloud.hadoop.util.ResilientOperation.retry (ResilientOperation.java:67)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.getBucket (GcsUtil.java:521)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.bucketAccessible (GcsUtil.java:509)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.bucketAccessible (GcsUtil.java:482)
at org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator.verifyPathIsAccessible (GcsPathValidator.java:83)
at org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator.validateOutputFilePrefixSupported (GcsPathValidator.java:53)
at org.apache.beam.runners.dataflow.DataflowRunner.fromOptions (DataflowRunner.java:274)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.beam.sdk.util.InstanceBuilder.buildFromMethod (InstanceBuilder.java:214)
at org.apache.beam.sdk.util.InstanceBuilder.build (InstanceBuilder.java:155)
at org.apache.beam.sdk.PipelineRunner.fromOptions (PipelineRunner.java:55)
at org.apache.beam.sdk.Pipeline.create (Pipeline.java:149)
at main.java.TemplatePipeline.main (TemplatePipeline.java:95)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:748)
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build (SunCertPathBuilder.java:141)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild (SunCertPathBuilder.java:126)
at java.security.cert.CertPathBuilder.build (CertPathBuilder.java:280)
at sun.security.validator.PKIXValidator.doBuild (PKIXValidator.java:445)
at sun.security.validator.PKIXValidator.engineValidate (PKIXValidator.java:317)
at sun.security.validator.Validator.validate (Validator.java:262)
at sun.security.ssl.X509TrustManagerImpl.validate (X509TrustManagerImpl.java:330)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted (X509TrustManagerImpl.java:227)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted (X509TrustManagerImpl.java:132)
at sun.security.ssl.ClientHandshaker.serverCertificate (ClientHandshaker.java:1671)
at sun.security.ssl.ClientHandshaker.processMessage (ClientHandshaker.java:226)
at sun.security.ssl.Handshaker.processLoop (Handshaker.java:1082)
at sun.security.ssl.Handshaker.process_record (Handshaker.java:1010)
at sun.security.ssl.SSLSocketImpl.readRecord (SSLSocketImpl.java:1079)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake (SSLSocketImpl.java:1388)
at sun.security.ssl.SSLSocketImpl.startHandshake (SSLSocketImpl.java:1416)
at sun.security.ssl.SSLSocketImpl.startHandshake (SSLSocketImpl.java:1400)
at sun.net.www.protocol.https.HttpsClient.afterConnect (HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect (AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0 (HttpURLConnection.java:1340)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream (HttpURLConnection.java:1315)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream (HttpsURLConnectionImpl.java:264)
at com.google.api.client.http.javanet.NetHttpRequest.execute (NetHttpRequest.java:113)
at com.google.api.client.http.javanet.NetHttpRequest.execute (NetHttpRequest.java:84)
at com.google.api.client.http.HttpRequest.execute (HttpRequest.java:1012)
at com.google.auth.oauth2.UserCredentials.refreshAccessToken (UserCredentials.java:203)
at com.google.auth.oauth2.OAuth2Credentials.refresh (OAuth2Credentials.java:157)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata (OAuth2Credentials.java:145)
at com.google.auth.oauth2.UserCredentials.getRequestMetadata (UserCredentials.java:281)
at com.google.auth.http.HttpCredentialsAdapter.initialize (HttpCredentialsAdapter.java:91)
at com.google.cloud.hadoop.util.ChainingHttpRequestInitializer.initialize (ChainingHttpRequestInitializer.java:52)
at com.google.api.client.http.HttpRequestFactory.buildRequest (HttpRequestFactory.java:88)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest (AbstractGoogleClientRequest.java:422)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed (AbstractGoogleClientRequest.java:541)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed (AbstractGoogleClientRequest.java:474)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute (AbstractGoogleClientRequest.java:591)
at com.google.cloud.hadoop.util.ResilientOperation$AbstractGoogleClientRequestExecutor.call (ResilientOperation.java:171)
at com.google.cloud.hadoop.util.ResilientOperation.retry (ResilientOperation.java:67)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.getBucket (GcsUtil.java:521)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.bucketAccessible (GcsUtil.java:509)
at org.apache.beam.sdk.extensions.gcp.util.GcsUtil.bucketAccessible (GcsUtil.java:482)
at org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator.verifyPathIsAccessible (GcsPathValidator.java:83)
at org.apache.beam.sdk.extensions.gcp.storage.GcsPathValidator.validateOutputFilePrefixSupported (GcsPathValidator.java:53)
at org.apache.beam.runners.dataflow.DataflowRunner.fromOptions (DataflowRunner.java:274)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.apache.beam.sdk.util.InstanceBuilder.buildFromMethod (InstanceBuilder.java:214)
at org.apache.beam.sdk.util.InstanceBuilder.build (InstanceBuilder.java:155)
at org.apache.beam.sdk.PipelineRunner.fromOptions (PipelineRunner.java:55)
at org.apache.beam.sdk.Pipeline.create (Pipeline.java:149)
at main.java.TemplatePipeline.main (TemplatePipeline.java:95)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
at java.lang.Thread.run (Thread.java:748)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I have logged in to GCP from terminal using
gcloud auth application-default login
and export GOOGLE_CLOUD_CREDENTIALS=${PATH}
Also, I have added the google cloud certificate to the cacerts using
sudo keytool -import -trustcacerts -file /path/to/google.cer -alias google -keystore $JAVA_HOME/jre/lib/security/cacerts
and verified it is present
Any help to fix this issue is much appreciated.
Solution 1:[1]
There can be 2 reasons for this.
Either there is no bucket by name -
bucket-df-job
. If so, create the bucketWhatever service account you are using and have assigned to
GOOGLE_APPLICATION_CREDENTIALS
, does the service account have access to the GCS buckets? If not, give access and retry building the dataflow template again.
Solution 2:[2]
In addition to ensuring that you entered the right bucket name/path, I would ensure that:
- You have enabled all the required APIs. Which currently are: Cloud Dataflow, Compute Engine, Stackdriver Logging, Cloud Storage, Cloud Storage JSON, BigQuery, Cloud Pub/Sub, Cloud Datastore, and Cloud Resource Manager
- That you set up authentication correctly by creating a service account with Project > Owner role.
See this link to ensure that you have all the requirements, as you are in the creation stage of your Dataflow.
Solution 3:[3]
Edit-2
I could finally resolve the error, and now I am able to run my Dataflow runner both from mvn as well as from Eclipse. I did the following :
- I found out that my SDK versions within the pom was all over the place, so, consolidated both the directrunner as well as dataflowrunner versions to 2.29.0.
- I was manually setting the ServiceAccountCredentials scope to "https://www.googleapis.com/auth/cloud-platform", which I removed and added only the GOOGLE_APPLICATION_CREDENTIALS as a runtime env variable with narrowed scope assigned to my serviceaccount key for dataflow job execution.
- For running mvn compile exec:java , added the GOOGLE_APPLICATION_CREDENTIALS in my script to run for every session
Edit
I could overcome the credential error, but, my job again failed due to the following error :
java.io.IOException: Error matching file spec gs://gce_lab/staging/nashorn-BJZNQ7N8Lsfq-WSM0IMsRCwFMC3RIxBOEjrlB1YwKOw.jar
and looking at some of the earlier WARN
s, I see that all my copying to staging location failed... Still, trying to debug.
I'm using the following :
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-core</artifactId>
<version>2.33.0</version>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-runners-google-cloud-dataflow- java</artifactId>
<version>2.33.0</version>
</dependency>
<dependency>
<groupId>org.apache.beam</groupId>
<artifactId>beam-sdks-java-io-google-cloud-platform</artifactId>
<version>2.33.0</version>
</dependency>
@StackOverFlowUser - I was trying to run my DataFlow pipeline from Eclipse and had the exact same error, in spite of setting up the right SA and other details.
It worked for me when I added the 2 below parameters in my DataflowPipelineOptions
reference :
pipelineOptions.setPathValidatorClass(NoopPathValidator.class);
pipelineOptions.setTemplateLocation("gs://<template_lcoation>"); // all 3 -> temp, stage and template location.
Solution 4:[4]
Check if you are behind a corporate proxy server. If so, then the proxy server certificates might be used of the Google certificates which might have triggered this certification error.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | bigbounty |
Solution 2 | eyoto |
Solution 3 | |
Solution 4 | Sathesh |