Problem when fetching annotations "Failed:server not responding"

Right after switching my wiki to domain based I m getting “Failed:server not responding” error from Annotation macro (call to rest api ends in 404)

It s exactly this piece of code when fetching annotations via rest api in AnnotationCode/Script (section AnnotationApplication)

It just gets URL(just domain name) wrong. Is it known bug? Shouldnt $xwiki.getURL be used instead?

I don’t know much about xm.restURL API but wrong domains in generated URLs are often a sign that the domain is wrong in the wiki descriptor. You might want to check that it’s complete (it should be the complete domain name and not just the first part). You can access the wiki descriptor through the wiki index (by clicking on the hamburger button on the top right corner).

I narrowed the problem
xm.restURL gets data from DOM (data attributes on HTML tag) where in the data-xwiki-rest-url attribute there is double //
as opposed to this on the instance that works:

any clues where this is coming from? wiki description including aliases seems to be ok.

Apparently same as but this seems closed

Not really the same actually. The problem with XWIKI-12360 was that the webapp path was / so concatenating it was producing a double / but in your case the webapp path seems to be /xwiki.

No idea where that extract leading / could come from right now, is there anything special in your setup ?

Finally found the the cause

In xwiki.cfg I recently added trailing “/” in


because I noticed in the comments that it was recommended. However it caused all the trouble and removing it did the trick.


xwiki 12.9, tomcat9, nginx installed on Ubuntu

OK great that you found the cause. Looks like a bug and even probably a regression, would be great if you could create an issue about that on

1 Like

Thanks, bug issue created

Thanks. Looks like an easy fix.