"Failed to execute the [velocity] macro" on imported pages

we are migrating from an old, no longer developed wiki (Deki Wiki) to XWIKI for our internal knowledgebase. We successfully imported all our pages from the old system into XWIKI using direct DB queries on the Deki side, and the API on the XWIKI side. The import wasn’t perfect, and I was going through things cleaning up and organizing our ~950 pages. I have stumbled into a few pages that when I visit them give me an error:

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed. Check the rights of its last author or the parameters if it’s rendered from another script.]. Click on this message for details.

Obviously there should be no scripts/macros in these imported pages, so the best I can figure is some of the page text is inadvertently triggering the macro interpreter, but its not clear to me what could be doing it. I’ve looked for ‘{{’ anywhere in the text and don’t see it. The imported pages use the HTML 4.01 page syntax, and gives the error. If I switch the syntax to XWIKI 2.1, and allowing the system to convert the content automatically, I still get the error.

Any idea what can be causing this?

Hi, welcome to the XWiki forum! :slight_smile:

Maybe you could provide a screenshot of a page where you get this so that we can try to help you find out what part of xwiki is generating this error?

More generally this error means that there’s a {{velocity}} macro used somewhere in a wiki page and that page was last saved y a user not having the scripting right. To fix this you just need to resave that page with a user having scripting rights. However, I agree it’s not easy to locate which page is being referred (something we should improve).

If you don’t have any {{velocity}} macro in your pages then this error is probably not coming from the page rendering but maybe from the skin rendering. A screenshot would help.

Thanks

1 Like

For that part, I’ve created https://jira.xwiki.org/browse/XWIKI-16710 and I have a fix for it (need to write a test now).

so you’re saying the error being thrown is not necessarily being thrown by the page I’m seeing it on?

When I got back to work this morning the error is no longer visible, so I don’t know if it is resolved, or if it just that no one has hit the page that is causing the error.

There shouldn’t be a {{velocity}} in the pages because it was imported from Deki Wiki which wouldn’t have used a tag like that. the only modification to the page code was done to reformat links and image tags.

The page design is Flamingo with an added logo, and some small font size and color adjustments.

49%20AM

From the location of the error message my guess is that it comes from an “after header” UI extension that uses Velocity (this UI extension is evaluated on every page). You can see the list of installed UI extensions at this URL:

<server>/xwiki/bin/view/XWiki/UIExtensionClass

You’ll have to find the ones that inject content after header (by editing them with the Object editor), or you can simply look at the Last Author column and check if there is any author that doesn’t have scripting rights.

FYI https://jira.xwiki.org/browse/XWIKI-16710 is now fixed and will be included in the next release, i.e. XWiki 11.8RC1. It should help understand which page contains the script that is missing the script right.