Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eXist-db 4.1.0: App is broken when visiting index.html or admin.html #21

Closed
adamretter opened this issue May 12, 2018 · 5 comments
Closed
Assignees
Labels

Comments

@adamretter
Copy link
Member

adamretter commented May 12, 2018

  1. From a clean checkout and build of eXist-db 4.1.0.
  2. Install the EXPath Public Repo app.
  3. If you try and visit the http://localhost:8080/exist/apps/public-repo/index.html or http://localhost:8080/exist/apps/public-repo/admin.html pages from a Web Browser, nothing happens until the timeout set in exist:timeout of modules/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.

@duncdrum
Copy link
Contributor

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

@line-o
Copy link
Member

line-o commented May 16, 2018

Why is templates:surround called 5 times? I doubt it appears 5 times in the templates that are evaluated.

@windauer
Copy link
Member

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?

@duncdrum
Copy link
Contributor

duncdrum commented May 16, 2018

@windauer IIRC it creates the links that appear inside the navbar to demo, funcdocs, documentation etc.
see eXist-db/documentation#154

@line-o
Copy link
Member

line-o commented Feb 25, 2021

I honestly think this will not be fixed. Please reopen if you think otherwise.

@line-o line-o closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants