Uploaded image for project: '[Read Only] - Hippo Repository'
  1. [Read Only] - Hippo Repository
  2. REPO-1913

RepositoryServlet does not log enough information and does not propagate the cause in case the repository fails to start

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 5.2.0
    • None
    • None
    • Turing Sprint 172, Turing Sprint 173

    Description

      Someone had a failing repository startup because of a outdated lucene export. The logs in catalina out were as follows:

      20-Dec-2017 15:33:26.596 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.loadOnStartup Servlet [Repository] in web application [/cms] threw load() exception
      javax.servlet.ServletException: RepositoryException: unchecked exception: java.lang.IllegalStateException: Cannot startup because of corrupted or outdated indexRevision.properties file.
      at org.hippoecm.repository.RepositoryServlet.init(RepositoryServlet.java:234)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1227)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1140)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1027)

      The problem in this is that the more elaborate explanation is not logged: We do not see the explanation behind it that is from org.apache.jackrabbit.core.query.lucene.SearchIndex#getChangeLogRecords:

      if (startRevisionJournalTable > (fromRevision + 1)) {
                              String msg = String.format("Required start revision '%s' does NOT exist any more in the " +
                                      "Journal table (oldest journal table record has revision '%s') implying the index cannot be correctly updated. Remove the index and restart to " +
                                      "trigger a complete new index built or provide a newer index export.", fromRevision + 1, startRevisionJournalTable);
                              if (fatalOnRevisionCheck) {
                                  throw new IllegalStateException(msg);
                              } else {
                                  log.error(msg);
                              }
                          }
      

      The problem is in the RepositoryServlet that in case of exceptions causing the repository to not startup handles these exceptions as follows:

       catch (MalformedURLException ex) {
                  log.error("MalformedURLException exception: " + bindingAddress, ex);
                  throw new ServletException("RemoteException: " + ex.getMessage());
              } catch (RemoteException ex) {
                  log.error("Generic remoting exception: " + bindingAddress, ex);
                  throw new ServletException("RemoteException: " + ex.getMessage());
              } catch (RepositoryException ex) {
                  log.error("Error while setting up JCR repository: ", ex);
                  throw new ServletException("RepositoryException: " + ex.getMessage());
              }
      

      With the above, only the 'toString' and message of the last exception are maintained, likely to swallow the real causes

      Attachments

        Activity

          People

            Unassigned Unassigned
            aschrijvers Ard Schrijvers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: