Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Bootstrapping is broken in ML8 EA1 #241

Closed
dmcassel opened this issue May 12, 2014 · 12 comments
Closed

Bootstrapping is broken in ML8 EA1 #241

dmcassel opened this issue May 12, 2014 · 12 comments
Labels
Milestone

Comments

@dmcassel
Copy link
Collaborator

Bootstrap against ML8 EA1:

$ ./ml local bootstrap
Bootstrapping your project into MarkLogic on localhost...
ERROR: 500 "XDMP-AS: (err:XPTY0004) $query as xs:string -- Invalid coercion: () as xs:string"
ERROR: {"error":{"format-string":"XDMP-AS: (err:XPTY0004) $query as xs:string -- Invalid coercion: () as xs:string”}}

I hear from engineering that the request interface did not change, but some of the responses may have. The error above is probably from parsing the response.

@dmcassel dmcassel added the bug label May 12, 2014
@dmcassel
Copy link
Collaborator Author

Looks like we need to start noticing "server-version=8". We'll need to do more before the final ML8, so we should view this as an interim fix.

@dmcassel dmcassel added this to the v1.6 milestone May 12, 2014
@dallemang
Copy link

For what it's worth, I got this to work in ML8, but not by changing Roxy.

If you go to evaler.xqy in the qconsole endpoint, you can change line 129 to guard against an empty $query with something simple like

                        qceval:do-eval($qid, if (empty($query)) then  "" else $query, "", $eval-opts, $query-type),

This protects it from that () value, and the whole thing works.

I don't know how to change this on the Roxy side; it is a remote call to the server through this page, so the Ruby code (as far as I can tell) doesn't have a lot of say about how it will be encoded.

@dmcassel
Copy link
Collaborator Author

dmcassel commented Jun 7, 2014

dallemang, thanks for posting the work-around. We've discussed this with Engineering and there's a change coming that will let us fix it, possibly in EA2 but more likely in EA3.

@dmcassel dmcassel mentioned this issue Jun 7, 2014
@grtjn
Copy link
Contributor

grtjn commented Aug 26, 2014

The issue is raised by this piece of code, unfortunately on server-side, at line 80 and further of MarkLogic/Apps/qconsole/endpoints/evaler.xqy:

            let $query :=
                    if ($qid and $query-text and ($dirty eq "true"))
                    then $query-text
                    else amped-qconsole:qconsole-doc(concat("/queries/", $qid, ".txt"))

The way we call the evaler, we need the code to enter the if-part, otherwise the POST'ed query won't get executed. Faking a qid won't work, as this code is preceded by checks whether qid is valid. I kind of guess it should have actually been:

            let $query :=
                    if ($query-text and (empty($qid) or ($dirty eq "true")))
                    then $query-text
                    else amped-qconsole:qconsole-doc(concat("/queries/", $qid, ".txt"))

I am afraid we depend on a fix in ML8 if we want to keep using the current bootstrap approach..

@grtjn
Copy link
Contributor

grtjn commented Aug 27, 2014

Engineering is going to provide new eval endpoints that should be possible to use instead, but that is still work in progress, and I'd rather provide a working solution now. I'm going to build in an evaler REST extension that can be deployed on the fly, to make bootstrap and adhoc execute_query calls work on EA2 as well..

@grtjn
Copy link
Contributor

grtjn commented Aug 27, 2014

Note, the roxy-evaler also works against MarkLogic 7, maybe even against MarkLogic 6..

@paxtonhare
Copy link
Contributor

I just pushed a fix to make this work on ML 8

@grtjn
Copy link
Contributor

grtjn commented Aug 28, 2014

Nice work Paxton, less intrusive than my solution. Don't throw out my work yet though, might come in handy.. ;-)

dmcassel pushed a commit that referenced this issue Aug 28, 2014
…with exteval REST extension that replaces QConsole evaler endpoint, triggered with server-version=8ea
dmcassel added a commit that referenced this issue Aug 28, 2014
@paxtonhare paxtonhare modified the milestone: v1.6 Oct 31, 2014
@DavidEnnis-CleverLlamas
Copy link

Hi.

I know Roxy is an external project. However, in this thread, it was stated that the likely final solution for Roxy that included changes by the Engineering team. See - specifically post of 7 June and 27 August.

The question:
Do you consider that these changes are implemented in EA3 so that I can consider Roxy 'officially' usable in MarkLogic 8 based on the current code or would you consider that all workarounds are now replaces with a final solution? It appears to me that the current solution (although working) is still based on 'temporary' solutions such as commit 74c9372. Or perhaps that solution makes the need for ML8 internal changes obsolete..

The reason: I need to give a client information related to Roxy and MarkLogic 8 and do not want to do so if the current solution for Roxy is based on workarounds and not a final solution.

I have posted a similiar question in the ML8 EA forums as well and referred to this thread.

Kind Regards,
David Ennis

@dmcassel
Copy link
Collaborator Author

dmcassel commented Jan 4, 2015

I believe the current solution is the official one and that no changes from Engineering were needed. @paxtonhare can you confirm?

@grtjn
Copy link
Contributor

grtjn commented Jan 4, 2015

To put it short: we found ways around, that didn't require Engineering to revert or change anything. Works fine with all ea's of ml 8, and equally well with ml 7..

Sent from Samsung Mobile

-------- Oorspronkelijk bericht --------
Van: David Cassel notifications@github.com
Datum: 04-01-2015 17:21 (GMT+01:00)
Aan: marklogic/roxy roxy@noreply.github.com
Cc: Geert geert.josten@xs4all.nl
Onderwerp: Re: [roxy] Bootstrapping is broken in ML8 EA1 (#241)

I believe the current solution is the official one and that no changes from Engineering were needed. @paxtonhare can you confirm?


Reply to this email directly or view it on GitHub.

@DavidEnnis-CleverLlamas
Copy link

Thanks for the reply. I've also updated my EA forum post with the same information.

Kind Regards,
David Ennis

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants