Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-7760

Service Level N1QL request timeout syntax is incorrect

    XMLWordPrintable

Details

    Description

      The command used to modify the Service Level request timeout for N1QL queries is specified in the docs as follows:

      curl http://hostname:8093/admin/settings -d '{"timeout":"30m"}' -u user:pword
      

      This command is not valid and throws the error Incorrect value 30m for setting: timeout:

      $ curl http://localhost:8093/admin/settings -d '{"timeout":"30m"}' -u Administrator:password
      {"caller":"set_params:116","code":2032,"key":"admin.setting_type_error","message":"Incorrect value 30m for setting: timeout"}
      

      The correct syntax accepts a number in nanoseconds without any units and is as follows:

      curl http://hostname:8093/admin/settings -d '{"timeout":30}' -u user:pword
      

      The above command sets the timeout to 30 nanoseconds.

      We should change to docs to reflect this. We should also remove the statement mentioning that the fields are mandatory:

      Its format includes an amount and a mandatory unit. Valid units are:

      ns (nanoseconds)

      us (microseconds)

      ms (milliseconds)

      s (seconds)

      m (minutes)

      h (hours)

      Ex: "10ms" (10 milliseconds) and "0.5s" (half a second).

      Alternatively, we could change the Query Settings REST API code to accept the units as mentioned in the docs.

      Attachments

        Activity

          People

            simon.dew Simon Dew
            neha.satish Neha Satish (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty