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

When a user checks the "Save for Later" Tab under Profiles and has pages created by other users marked as favourite, StackOverflowError is encountered

      Summary

      When a user checks the "Save for Later" Tab under Profiles and has pages created by other users marked as favourite, below error is encountered

      When user only has self created pages marked as favourite , there is no error

      Reproduction Steps

      1. Install Confluence version 8.5.5 with Java17 (use the installer method)
      2. Create two users, User 1 and User2
      3. Create a Page, logged in as User1
      4. Now Log in as User2 and Mark the Page created by User 1 as "Save for Later"
      5. Choose your profile picture at top-right of the screen, then choose Saved for later

      Actual Result

      Error in logs:

      2024-01-19 07:24:02,371 ERROR [http-nio-8090-exec-10 url: /users/viewmyfavourites.action; user: user2] [views.velocity.result.VelocityResult] doExecute Unable to render velocity template: '/users/myfavourites.vm'
       -- url: /users/viewmyfavourites.action | userName: user2 | action: viewmyfavourites | referer: http://10.140.17.239:8090/users/viewmyprofile.action | traceId: b49b1295fc517c97
      org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getRenderedTemplateHtml' in  class com.atlassian.confluence.plugins.soy.VelocityFriendlySoyTemplateRenderer threw exception java.lang.StackOverflowError at /users/myfavourites.vm[line 30, column 44]

      Expected results

      Workaround:

      We recommend you choose one of the following options to workaround this issue:

      1. Use Java 11, as this behavior is only on Java 17, or
      2. Change <installation_directory>/confluence/includes/soy/pagelist.soy line #358 from
        Old value: 
        {if $user and $user != ''}
        

        New Value:

        {if $user} 

        1. image-2024-01-18-21-00-34-758.png
          image-2024-01-18-21-00-34-758.png
          48 kB
        2. image-2024-01-19-13-05-37-419.png
          image-2024-01-19-13-05-37-419.png
          281 kB
        3. screenshot-1.png
          screenshot-1.png
          122 kB
        4. screenshot-2.png
          screenshot-2.png
          80 kB

          Form Name

            [CONFSERVER-94126] When a user checks the "Save for Later" Tab under Profiles and has pages created by other users marked as favourite, StackOverflowError is encountered

            Robert Wolf added a comment - - edited

            We have this bug on confluence 8.5.14 and 8.5.15 with Java 11. There is an error

            2024-09-09 08:48:21,596 ERROR [http-nio-8080-exec-2378] [views.velocity.result.VelocityResult] doExecute Unable to render velocity template: '/users/myfavourites.vm'                                                                             
            org.apache.velocity.exception.MethodInvocationException: Invocation of method 'after' in  class java.sql.Timestamp threw exception java.lang.NullPointerException at /users/myfavourites.vm[line 34, column 78]                                   
            

            The line 34 in /users/myfavourites.vm contains:

            "lastModificationDateafter": "$page.lastModificationDate.after($previousLoginDate)",
            

            If I remove this line from the myfavourites.vm, then the page can be rendered.

            If our error the same error as reported and has been again introduced in some update? Or it is new bug? Is there already report for this bug? Or should I create support request?

            We use Java 11 and there is a line 385 in the file confluence/includes/soy/pagelist.soy with content

            {if $user}
            

            So both workaround do not work for us.

            Thank you for final fix.

            update: I have now saved the same pages as the other user, who gets Ooops Page and I can still see my favorites but he cannot see his favorites.

            Regards,

            Robert Wolf.

            Robert Wolf added a comment - - edited We have this bug on confluence 8.5.14 and 8.5.15 with Java 11. There is an error 2024-09-09 08:48:21,596 ERROR [http-nio-8080-exec-2378] [views.velocity.result.VelocityResult] doExecute Unable to render velocity template: '/users/myfavourites.vm' org.apache.velocity.exception.MethodInvocationException: Invocation of method 'after' in class java.sql.Timestamp threw exception java.lang.NullPointerException at /users/myfavourites.vm[line 34, column 78] The line 34 in /users/myfavourites.vm contains: "lastModificationDateafter": "$page.lastModificationDate.after($previousLoginDate)", If I remove this line from the myfavourites.vm, then the page can be rendered. If our error the same error as reported and has been again introduced in some update? Or it is new bug? Is there already report for this bug? Or should I create support request? We use Java 11 and there is a line 385 in the file confluence/includes/soy/pagelist.soy with content {if $user} So both workaround do not work for us. Thank you for final fix. update: I have now saved the same pages as the other user, who gets Ooops Page and I can still see my favorites but he cannot see his favorites. Regards, Robert Wolf.

            A fix for this issue is available in Confluence Server and Data Center 8.5.6.
            Upgrade now or check out the Release Notes to see what other issues are resolved.

            Aakash Jain added a comment - A fix for this issue is available in Confluence Server and Data Center 8.5.6. Upgrade now or check out the Release Notes to see what other issues are resolved.

            One of our customers reported a loading time of almost 20 seconds for /users/viewmyfavourites.action with the new Soy rendering. This is unacceptable.

            Are there any updates on this bug and the additionally found associated errors?

            Kind regards,
            Christian Heinig (Seibert Media)

            Christian Heinig added a comment - One of our customers reported a loading time of almost 20 seconds for /users/viewmyfavourites.action with the new Soy rendering. This is unacceptable. Are there any updates on this bug and the additionally found associated errors? Kind regards, Christian Heinig (Seibert Media)

            Another error I came across: special characters such as an apostrophe within a page title are displayed as HTML character code.

            Christopher Engelmann added a comment - Another error I came across: special characters such as an apostrophe within a page title are displayed as HTML character code.

            It seems that the loading time is slower with the new Soy rendering in Confluence 8.5.5, compared to the previous Velocity rendering using general-pagelist.vm. Can you confirm that?

            Christian Heinig added a comment - It seems that the loading time is slower with the new Soy rendering in Confluence 8.5.5, compared to the previous Velocity rendering using general-pagelist.vm. Can you confirm that?

            Another bug: The links to user profiles ("user1" in the screenshot) are broken because they include apostrophes around "/display/": "'/display/'".

            A workaround would be to remove the apostrophes in lines 362 and 371 in pagelist.soy.

             

            Christian Heinig added a comment - Another bug: The links to user profiles ("user1" in the screenshot) are broken because they include apostrophes around "/display/ " : "'/display/ '" . A workaround would be to remove the apostrophes in lines 362 and 371 in pagelist.soy.  

            In the description there is a screenshot that is referenced as "When user only has self created pages marked as favourite , there is no error":

            However, it clearly shows there is still an bug, because there should be a friendly formatted date instead of "$friendlyDateFormatterHelper.format($page.lastModificationDate)".

            Do you have plans to fix this additional bug?

            Kind regards,
            Christian Heinig (Seibert Media)

            Christian Heinig added a comment - In the description there is a screenshot that is referenced as "When user only has self created pages marked as favourite , there is no error": However, it clearly shows there is still an bug, because there should be a friendly formatted date instead of "$friendlyDateFormatterHelper.format($page.lastModificationDate)". Do you have plans to fix this additional bug? Kind regards, Christian Heinig (Seibert Media)

            I tested both workarounds.
            Installed openjdk-11-jre from ubuntu  and favorites are shown.
            Changed the line as suggested and run it with atlassians java 17, and favorites are shown too.

            Workarouds are working!

            Jakobus Schürz added a comment - I tested both workarounds. Installed openjdk-11-jre from ubuntu  and favorites are shown. Changed the line as suggested and run it with atlassians java 17, and favorites are shown too. Workarouds are working!

              6ce45665ee6c Anoop Singh (Inactive)
              d51fc966722f Shivangi Nayak
              Affected customers:
              44 This affects my team
              Watchers:
              77 Start watching this issue

                Created:
                Updated:
                Resolved: