eXist-db 4.1.0: App is broken when visiting index.html or admin.html
Closed this issue · 5 comments
- From a clean checkout and build of eXist-db 4.1.0.
- Install the EXPath Public Repo app.
- If you try and visit the
http://localhost:8080/exist/apps/public-repo/index.html
orhttp://localhost:8080/exist/apps/public-repo/admin.html
pages from a Web Browser, nothing happens until the timeout set inexist:timeout
ofmodules/view.xql
is reached, and then an error is returned.
I have tried with versions 0.5.2 and 0.6.0 of this application. I have also tried rolling back versions of shared-resources
, in-case the problem was with the templating module. Still with no improvement.
If you wait for the timeout, you will eventually see the following error in the web browser:
<exception>
<path>/db/apps/public-repo/modules/view.xql</path>
<message>exerr:ERROR The query exceeded the predefined timeout and has been killed. [at line 205, column 9]
In function: templates:call-by-introspection(element(), map(*), map(*), function(*)) [187:28:/tmp/exist-tmp/webapp/WEB-INF/data/expathrepo/shared-0.5.0/content/templates.xql]
templates:call(item(), element(), map(*)) [143:37:/tmp/exist-tmp/webapp/WEB-INF/data/expathrepo/shared-0.5.0/content/templates.xql]
templates:process(node()*, map(*)) [131:51:/tmp/exist-tmp/webapp/WEB-INF/data/expathrepo/shared-0.5.0/content/templates.xql]
templates:process(node()*, map(*)) [88:9:/tmp/exist-tmp/webapp/WEB-INF/data/expathrepo/shared-0.5.0/content/templates.xql]
templates:apply(node()+, function(*), map(*)?, map(*)?) [27:5:/tmp/exist-tmp/webapp/WEB-INF/data/expathrepo/shared-0.5.0/content/templates.xql]
</message>
</exception>
I have no idea wha the root cause of this is. However I did notice that there seems to be some sort of problem with function args and recursive function construction. I added the following at line 260 of $EXIST_HOME/src/org/exist/xquery/FunctionFactory.java
:
System.out.println(System.nanoTime() + ": MODULE=" + module.getNamespaceURI() + ": functionCall=" + qname.toString() + "#" + params.size());
Which produces output like:
270283303449719: MODULE=http://exist-db.org/xquery/request: functionCall=request:get-data#0
270283303488609: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:apply#4
270283304458247: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:lookup-param-from-restserver#1
270283304558258: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:lookup-param-from-restserver#1
270283306352044: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:lookup-param-from-restserver#1
270283306485732: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:lookup-param-from-restserver#1
270283375078672: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:surround#2
270283375948570: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:surround#3
270283376288965: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:surround#4
270283376548650: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:surround#5
270283376769821: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:surround#6
270283497209840: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#2
270283497617057: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#3
270283497839913: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#4
270283498058109: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#5
270283498314630: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#6
270283498519123: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#7
270283498812829: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#8
270283498985470: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#9
270283499189628: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#10
270283499189628: MODULE=http://exist-db.org/xquery/templates: functionCall=templates:expand-links#11
...
Basically functionCall=templates:expand-links#11
keeps incrementing by one (e.g. #12
, #13
... etc.) , ad infinitum until the timeout is hit.
I have no idea why expand-link
would not work properly on exist-db.org. That it isn't working on local installs is why we have the exist-apps-parent
Why is templates:surround
called 5 times? I doubt it appears 5 times in the templates that are evaluated.
removing templates:expand-links in templates/page.html fixes the issue in terms of "admin and index.html" render again. But I can't say (yet) if this breaks anything else since I was not able to find out what templates:expand-links did. @dizzzz, @wolfgangmm any idea?
@windauer IIRC it creates the links that appear inside the navbar to demo, funcdocs, documentation etc.
see eXist-db/documentation#154
I honestly think this will not be fixed. Please reopen if you think otherwise.