Not working Adding Sync Gateway Authorization?

Hi,
Im trying to give Authorization to Sync Gateway. i followed [this link] (http://developer.couchbase.com/documentation/mobile/current/develop/training/build-first-android-app/add-sync-gateway.xml/index.html). i changed my config file Guest disabled to true.

I tried following curl url on my terminal

curl -X POST http://127.0.0.1:4985/couchbaseevents/_user/
-d ‘{“name”:“couchbase_user”, “password”:“mobile”}’
-H “Content-Type: application/json”

Here i changed my ip address with 127.0.0.1 but its not working, even i tried exactly like above also. its no useful. please assist me what is the problem it is.

Hey @itssrinadh,

What happens when you run that cURL request? Also what happens when you try port 4984?

Best,

@nraboy Here is the link of my another post. i tried but no luck.

Sounds like SG is not binding to the ip address.

in your config file can you add and restart.:
{

“logs”:[“your_log_level_here”],
“adminInterface”:“{your_ip_hard_coded_here}:4985”,
“interface”:“{your_ip_hard_coded_here}:4984”,

}

}

@househippo No i tried like your said, here is my config file.

@itssrinadh , could you remove the “http://” just “address:4984” & “address:4985”… could you also do ifconfig and use ip_address to eliminate DNS …

@househippo Let me check it.

@househippo Still No luck.

I double checked your POST from above and it works. When I’m in walrus (in-memory) SG mode.

Lets see if its a SG issue or CB issue.

Could you try this config to see if you get the same result , but add in your ip address

{
  "log": ["*"],
  "adminInterface":"{your_ip_hard_coded_here}:4985",
  "interface":"{your_ip_hard_coded_here}:4984",
  "databases": {
    "db": {
      "server": "walrus:",
      "users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } },
      "allow_empty_password": true
    }
  }
}

Source: https://github.com/couchbase/sync_gateway/blob/master/examples/basic-walrus-bucket.json

@househippo Still its failing. Here is my config file.

https://api.myjson.com/bins/xeiq

@itssrinadh , thanks for the config. your doing it right . let get more basic.

is it running :grinning: ? could you do

ps -ef | grep sync_gateway

the output should look like this.

No its failed. Here is result

@itssrinadh , its b/c its never able to start with the give ip address and you said but if I do localhost it works fine.

how are you starting sync_gateway … via service , starting binary via Ex. bin/sync_gateway your_config.json ?

Im starting Synch gate way by docker command. here is my command.

docker run -d -p 4984:4984 -p 4985:4985 couchbase/sync-gateway https://api.myjson.com/bins/xeiq