CouchDB
  1. CouchDB
  2. COUCHDB-1888

/_users/_all_docs?include_docs=true returns empty docs

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      GET http://127.0.0.1:5984/_users/_all_docs?include_docs=true

      {"total_rows":1,"offset":0,"rows":[
      {"id":"_design/_auth","key":"_design/_auth","value":

      {"rev":"1-619db7ba8551c0de3f3a178775509611"}

      ,"doc":{}}
      ]}

      On other databasese, "doc" gets returned properly

        Activity

        Hide
        Robert Newson added a comment -

        This is caused by the new public_fields feature. I had thought that it defaulted to showing all properties if not enabled, but that's demonstrably not the case. I'm not sure what the best option here is. The oddness of public_fields is my fault at the time it was introduced and also mine, again, for not fixing things before 1.4.0 was released. Hopefully this isn't affecting too many people as the _users db is an internal detail in many cases and, where not, folks generally want to expose a subset of fields anyway.

        For now, you can do;

        curl -XPUT localhost:5984/_config/couch_httpd_auth/public_fields -d '"_id,_rev,name,password_sha,password_scheme,iterations,name,roles,derived_key,salt"' to expose all standard properties.

        Show
        Robert Newson added a comment - This is caused by the new public_fields feature. I had thought that it defaulted to showing all properties if not enabled, but that's demonstrably not the case. I'm not sure what the best option here is. The oddness of public_fields is my fault at the time it was introduced and also mine, again, for not fixing things before 1.4.0 was released. Hopefully this isn't affecting too many people as the _users db is an internal detail in many cases and, where not, folks generally want to expose a subset of fields anyway. For now, you can do; curl -XPUT localhost:5984/_config/couch_httpd_auth/public_fields -d '"_id,_rev,name,password_sha,password_scheme,iterations,name,roles,derived_key,salt"' to expose all standard properties.
        Hide
        ASF subversion and git services added a comment -

        Commit 79e2391a097a8e8223239ebdc3f62980a15dd13b in branch refs/heads/1888-fix-user-fields-disabled-for-admins from Jan Lehnardt
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=79e2391 ]

        admins can always read all doc fields, regardless of public_fields

        Closes COUCHDB-1888

        Show
        ASF subversion and git services added a comment - Commit 79e2391a097a8e8223239ebdc3f62980a15dd13b in branch refs/heads/1888-fix-user-fields-disabled-for-admins from Jan Lehnardt [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=79e2391 ] admins can always read all doc fields, regardless of public_fields Closes COUCHDB-1888
        Hide
        Jan Lehnardt added a comment -

        The above patch changes the intended default. It is technically a BC break, but I think this is worth getting into 1.4.1 and/or 1.5.0

        Show
        Jan Lehnardt added a comment - The above patch changes the intended default. It is technically a BC break, but I think this is worth getting into 1.4.1 and/or 1.5.0
        Hide
        Allain Lalonde added a comment -

        That is not the behaviour I'm seeing with my installation.

        When logged in as admin the doc property is an empty doc.

        Show
        Allain Lalonde added a comment - That is not the behaviour I'm seeing with my installation. When logged in as admin the doc property is an empty doc.
        Hide
        Jan Lehnardt added a comment -

        Allain Lalonde I just proposed a patch, this is in no release yet and the issue is still open. I hope we can get it into 1.4.1 or 1.5.0 (whichever is next). If you have 1.4.0 you will see `doc:{}` which my patch aims to correct.

        Show
        Jan Lehnardt added a comment - Allain Lalonde I just proposed a patch, this is in no release yet and the issue is still open. I hope we can get it into 1.4.1 or 1.5.0 (whichever is next). If you have 1.4.0 you will see `doc:{}` which my patch aims to correct.
        Hide
        Allain Lalonde added a comment -

        My bad, the comment below the patch made "admins can always read all doc fields, regardless of public_fields" made it appear like you were talking about a workaround, not the content of the patch.

        Show
        Allain Lalonde added a comment - My bad, the comment below the patch made "admins can always read all doc fields, regardless of public_fields" made it appear like you were talking about a workaround, not the content of the patch.
        Hide
        Jan Lehnardt added a comment -

        ah, sorry about the confusion

        Show
        Jan Lehnardt added a comment - ah, sorry about the confusion
        Hide
        ASF subversion and git services added a comment -

        Commit 674aad6f37355529da81af35105fbb86de5e5974 in branch refs/heads/1888-fix-user-fields-disabled-for-admins from Jan Lehnardt
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=674aad6 ]

        admins can always read all doc fields, regardless of public_fields

        Closes COUCHDB-1888

        Show
        ASF subversion and git services added a comment - Commit 674aad6f37355529da81af35105fbb86de5e5974 in branch refs/heads/1888-fix-user-fields-disabled-for-admins from Jan Lehnardt [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=674aad6 ] admins can always read all doc fields, regardless of public_fields Closes COUCHDB-1888
        Hide
        ASF subversion and git services added a comment -

        Commit 674aad6f37355529da81af35105fbb86de5e5974 in branch refs/heads/master from Jan Lehnardt
        [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=674aad6 ]

        admins can always read all doc fields, regardless of public_fields

        Closes COUCHDB-1888

        Show
        ASF subversion and git services added a comment - Commit 674aad6f37355529da81af35105fbb86de5e5974 in branch refs/heads/master from Jan Lehnardt [ https://git-wip-us.apache.org/repos/asf?p=couchdb.git;h=674aad6 ] admins can always read all doc fields, regardless of public_fields Closes COUCHDB-1888

          People

          • Assignee:
            Unassigned
            Reporter:
            Gregor Martynus
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development