tsgrp / HPI

OpenContent Management Suite (OCMS)
http://www.tsgrp.com/products
17 stars 5 forks source link

Google Docs integration fails on checkin #2451

Closed gsteimer closed 2 years ago

gsteimer commented 3 years ago

When configuring Gogole docs on release2 or edge2, the following error occurs on checkin (Checkout and cancel checkout seem to be working as expected):

2021-10-15 10:45:48,458 479867093   ajp-apr-8009-exec-8 DEBUG   LogstashPerformanceLoggingImpl  gsteimer checkinFromCloudService workspace://SpacesStore/a1b5ad2a-b447-46f9-8b5a-03f169b6c41f Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 workspace://SpacesStore/a1b5ad2a-b447-46f9-8b5a-03f169b6c41f
2021-10-15 10:45:48,661 479867296   ajp-apr-8009-exec-8 ERROR   RESTService 
java.lang.NullPointerException
    at com.tsgrp.opencontent.core.action.executer.CheckinFromCloudServiceActionExecuter.checkinFromGoogle(CheckinFromCloudServiceActionExecuter.java:215)
    at com.tsgrp.opencontent.core.action.executer.CheckinFromCloudServiceActionExecuter.executeImpl(CheckinFromCloudServiceActionExecuter.java:132)
    at com.tsgrp.opencontent.core.action.executer.AbstractActionExecuter.executeImpl(AbstractActionExecuter.java:239)
    at com.tsgrp.opencontent.core.action.executer.AbstractActionExecuter.execute(AbstractActionExecuter.java:226)
    at com.tsgrp.opencontent.core.action.executer.AbstractActionExecuter.evaluateAndExecute(AbstractActionExecuter.java:156)
    at com.tsgrp.opencontent.core.action.service.CoreActionService.execute(CoreActionService.java:475)
    at com.tsgrp.opencontent.core.action.service.RESTAction.executeActionPost(RESTAction.java:226)

Looking at the code, this NPE is happening in the finally block which tries to close the connection:

  ...
}catch (IOException e) {
}finally {
    try {
        httpClientGet.close();
    } catch (IOException e) {
        throw new OCRuntimeException("CheckinFromCloudServiceActionExecuter #checkinFromGoogle error closing http client: ", e);
    }
}

The code must be failing above where we instantiate httpClientGet since the method's catch block improperly only catches IOException so it's impossible to tell what the real error is here.

gsteimer commented 2 years ago

Moved to Jira: https://alfresco.atlassian.net/browse/SEP-28