Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-54307

Properly captured the event for macro in the logs instead of throwing all the related error stack-traces

    XMLWordPrintable

Details

    • 1
    • 2
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      Summary
      Currently the Confluence does not properly handle events in the macros and will ussually throw some non-user friendly error in the UI and huge list of stacktace in the logs. For example if the "content by label" contains a filter to a deleted space, the Confluence will throw the following in the UI and a huge error of stacktraces in the logs. :

      Error rendering macro 'contentbylabel'
      parameters should not be empty

      These stacktrace flood the logs which make it hard for the customer to review their system.

      Step to Replicate

      1. Create a space (spaceA)
      2. Create a page (page1) under spaceA
      3. Add a label(test) in page1
      4. Add 'content by label' macro in a Confluence page
      5. Configure the macro as follows: label = test, of type = page, in space = spaceA then save the page
      6. Delete the spaceA

      Expected Behaviour

      • The Confluence gracefully handle the error by informing the user the space has been deleted
      • A short but relevant stacktrace that tell the user that the space is missing is added to the log.

      Observed Behaviour

      • The following error appear in the UI:

        Error rendering macro 'contentbylabel'
        parameters should not be empty

      • The following list of stacktraces is added to the logs:
        017-11-22 17:45:40,607 ERROR [http-nio-8090-exec-9] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Error rendering macro: contentbylabel
        url: /pages/viewpage.action | page: 753673 | traceId: 95ac2436d904e9ac | userName: admin | referer: http://localhost:8090/login.action?os_destination=%2Fpages%2Fviewpage.action%3FspaceKey%3Dds%26title%3Dsdsd&permissionViolation=true | action: viewpage
        java.lang.IllegalArgumentException: parameters should not be empty
        at com.atlassian.confluence.search.v2.query.AbstractParameterListQuery.<init>(AbstractParameterListQuery.java:27)
        at com.atlassian.confluence.search.v2.query.InSpaceQuery.<init>(InSpaceQuery.java:30)
        at com.atlassian.confluence.plugins.cql.fields.SpaceKeyFieldHandler.build(SpaceKeyFieldHandler.java:48)
        at com.atlassian.confluence.plugins.cql.fields.SpaceFieldHandler.build(SpaceFieldHandler.java:39)
        at com.atlassian.confluence.plugins.cql.fields.SpaceFieldHandler.build(SpaceFieldHandler.java:17)
        at com.atlassian.confluence.plugins.cql.impl.CQLtoV2SearchParseTreeVisitor.visitEntityExpr(CQLtoV2SearchParseTreeVisitor.java:170)
        at com.atlassian.confluence.plugins.cql.impl.CQLtoV2SearchParseTreeVisitor.visitEntityExpr(CQLtoV2SearchParseTreeVisitor.java:30)
        at com.atlassian.querylang.antlrgen.AqlParser$EntityExprContext.accept(AqlParser.java:2035)
        at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:72)
        at com.atlassian.querylang.antlrgen.AqlBaseVisitor.visitExpr(AqlBaseVisitor.java:300)
        at com.atlassian.confluence.plugins.cql.impl.CQLtoV2SearchParseTreeVisitor.visitSubClause(CQLtoV2SearchParseTreeVisitor.java:101)
        at com.atlassian.confluence.plugins.cql.impl.CQLtoV2SearchParseTreeVisitor.visitNotClause(CQLtoV2SearchParseTreeVisitor.java:87)
        at com.atlassian.confluence.plugins.cql.impl.CQLtoV2SearchParseTreeVisitor.visitAndClause(CQLtoV2SearchParseTreeVisitor.java:68)
        at com.atlassian.confluence.plugins.cql.impl.CQLtoV2SearchParseTreeVisitor.visitOrClause(CQLtoV2SearchParseTreeVisitor.java:53)
        at com.atlassian.confluence.plugins.cql.impl.CQLtoV2SearchParseTreeVisitor.visitOrClause(CQLtoV2SearchParseTreeVisitor.java:30)
        at com.atlassian.querylang.antlrgen.AqlParser$OrClauseContext.accept(AqlParser.java:903)
        ..........
        at java.lang.Thread.run(Thread.java:748)

         

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            jcheok Jing Hwa Cheok (Inactive)
            Votes:
            12 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: