User Macro's from Confluence Server not working in Confluence Datacenter

Keimpe de Jong April 18, 2023

Hello,

I'm currently using a Confluence Data Center trial license and discovered the following:

The user macro's made under Confluence Server aren't working in Confluence Data Center 7.19.7.

Can't figure it out;
any ideas how to solve this?

5 answers

1 accepted

3 votes
Answer accepted
Keimpe de Jong April 24, 2023

This is most likely the bug causing the user macro issues: https://jira.atlassian.com/browse/CONFSERVER-82741

2 votes
Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 18, 2023

Hi @Keimpe de Jong is there anything in the user macros that points to the old server?  Re icon URL ?

Keimpe de Jong April 19, 2023

Hello @Craig Nodwell no reference to any server. I'll share the user macro(s) in a reply.

1 vote
Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2023

Server and DC share the same code base. Whatever the problem is, it's not because of data center. As far as problem reports go, this is extremely poor because you provided no code, no errors, no context, so all we can do is guess.

Keimpe de Jong April 19, 2023

The aim of my question is to get in touch with other community members who have experience with failing user macro's moving from Server to Data Center.
That's why I didn't provide the failing user macro.

Thanks for your answer.

Ally Lancaster November 7, 2023

Hi @Radek Dostál - I have the same issue for a user macro designed to show date last modified. It is no longer working. Any suggestions?

## @noparams
Last Modified: $action.dateFormatter.formatDateTime($content.lastModificationDate) 
0 votes
Keimpe de Jong April 19, 2023

This User Macro is used to create a custom page listing a specific set of global active spaces.
In the near future a filter on the space category has to be added.

Example of a failing User Macro in Confluence Data Center:

## @noparams
#set($containerManagerClass = $content.class.forName('com.atlassian.spring.container.ContainerManager'))
#set($getInstanceMethod = $containerManagerClass.getDeclaredMethod('getInstance',null))
#set($containerManager = $getInstanceMethod.invoke(null,null))
#set($containerContext = $containerManager.containerContext)
#set($spaces = $spaceManager.getAllSpaces())

#foreach($space in $spaces)

##uitsluiten personal en archived spaces
#if( $space.isPersonal() or $space.isArchived() )
#else

<tr>
<ul>
<td><li><a id="spacelink-spacekey" href="/display/$space.Key" target="_top">$space.Name</a></li></td>
</ul>
</tr>
#end
#end

Any ideas?

0 votes
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2023

Were your macros written for an older version of Confluence? I had a number of user macros that when moving from server 6.13 to 7.4, did not work fully. It was because some of the classes had been deprecated.

I also noticed that for inexplicable reasons, Atlassian restricted some access for user macros (restricted some methods from the Velocity context). So for example setting content properties was restricted.

Do you know what is failing in your macros? Have you checked the logs to see if there is a clue in there?

Keimpe de Jong April 19, 2023

I don't know what too look for and in which log due to lack of experience with failing user macro's.

Can you point the way?

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 19, 2023

From the admin console, you can download the logs. The best steps to find an issue is:

  1. Refresh the page with the failing macro. Note the page ID
  2. Generate and download the latest logs.
  3. Search for the page ID (or failing that, work backwards looking at time stamps).
  4. You should see some warning, error messages that may point to specific classes by unknown/unrecognized.

What was the server version where the macro was working?

Like Keimpe de Jong likes this
Keimpe de Jong April 19, 2023

Server version was 7.19.3

From the logs:

2023-04-19 17:18:33,431 ERROR [http-nio-8090-exec-3] [renderer.internal.http.HttpClientFetcher] fetch Unable to perform a request to: https://confluence base  url/ rest/gadgets/1.0/g/messagebundle/und/gadget.common%2Cgadget.activity.stream
-- referer: https://confluence base url/ display/Space key/Page name | url: /plugins/macrobrowser/browse-macros.action | traceId: eca4029d328f4ef0 | userName: **** | action: browse-macros
org.apache.http.conn.ConnectTimeoutException: Connect to confluence base url:443 [confluence base url/IP adress] failed: connect timed out

Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2023

Looks like there was some configuration change that blocking the requests. Did the URL change, or is rest socket not enabled? Or is the user credentials the macro using active?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events