Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-3197

[3.1.2 Backport] Cannot update db config from implicit `_default` scope to explicit `_default` scope

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 3.1.2
    • 3.1.0
    • SyncGateway
    • Security Level: Public
    • None
    • CBG Sprint 136
    • 1

    Description

      Trying to update a database to specify an explicit _default scope instead of an implicit one triggers the handling intended for disallowing changing scopes on a database.

       

      This is obviously incorrect, as it prevents being able to move from a non-collection aware database to one that contains a named collection inside the _default scope.

       

      $ curl http://Administrator:password@localhost:4985/db1/_config
      {"bucket":"b1","name":"db1","cache":{"rev_cache":{}},"offline":false,"num_index_replicas":0}
      $ curl -X POST http://Administrator:password@localhost:4985/db1/_config -H 'Content-Type: application/json' -d '{"scopes":{"_default":{"collections":{"_default":{}}}}}'
      {"error":"Bad Request","reason":"1 errors:\ncannot change scopes after database creation"}
      

       

      Workaround until fix: Delete and recreate the database with an explicit `_default` scope:

      $ curl -X DELETE http://Administrator:password@localhost:4985/db1/
      {}
      $ curl -X PUT http://Administrator:password@localhost:4985/db1/ -H 'Content-Type: application/json' -d '{"bucket":"b1","num_index_replicas":0,"scopes":{"_default":{"collections":{"_default":{}}}}}'
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ben.brooks Ben Brooks
              ben.brooks Ben Brooks
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty