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?
This is most likely the bug causing the user macro issues: https://jira.atlassian.com/browse/CONFSERVER-82741
Hi @Keimpe de Jong is there anything in the user macros that points to the old server? Re icon URL ?
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.
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?
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.
Hello @Craig Nodwell no reference to any server. I'll share the user macro(s) in a reply.
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?
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?
From the admin console, you can download the logs. The best steps to find an issue is:
What was the server version where the macro was working?
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-macrosorg.apache.http.conn.ConnectTimeoutException: Connect to confluence base url:443 [confluence base url/IP adress] failed: connect timed out
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)
It looks like you're new here. Sign in or register to get started.