This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Bootstrap fails, setup.xqy no longer handles special characters in [env].properties files #831
Comments
@tdiepenbrock I see you changed the title. What kind of special chars are you talking about? I can imagine special chars could break ml-config.xml when appended to setup.xqy. There were changes related to this. |
Hi Geert,
I not only changed the title but also the full description. Originally I though the issue was with setup.xqy, and it is—but only in the form that eventually gets eval’d by the server. Properties with special characters are not being escaped for XQuery, so characters like ‘{‘ in property values completely break it. This frequently happens with the randomly-generated app user password, for example. We also send small hunks of JSON as property values, which also break it.
The steps to reproduce show how it breaks with the random password that Roxy generated for the app-user.
I also found a fix: the issue is actually in ServerConfig.properties_map() in server_config.rb. This fixes it (change in bold):
def properties_map
entries = []
@properties.each do |k, v|
entries.push %Q{map:entry("#{k}", "#{v.xquery_safe}")}
end
"map:new((\n" + entries.join(",\n ")+ "))"
end
Thanks,
Tom
|
Looks like your description edits don't show up, so thanks for the extra detail. I'll try to take a closer look at this, since I likely touched the code that caused this.. |
Oh, and the bold doesn't show up on github.. :) |
lol—just need to append “.xquery_safe” to the values in that function.
|
Our internal Jenkins was down unfortunately. Now that it is back up, it confirms issues with bootstrap. I suspect it succeeds or fails depending on generated appuser-password.. |
It is not calling .xquery_safe on the values when it creates the properties map. So any property with special characters may result in either invalid xquery or invalid entity references, etc.
|
grtjn
added a commit
to grtjn/roxy
that referenced
this issue
Aug 19, 2017
RobertSzkutak
added a commit
that referenced
this issue
Aug 23, 2017
Fixed #831: forgot to apply xquery_safe on properties map
Fixed in dev |
A hotfix was also applied to master.. |
tdiepenbrock
added a commit
to tdiepenbrock/roxy
that referenced
this issue
Dec 1, 2017
* dev: marklogic-community#854 ignore suite*.[xqy|sjs]; don't return test elements for them Because the suite* modules weren't in $test-ignore-list, they were included in the list of tests to be run. Also, don't return test elements for suite setup and teardown, or the test numbers get inflated. Make sure return values are handled correctly On failed assertion, return a stack trace instead of throwing an exception refactoring to reduce repeated code Avoid returning 409 for failed tests; refactor The code was returning HTTP 409 when a test failed. server_config.rb then watched for that and used it to return a fail code to the command line. Revised the code to look for errors in the returned text instead. Returning 409 was causing the UI to take an error path, thus not displaying some useful information. Updating github org Fixing self-test issues Synched up self-test files across ml7/8/9 Fix marklogic-community#585 Removed some debug logging marklogic-community#809: forgot to apply unique-attributes on groups marklogic-community#809: fixed typo in validate-install (rarely used) Fixed marklogic-community#809, marklogic-community#810, marklogic-community#811: pass through, and preserve comments, indent config, and fix conflicting attrs Fixed marklogic-community#831: forgot to apply xquery_safe on properties map # Conflicts: # deploy/lib/xquery/setup.xqy
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Thank you for submitting an issue!
Bug Template
The issue
Short description of the problem:
deploy/lib/setup.xqy has a syntax error at line 6369 and will not run.
What are the steps to reproduce the problem?
Tech Specs
Which Operating System are you using?
All
Which version of MarkLogic are you using?
9.0-2
Which version of Roxy are you using (see version.txt)?
1.7.7
The text was updated successfully, but these errors were encountered: