Inspecting user/role channels - user not found

I’m debugging the channels accessible to my users via SG according to using https://developer.couchbase.com/documentation/mobile/current/guides/sync-gateway/channels/index.html#inspecting-userrole-channels

So I get all my (one) users:

$ curl http://localhost:4985/acmaster/_user/

["acm_auth0%7C592b99c46b81fe5bad864ad0"]

When I try to get information for that user it shows as missing:

$ curl http://localhost:4985/acmaster/_user/acm_auth0%7C592b99c46b81fe5bad864ad0
{"error":"not_found","reason":"missing"}

But if I look directly in Couchbase I see a key/values for that user.
_sync:user:acm_auth0%7C592b99c46b81fe5bad864ad0

Is this due to the urlencoded | in the user key? The user is being automatically created via OIDC implicit flow from data provided by Auth0.

That does look like the Sync Gateway user endpoint doing some inappropriate decoding of the urlencoding in the user name.

As a workaround, I suspect you would be able to retrieve the user via an additional URL encoding of the username, e.g.:

curl localhost:4985/acmaster/_user/acm_auth0%257C592b99c46b81fe5bad864ad0

1 Like

Thanks @adamf that solved that problem. Is there somewhere I should create a ticket?

Yes - please file a ticket at https://github.com/couchbase/sync_gateway/issues

Created. Thanks again for your help.