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

bootstrap broken with ML 8.0-6 #670

Closed
rlouapre opened this issue Oct 18, 2016 · 5 comments
Closed

bootstrap broken with ML 8.0-6 #670

rlouapre opened this issue Oct 18, 2016 · 5 comments

Comments

@rlouapre
Copy link
Contributor

I get the following error:

Bootstrapping your project into MarkLogic 8 on localhost...
ERROR: 500 "SECURITY-BADREQUEST (err:FOER0000): Invalid CSRF token. Refresh Query Console to generate a new secure token."
ERROR: {"error":{"format-string":"SECURITY-BADREQUEST (err:FOER0000): Invalid CSRF token. Refresh Query Console to generate a new secure token."}}
@rlouapre
Copy link
Contributor Author

I will try to provide a PR this week - but here is a fix working for me:

  def execute_query(query, properties = {})
    r = nil
    if @server_version == 4
      r = execute_query_4 query, properties
    elsif @server_version == 5 || @server_version == 6
      r = execute_query_5 query, properties
    elsif @server_version == 7 # 7
      r = execute_query_7 query, properties
    else # 8
      r = execute_query_8 query, properties
    end

    raise ExitException.new(r.body) unless r.code.to_i == 200

    return r
  end

  # Use POST /LATEST/eval - https://docs.marklogic.com/8.0/REST/POST/v1/eval
  def execute_query_8(query, properties = {})
    params = {}
    if properties[:db_name] != nil
      params["database"] = properties[:db_name]
    end
    params["xquery"] = query
    headers = {
      "Content-type" => "application/x-www-form-urlencoded",
      "Accept" => "multipart/mixed"
    }
    url = "#{@protocol}://#{@hostname}:#{@qconsole_port}/LATEST/eval"
    go(url, "post", headers, params, nil)
  end

@dmcassel
Copy link
Collaborator

I believe this is working on the dev branch already. @rlouapre can you test that?

Assuming that /v1/eval fix does work for 8.0-6, I think we need to do a new release as soon as possible.

@rlouapre
Copy link
Contributor Author

Yes it is working in dev branch.

@dmcassel dmcassel added this to the 1.7.4 milestone Oct 18, 2016
@dmcassel
Copy link
Collaborator

Since we have confirmation that this is not a new bug, but something already fixed in dev, I'm going to close.

@rlouapre
Copy link
Contributor Author

I am not sure the reason sometime /LATEST/ is used sometimes /v1/...

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

No branches or pull requests

2 participants