Although allowing guest users, couchbase requires username & pass

up vote
0
down vote
favorite
I created couchbase bucket with name “app”

In the sync-gateway file I allowed guest users :

"users": {
    "GUEST": {
        "disabled": false,
        "admin_channels": ["*"]
    }
}

I was able to access the database normally from the link : xyz…dockerapp.io:4984/app

But after few hours of developing, It started to require username and password:(without any changing in the sync config file!)

I searched for the reason but without avail, any help will be appreciated

THANK YOU

@ahmedelgendy from the Sync Gateway config snippet, you should be able to access your Sync Gateway DB without credentials.

If Sync Gateway is running behind a proxy server then is it possible that the route has been configured to require authentication?

Are you able to directly access the sync Gateway REST API using a browser or from a command prompt (e.g. using curl), without providing credentials?

Unfortunately no I cant access,
I noticed that this situation occurs if i deleted some docs from the couchbase server node,
does it affect the credentials?

@ahmedelgendy What kind of docs did you delete from the server node?

I deleted everything

In general, you shouldn’t directly delete any documents in the bucket used by Sync Gateway - any deletes should be done through the Sync Gateway REST API.

Sync Gateway also stores all of its non-application data (users, roles, sessions, replication checkpoints, and more) in the bucket.

While developing, if you want to clear everything out and start fresh, you can flush the bucket, but you’ll need to restart Sync Gateway.

Some more detail: The users section of the config file is only used when SG launches, to create the initial user account(s). Incoming requests are never authenticated against what’s in the config file, only against the live user account data stored in the bucket.

And let me repeat the important safety tip: never modify Sync Gateway’s bucket yourself, except for flushing it completely after stopping SG.

Ohh it was my fault!
Thank you Adam, Jens and Andy for explaining!