Is there a limitation on the number of values the replace and render macro can hold?

We are getting an error "Error formatting macro: run: java.lang.StackOverflowError" when using the replace and render macro. It works on preview until we select the top 785 but fails with the above error when we save the page. It work both on preview and page save when we only select top 100 or nay lower numbers.

{replace-and-render}
{replace-item:%componentsel%}{sql:dataSource=DS|output=html|heading=false|border=0|table=false}
 select top 1000':''',ccc,''':''',ccc,'''' from (
   select distinct component as ccc from releases where 
   date>dateadd([year],-1,GETDATE())
union 
   select distinct component as ccc from installs where  expdate >= getdate() 
)  as c  order by ccc asc
{sql}{replace-item}
{replace-body}
{run:autorun=true|replace=component:sysadmin:Select component:select:%componentsel%}


{run}
{replace-body}
{replace-and-render}

1 answer

1 accepted

This widget could not be displayed.

I've got the answer from the developer Bob as follows:

1. Stack overflow errors can occur when using regex patterns that are large or complex. Sometimes this is due to error but in some cases it just requires more stack space.

2. Try increasing your stack space and see if that allows a higher #. If so, keep increasing until it covers your case. For instance, I have used -Xss4096k on a Confluence instance with more complex cases.

So I've increased our stack space on is-testconfluence to -Xss40966k and your script now works fine

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

513 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you