Support Questions

Find answers, ask questions, and share your expertise

NiFi PutGCSObject Error access token

avatar
New Contributor

27389-config2.png

I try to use PutGCSObject to store my data but I got error massage about access token(picture below)

My processor config > picture config1

controller-service config > picture config2

27388-config2.png

27387-config1.png

27386-error.png

5 REPLIES 5

avatar
New Contributor

any update? I have same issue.

,

Any update? I have same issue.

avatar
Rising Star

@Timothy Spann

any idea on it ? I am also facing the same issue while accessing gcloud from nifi cluster . From my local instance it works fine

avatar
Master Guru

Anything in the error log?

Did the GC controller start up?

No network issues? No firewall blocking a port?

Make sure you have the correct Google Permissions

https://cloud.google.com/storage/docs/authentication

Make sure you have read-write and not one of the cloud only access.

TypeDescriptionScope URL
read-onlyOnly allows access to read data, including listing buckets.https://www.googleapis.com/auth/devstorage.read_only
read-writeAllows access to read and change data, but not metadata like IAM policies.https://www.googleapis.com/auth/devstorage.read_write
full-controlAllows full control over data, including the ability to modify IAM policies.https://www.googleapis.com/auth/devstorage.full_control
cloud-platform.read-onlyView your data across Google Cloud Platform services. For Cloud Storage, this is the same as devstorage.read-only.https://www.googleapis.com/auth/cloud-platform.read-only
cloud-platformView and manage data across all Google Cloud Platform services. For Cloud Storage, this is the same as devstorage.full-control.https://www.googleapis.com/auth/cloud-platform

avatar
Rising Star

@Timothy Spann Error log

Caused by: java.io.IOException: Error getting access token for service account:

at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:319)

at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:149)

at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:135)

at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:96)

at com.google.cloud.HttpServiceOptions$1.initialize(HttpServiceOptions.java:224)

at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93)

at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:423)

at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)

at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)

at com.google.cloud.storage.spi.DefaultStorageRpc.create(DefaultStorageRpc.java:245)

... 22 common frames omitted

Caused by: java.net.SocketTimeoutException: Read timed

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)

at java.net.SocketInputStream.read(SocketInputStream.java:170)

at java.net.SocketInputStream.read(SocketInputStream.java:141)

at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)

at sun.security.ssl.InputRecord.read(InputRecord.java:503)

at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)

at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)

at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)

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:1316)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250

avatar
Rising Star

There is a known issue in the PutGCSObject if running behind a secured network and accessing GCS through a proxy.

The Proxy Host and Proxy Port added to the PutGCSObject will proxy the object itself, but DOES NOT proxy the GCPCredentialsControllerService, the service that authenticates your connection using yous Service AccountJSON file.

At this time, this is a Community Supported Processor, and this issue exists in HFD 3.2 (Nifi v.1.7).