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

Google Sheet Output 403 Error #3333

Closed
juice416021 opened this issue Oct 31, 2023 · 2 comments
Closed

Google Sheet Output 403 Error #3333

juice416021 opened this issue Oct 31, 2023 · 2 comments

Comments

@juice416021
Copy link

juice416021 commented Oct 31, 2023

Version: 2.6
Operating System: Mac

I have already set up on Google Cloud:

Created a new Project
Enabled Google Drive API
Enabled Google Sheet API
Created a service account
Generated a key for the service account and downloaded the JSON file for Apache Hop's Google Sheet Output to read.
Created a new Google Sheet and granted edit permissions to the service account.
However, I'm still encountering a 403 error.

image
image
image
image
image
image

2023/10/31 17:50:17 - Hop - Projects enabled
2023/10/31 17:50:17 - Hop - Enabling project : 'gene-test'
2023/10/31 18:11:11 - final_test - Executing this pipeline using the Local Pipeline Engine with run configuration 'local'
2023/10/31 18:11:11 - final_test - Execution started for pipeline [final_test]
2023/10/31 18:11:12 - Google Sheet Output.0 - ERROR: Error: for worksheet : TEST in spreadsheet :1tRttL_J2BfalduLzTGgJAWWUmN7tO9Jj5UweOpghOPI403 Forbidden
2023/10/31 18:11:12 - Google Sheet Output.0 - GET https://www.googleapis.com/drive/v3/files?fields=nextPageToken,%20files(id,%20name)&includeItemsFromAllDrives=true&pageSize=100&q=mimeType%3D'application/vnd.google-apps.spreadsheet'&supportsAllDrives=true
2023/10/31 18:11:12 - Google Sheet Output.0 - {
2023/10/31 18:11:12 - Google Sheet Output.0 - "code" : 403,
2023/10/31 18:11:12 - Google Sheet Output.0 - "details" : [ {
2023/10/31 18:11:12 - Google Sheet Output.0 - "@type" : "type.googleapis.com/google.rpc.ErrorInfo",
2023/10/31 18:11:12 - Google Sheet Output.0 - "reason" : "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
2023/10/31 18:11:12 - Google Sheet Output.0 - "domain" : "googleapis.com",
2023/10/31 18:11:12 - Google Sheet Output.0 - "metadata" : {
2023/10/31 18:11:12 - Google Sheet Output.0 - "method" : "google.apps.drive.v3.DriveFiles.List",
2023/10/31 18:11:12 - Google Sheet Output.0 - "service" : "drive.googleapis.com"
2023/10/31 18:11:12 - Google Sheet Output.0 - }
2023/10/31 18:11:12 - Google Sheet Output.0 - } ],
2023/10/31 18:11:12 - Google Sheet Output.0 - "errors" : [ {
2023/10/31 18:11:12 - Google Sheet Output.0 - "domain" : "global",
2023/10/31 18:11:12 - Google Sheet Output.0 - "message" : "Insufficient Permission",
2023/10/31 18:11:12 - Google Sheet Output.0 - "reason" : "insufficientPermissions"
2023/10/31 18:11:12 - Google Sheet Output.0 - } ],
2023/10/31 18:11:12 - Google Sheet Output.0 - "message" : "Request had insufficient authentication scopes.",
2023/10/31 18:11:12 - Google Sheet Output.0 - "status" : "PERMISSION_DENIED"
2023/10/31 18:11:12 - Google Sheet Output.0 - }
2023/10/31 18:11:12 - Google Sheet Output.0 - ERROR: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
2023/10/31 18:11:12 - Google Sheet Output.0 - GET https://www.googleapis.com/drive/v3/files?fields=nextPageToken,%20files(id,%20name)&includeItemsFromAllDrives=true&pageSize=100&q=mimeType%3D'application/vnd.google-apps.spreadsheet'&supportsAllDrives=true
2023/10/31 18:11:12 - Google Sheet Output.0 - {
2023/10/31 18:11:12 - Google Sheet Output.0 - "code" : 403,
2023/10/31 18:11:12 - Google Sheet Output.0 - "details" : [ {
2023/10/31 18:11:12 - Google Sheet Output.0 - "@type" : "type.googleapis.com/google.rpc.ErrorInfo",
2023/10/31 18:11:12 - Google Sheet Output.0 - "reason" : "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
2023/10/31 18:11:12 - Google Sheet Output.0 - "domain" : "googleapis.com",
2023/10/31 18:11:12 - Google Sheet Output.0 - "metadata" : {
2023/10/31 18:11:12 - Google Sheet Output.0 - "method" : "google.apps.drive.v3.DriveFiles.List",
2023/10/31 18:11:12 - Google Sheet Output.0 - "service" : "drive.googleapis.com"
2023/10/31 18:11:12 - Google Sheet Output.0 - }
2023/10/31 18:11:12 - Google Sheet Output.0 - } ],
2023/10/31 18:11:12 - Google Sheet Output.0 - "errors" : [ {
2023/10/31 18:11:12 - Google Sheet Output.0 - "domain" : "global",
2023/10/31 18:11:12 - Google Sheet Output.0 - "message" : "Insufficient Permission",
2023/10/31 18:11:12 - Google Sheet Output.0 - "reason" : "insufficientPermissions"
2023/10/31 18:11:12 - Google Sheet Output.0 - } ],
2023/10/31 18:11:12 - Google Sheet Output.0 - "message" : "Request had insufficient authentication scopes.",
2023/10/31 18:11:12 - Google Sheet Output.0 - "status" : "PERMISSION_DENIED"
2023/10/31 18:11:12 - Google Sheet Output.0 - }
2023/10/31 18:11:12 - Google Sheet Output.0 - at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
2023/10/31 18:11:12 - Google Sheet Output.0 - at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:118)
2023/10/31 18:11:12 - Google Sheet Output.0 - at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:37)
2023/10/31 18:11:12 - Google Sheet Output.0 - at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$3.interceptResponse(AbstractGoogleClientRequest.java:466)
2023/10/31 18:11:12 - Google Sheet Output.0 - at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1111)
2023/10/31 18:11:12 - Google Sheet Output.0 - at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:552)
2023/10/31 18:11:12 - Google Sheet Output.0 - at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:493)
2023/10/31 18:11:12 - Google Sheet Output.0 - at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:603)
2023/10/31 18:11:12 - Google Sheet Output.0 - at org.apache.hop.pipeline.transforms.googlesheets.GoogleSheetsOutput.init(GoogleSheetsOutput.java:109)
2023/10/31 18:11:12 - Google Sheet Output.0 - at org.apache.hop.pipeline.transform.TransformInitThread.run(TransformInitThread.java:66)
2023/10/31 18:11:12 - Google Sheet Output.0 - at java.base/java.lang.Thread.run(Thread.java:1583)
2023/10/31 18:11:12 - Google Sheet Output.0 - ERROR: Error initializing transform [Google Sheet Output]
2023/10/31 18:11:12 - final_test - ERROR: Transform [Google Sheet Output.0] failed to initialize!
2023/10/31 18:11:12 - Table input.0 - Finished reading query, closing connection.
2023/10/31 18:11:12 - Table input 2.0 - Finished reading query, closing connection.

@juice416021 juice416021 changed the title Google Sheet Output 403 Error Google Sheet Output 403 Error #Hop Gui Oct 31, 2023
@juice416021 juice416021 changed the title Google Sheet Output 403 Error #Hop Gui Google Sheet Output 403 Error Oct 31, 2023
@juice416021 juice416021 reopened this Oct 31, 2023
@hansva
Copy link
Contributor

hansva commented Oct 31, 2023

can you try adding the service account user as read/editor to the sheet?

@juice416021
Copy link
Author

juice416021 commented Oct 31, 2023

can you try adding the service account user as read/editor to the sheet?

I have already added my service account in the sharing settings of the Google sheet I want to edit, and have set it as an editor.

image

Google Drive API:Success!

image

Click Browse in the upper right corner

GoogleJsonResponseException: 403 Forbidden
GET https://www.googleapis.com/drive/v3/files?fields=nextPageToken,%20files(id,%20name)&includeItemsFromAllDrives=true&pageSize=100&q=mimeType%3D'application/vnd.google-apps.spreadsheet'&supportsAllDrives=true
{
"code" : 403,
"details" : [ {
"@type" : "type.googleapis.com/google.rpc.ErrorInfo",
"reason" : "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
"domain" : "googleapis.com",
"metadata" : {
"method" : "google.apps.drive.v3.DriveFiles.List",
"service" : "drive.googleapis.com"
}
} ],
"errors" : [ {
"domain" : "global",
"message" : "Insufficient Permission",
"reason" : "insufficientPermissions"
} ],
"message" : "Request had insufficient authentication scopes.",
"status" : "PERMISSION_DENIED"
}

@hansva hansva added this to the Not Applicable milestone Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants