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

Can't import Google Sheet while logged in #3800

Closed
matiasgarciaisaia opened this issue Apr 9, 2021 · 3 comments · Fixed by #3801
Closed

Can't import Google Sheet while logged in #3800

matiasgarciaisaia opened this issue Apr 9, 2021 · 3 comments · Fixed by #3801
Labels
error handling Improving the ways errors are reported to users google Import / export from Google services Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Milestone

Comments

@matiasgarciaisaia
Copy link
Contributor

If I log into OpenRefine with a Google account, trying to import a Google Spreadsheet results in an unhandled exception that leaves the UI with a endless Preparing... message.

The issue is the same one described in #3604, but back then it was misinterpreted that the issue was not being signed in - while it was a coding bug issue all along.

To Reproduce

Steps to reproduce the behavior:

  1. Navigate to Create Project -> Google Data.
  2. Sign in with a Google account (Google Suite - ie, custom domains - isn't working at all at the moment). Go through the OAuth consent flow and accept.
  3. On the list of Authorized Documents, select any spreadsheet.

Current Results

A modal with a loading spinner and the Preparing... text appears, but never finishes. The server's console shows an unhandled exception.

19:25:22.708 [..etty.server.HttpChannel] /command/core/importing-controller (24365ms)
java.lang.NullPointerException
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:880)
        at com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:125)
        at com.google.api.client.auth.oauth2.Credential$Builder.<init>(Credential.java:637)
        at com.google.refine.extension.gdata.GoogleAPIExtension.getSheetsService(GoogleAPIExtension.java:166)
        at com.google.refine.extension.gdata.GDataImportingController.getWorksheetEntriesForDoc(GDataImportingController.java:217)
        at com.google.refine.extension.gdata.GDataImportingController.doInitializeParserUI(GDataImportingController.java:197)
        at com.google.refine.extension.gdata.GDataImportingController.doPost(GDataImportingController.java:98)
        at com.google.refine.commands.importing.ImportingControllerCommand.doPost(ImportingControllerCommand.java:68)
        at com.google.refine.RefineServlet.service(RefineServlet.java:187)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
        at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(ServletHolder.java:1395)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:755)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1617)
        at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:50)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1596)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:545)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:590)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1607)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1297)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:485)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1577)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1212)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at com.google.refine.ValidateHostHandler.handle(ValidateHostHandler.java:96)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:500)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:547)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:270)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)

Expected Behavior

The modal should close and move on to the next step for Project creation, with the selected spreadsheet's data.

Screenshots

Screen Shot 2021-04-09 at 02 41 36

Versions

  • Operating System: macOS 10.15.7
  • Browser Version: Chrome 89
  • JRE or JDK Version: openjdk version "15.0.2" 2021-01-19, OpenJDK Runtime Environment (build 15.0.2+7-27), OpenJDK 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
  • OpenRefine: OpenRefine 3.4-beta-997-gdf5401388 (built from source by running ./refine)
@matiasgarciaisaia matiasgarciaisaia added Type: Bug Issues related to software defects or unexpected behavior, which require resolution. Status: Pending Review Indicates that the issue or pull request is awaiting review by project maintainers or collaborators labels Apr 9, 2021
@wetneb wetneb added error handling Improving the ways errors are reported to users google Import / export from Google services and removed Status: Pending Review Indicates that the issue or pull request is awaiting review by project maintainers or collaborators labels Apr 9, 2021
@wetneb
Copy link
Sponsor Member

wetneb commented Apr 9, 2021

This is just because you haven't provided Google API credentials - we should fail in a cleaner way in this case.

https://github.com/OpenRefine/OpenRefine/wiki/Google-Extension
(this wiki page should be migrated to docs.openrefine.org btw)

@matiasgarciaisaia
Copy link
Contributor Author

I'm pretty sure I've provided the Google API credentials - on development, I've hardcoded the CLIENT_ID and CLIENT_SECRET constants in GoogleAPIExtension.java.

I've just sent a PR with the fix.

@wetneb
Copy link
Sponsor Member

wetneb commented Apr 9, 2021

Ah ok, thanks a lot!

@wetneb wetneb added this to the 3.5 milestone Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Improving the ways errors are reported to users google Import / export from Google services Type: Bug Issues related to software defects or unexpected behavior, which require resolution.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants