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

deploy modules throws "Undefined function conf:rewrite error" #599

Closed
garyrusso opened this issue Apr 12, 2016 · 9 comments
Closed

deploy modules throws "Undefined function conf:rewrite error" #599

garyrusso opened this issue Apr 12, 2016 · 9 comments
Assignees
Labels
Milestone

Comments

@garyrusso
Copy link
Contributor

I'm getting an ERROR: 500 "Internal Server Error" whenever I run the "ml local deploy modules" command. It looks like it's not a fatal error because I'm able to view the 3-column search page.

This is the full error.

ERROR: 500 "Internal Server Error"
ERROR: <error:error xsi:schemaLocation="http://marklogic.com/xdmp/error error.xsd"
xmlns:error="http://marklogic.com/xdmp/error" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <error:code>XDMP-UNDFUN</error:code>
  <error:name>err:XPST0017</error:name>
  <error:xquery-version>1.0-ml</error:xquery-version>
  <error:message>Undefined function</error:message>
  <error:format-string>XDMP-UNDFUN: (err:XPST0017) Undefined function conf:rewrite()</error:format-string>
  <error:retryable>false</error:retryable>
  <error:expr> </error:expr>
  <error:data>
    <error:datum>conf:rewrite()</error:datum>
  </error:data>
  <error:stack>
    <error:frame>
      <error:line>7</error:line>
      <error:column>9</error:column>
      <error:operation>xdmp:eval("&amp;#10;        import module namespace conf = &amp;quot;http://marklog...", (fn:QName("","method"), "PUT", fn:QName("","uri"), ...))</error:operation>
      <error:xquery-version>1.0-ml</error:xquery-version>
    </error:frame>
    <error:frame>
      <error:uri>/roxy/rewrite.xqy</error:uri>
      <error:line>40</error:line>
      <error:column>6</error:column>
      <error:variables>
        <error:variable>
          <error:name xmlns="">uri</error:name>
          <error:value>"/v1/config/properties"</error:value>
        </error:variable>
        <error:variable>
          <error:name xmlns="">method</error:name>
          <error:value>"PUT"</error:value>
        </error:variable>
        <error:variable>
          <error:name xmlns="">path</error:name>
          <error:value>"/v1/config/properties"</error:value>
        </error:variable>
        <error:variable>
          <error:name xmlns="">final-uri</error:name>
          <error:value>()</error:value>
        </error:variable>
      </error:variables>
      <error:xquery-version>1.0-ml</error:xquery-version>
    </error:frame>
  </error:stack>
</error:error>
@garyrusso
Copy link
Contributor Author

I see this is a dupe from last year. [http://markmail.org/thread/4zji3dqg7oteaseo]

@RobertSzkutak
Copy link
Contributor

@dmcassel has a nice workaround for the Roxy rewriter on ML8 in this PR: #588

(Or of course, if you are able to, use a different rewriter)

@dmcassel
Copy link
Collaborator

... and I'd love to get feedback on that workaround.

@driekus77
Copy link

Hi all,

I new to MarkLogic and XQuery and have a problem with the workarround. It fixes the conf:rewrite error but in stead I get another error: Need privilege: http://marklogic.com/xdmp/privileges/xdmp-get-server-field. I have no clue how to set this privillege because in my securtiy settings I can't find this privilege.

Help is welcome and thanks for the fix/workarround.

Kind regards,
Henry

@RobertSzkutak
Copy link
Contributor

Hi @driekus77 ,

First, determine what user you are running the query as. Second, determine which roles are assigned to that user. Finally, ensure that at least one of those roles contains the proper privilege.

You can find all of these settings in the "Security" section of the admin console. Or you can set these in your ml-config.xml file and bootstrap again with Roxy.

Happy to help,
Rob

@grtjn
Copy link
Contributor

grtjn commented Jun 3, 2016

@garyrusso This is a dupe of #416, which was closed in the past as wontfix. @dmcassel did open PR #588 with a more robust workaround, but even that can be considered fragile. It still relies on code that likely will disappear in future..

@grtjn
Copy link
Contributor

grtjn commented Jun 3, 2016

@garyrusso By the way, you'd make Dave very happy if you could try out that PR, and let us know if that worked for you or not.

@garyrusso
Copy link
Contributor Author

@grtjn @dmcassel Sorry for the delayed feedback. I've been using the dynamic rule lookup PR for the past few weeks and it's working well.

@grtjn
Copy link
Contributor

grtjn commented Jun 4, 2016

Fixed in dev..

@grtjn grtjn closed this as completed Jun 4, 2016
@grtjn grtjn added this to the 1.7.4 milestone Jun 4, 2016
@grtjn grtjn added the bug label Jun 4, 2016
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