Unable to access any page after theme change (myxwiki.org)

Hi,

After selecting a new theme from the list in my wiki backoffice, all wiki pages are now returning error “Failed to execute the [velocity] macro”. I didn’t managed to revert my change.

How can I solve this serious problem?

Hi, could you click on the red error and paste the stack trace here please?

Hi,

Here is the full stack trace …

org.xwiki.rendering.macro.MacroExecutionException: 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.
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:178)
at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:297)
at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
at org.xwiki.uiextension.internal.WikiUIExtensionRenderer.execute(WikiUIExtensionRenderer.java:139)
at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85)
at org.xwiki.uiextension.internal.WikiUIExtension.execute(WikiUIExtension.java:177)
at sun.reflect.GeneratedMethodAccessor431.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:151)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:357)
at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:825)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:701)
at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:676)
at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:675)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:654)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:640)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2270)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:2248)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:992)
at sun.reflect.GeneratedMethodAccessor368.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:357)
at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:825)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:701)
at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:676)
at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:675)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:654)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:640)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2270)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:2248)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:992)
at sun.reflect.GeneratedMethodAccessor368.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:357)
at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:825)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:701)
at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:676)
at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:675)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:654)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:640)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2270)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:2248)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:992)
at sun.reflect.GeneratedMethodAccessor368.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:357)
at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:825)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:701)
at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:676)
at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:675)
at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:654)
at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:640)
at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78)
at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2270)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:180)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:88)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:499)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:209)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:134)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Note that after a while the Wiki looks accessible again!

Waiting for your diagnostic,

So the error says that some page containing the velocity macro has been saved by a user that doesn’t have scripting permissions.

Could you verify that the user with which you performed the new theme selection does have script rights?

Thx

Actually it seems to be the user with which some UIExtension page was saved that doesn’t have script rights. But I guess you’ve used the same user as the one for changing the theme.

Hi,

Thanks Vincent for your answer.

It seems that I have a “global” rights problem on my community hosted wiki: http://tutos.myxwiki.org!
It’s worst since I have removed my local user “Toto” => I even can not access the Wiki admin page anymore ;-(.

Is there a way to “re-save” all admin and extensions pages at once with a “good” user to get ride of this issue?

You should be able to log with your global user XWiki.xrichard (this is the owner of this wiki and it has all the permissions).

Now if you’ve removed some user who had written wiki pages with scripts then all those pages won’t work anymore since those pages won’t have the Script right anymore. See https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Access%20Rights/Permission%20types/#HScriptRight to understand how the script right works.

What you can do is change owernships of all pages authored/last modified by the user you deleted. This can be achieved with this extension:

https://extensions.xwiki.org/xwiki/bin/view/Extension/Change%20Content%20Author

Hope it helps

Hi,

I have no problem to login with my global user.

I’ve understood that all my issues are coming from XWiki scripting rights but yet I’m completely stucked because:

  1. I can not install the suggested extension because I have no access anymore (see above) to Admin > Extension manager
  2. I can not identify pages I need to re-save with my user, because the stack trace do not show any page name ;-( and I can not view the source code of the page (to know what pages it calls).

Any further help is highly welcomed,

Note: I don’t understand how is it possible after Skin change that: first the Wiki is inaccessible, then (after several minutes) Wiki is accessible again. Is there a deamon which change rights?

Ok so that’s probably because some pages of the admin UI were saved with the user you deleted and thus those pages lost scripting permission. So we just need to find out the one or 2 pages that you need to resave with your global user.

I think the main page for the admin is XWiki.AdminSheet. If you go to http://tutos.myxwiki.org/xwiki/bin/view/XWiki/AdminSheet you should see the problem and if you check the history
you’ll see that a user toto last saved the page and that this user doesn’t exist anymore (since it doesn’t point to a profile page).

So just edit and save this page with your https://www.myxwiki.org/xwiki/bin/view/XWiki/xrichard user (force the edition).

Don’t rollback the back or you’d loose changes to it during the last wiki upgrade to version 9.3.1.

Maybe we’ll need to save one or 2 more pages but we’ll see.

I don’t think this is possible. The only reason I can think of is that you removed some admin users that you’ve used to upgrade your wiki/save pages in your wiki and by deleting it, you’ve simply removed scripting rights to all those pages.

Now you mentioned earlier that you changed the Theme, not the Skin. Which is it?

Note to XWiki devs: we need to prevent the user from locking out by removing a user who had scripting permissions to extension pages. I’ve opened https://jira.xwiki.org/browse/XWIKI-15695

@xrichard: I’m sorry for your problems. I guess that’s the downside of having a secure software :slight_smile: Now, we need to do better, that’s why I opened https://jira.xwiki.org/browse/XWIKI-15695

Thanks Vincent.

After a hard work, I managed to save the main pages and at last the Wiki is quite usable again even if I’m still faced to a lot of difficulties using XWiki => search do not work as expected, I missed programming rights to install some extensions, french translation is quite bad and sometime confusing …

Some issues may be bugs, some other may come from my bad knowledge of xwiki or poor documentation … to put it in a nutshell there is a lot of room for improvements! I will try and try again and will open some new topic to ask for help here.

Yes, it’s important for us to make xwiki as usable as possible and improve on that aspect. Let’s continue the discussion/investigation in the new topics you created. Thanks!

Thanks for your support Vincent!

PS: I’m sorry to annoy you during your week-end because “working” on Xwiki is not, contrary to you, part of my job. So don’t rush to answer my requests on Saturdays / Sundays :wink: .

Hi,

I managed to identify some other pages last saved by user Toto. It’s very hard to identify these pages but it’s easy to restore them, thanks to “the original version of the page within extension” shown at top of the page history.

I agree an improvment must be done to prevent this situation to occur (user deletion).

BTW, why didn’t you run the extension https://extensions.xwiki.org/xwiki/bin/view/Extension/Change%20Content%20Author ? It would have easily changed all pages written by user Toto with the new user you wanted?

Maybe it requires PR? (didn’t check)

Thanks

Ok Vincent, I was on the way to install and run this extension but myxwiki.org was very very slow and now don’t even respond :open_mouth:.

Confirmed: this extension requires PR to work.

Error message when running extension:
Failed to execute the [velocity] macro. Cause: [The query requires programming right. Query statement = [ SELECT doc.fullName , doc.author …

It’s also written in the extension description.