I am getting the following illegal user name error in Terminal. I am installing on MacBook. What does this error mean? I have sync_gateway folder created under ‘users’ and there are folders like ‘data’, ‘logs’ and sync_gateway.json file there.
What does this sync_gateway folder mean? Does this a bucket name similar to given in server? Why does this error ‘illegal user name’ come?
MyMacbook:service administrator$ sudo ./sync_gateway_service_install.sh
Password:
chown: sync_gateway: illegal user name
chown: sync_gateway: illegal user name
MyMacbook:service administrator$
Sure, I’ll try. I am using MacBook. Path to sync gateway config.json is the one I have it in “Users/sync_gateway/sync_gateway.json” ? or It might be somewhere else?
Users/sync_gateway/sync_gateway.json: contains the following data.
{
“log”: [“HTTP+”],
“adminInterface”: “127.0.0.1:4985”,
“interface”: “0.0.0.0:4984”,
“databases”: {
“db”: {
“server”: “walrus:data”,
“users”: {
“GUEST”: {“disabled”: false, “admin_channels”: ["*"] }
}
}
}
}
Do I need to modify this with my server bucket DB name, server?
Sure, I’ll try. Path to sync gateway config.json is the one I have it in Users/sync_gateway/sync_gateway.json ?
No, in this case it’s the relative path. Create the sync-gateway-config.json file in the bin directory and then run ~/Downloads/couchbase-sync-gateway/bin/sync_gateway sync-gateway-config.json.
I created a empty “sync-gateway-config.json” in " ~/Downloads/couchbase-sync-gateway/bin". and run this command. Here is the result,
2017-04-25T10:30:42.476-05:00 Opening Couchbase database db on http://localhost:8091 as user "db"
2017-04-25T10:30:45.043-05:00 Opening Couchbase database db on http://localhost:8091 as user "db"
2017-04-25T10:30:50.166-05:00 Opening Couchbase database db on http://localhost:8091 as user "db"
2017-04-25T10:31:00.412-05:00 Opening Couchbase database db on http://localhost:8091 as user "db"
2017-04-25T10:31:20.897-05:00 Opening Couchbase database db on http://localhost:8091 as user "db"
2017-04-25T10:31:20.899-05:00 WARNING: RetryLoop for Attempt to connect to bucket : db giving up after 14 attempts – base.RetryLoop() at util.go:301
2017-04-25T10:31:20.899-05:00 FATAL: Error opening database: 502 Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port. Detailed error: HTTP error 401 Unauthorized getting “http://localhost:8091/pools”: – rest.RunServer() at config.go:758
MyMacbook:Downloads administrator$
Bucket name may be causing with this error? Where Can I change bucket name? I don’t have bucket name like “db” in Couchbase server. I have default bucket names “travel-sample” etc.
Couchbase server is running fine.
2017-04-25T10:46:56.019-05:00 Opening Couchbase database db on http://localhost:8091 as user “db”
2017-04-25T10:47:16.568-05:00 Opening Couchbase database db on http://localhost:8091 as user “db”
2017-04-25T10:47:16.570-05:00 WARNING: RetryLoop for Attempt to connect to bucket : db giving up after 14 attempts – base.RetryLoop() at util.go:301
2017-04-25T10:47:16.570-05:00 FATAL: Error opening database: 502 Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port. Detailed error: HTTP error 401 Unauthorized getting “http://localhost:8091/pools”: – rest.RunServer() at config.go:758
MyMacbook:Downloads administrator$
Attached reference screenshot is for couchbase server and buckets,
Please ignore my previous comments. Now I got ‘server starting …’ message,
MyMacbook:Downloads administrator$ ~/Downloads/couchbase-sync-gateway/bin/sync_gateway sync-gateway-config.json
2017-04-25T10:56:31.715-05:00 Enabling logging: [HTTP+]
2017-04-25T10:56:31.716-05:00 ==== Couchbase Sync Gateway/1.4.1(3;ddffd85) ====
2017-04-25T10:56:31.716-05:00 Configured process to allow 5000 open file descriptors
2017-04-25T10:56:31.716-05:00 Opening db /db as bucket “travel-sample”, pool “default”, server http://localhost:8091
2017-04-25T10:56:31.716-05:00 Opening Couchbase database travel-sample on http://localhost:8091 as user “travel-sample”
_time=2017-04-25T10:56:31.737-05:00 _level=INFO _msg= Trying with http://127.0.0.1:8091/pools/default/bucketsStreaming/travel-sample
_time=2017-04-25T10:56:31.737-05:00 _level=INFO _msg= Trying with selected node 0
_time=2017-04-25T10:56:31.741-05:00 _level=INFO _msg=Got new configuration for bucket travel-sample
_time=2017-04-25T10:56:32.145-05:00 _level=INFO _msg= Trying with selected node 0
2017-04-25T10:56:32.523-05:00 Using default sync function ‘channel(doc.channels)’ for database "db"
2017-04-25T10:56:32.524-05:00 Reset guest user to config
2017-04-25T10:56:32.525-05:00 Starting admin server on 127.0.0.1:4985
2017-04-25T10:56:32.533-05:00 Starting server on 0.0.0.0:4984 …
I think the sync gateway and server is running fine. I am trying to run sample project > GrocerySync. In the sample > GrocerySync iOS project, i modified like below, #define kDatabaseName @“travel-sample” #define kServerDbURL @“http://localhost:4984/travel-sample/”
and, also modified “sync_gateway_config.json” which is inside this project,
**> But i see the log as , ** > 2017-04-25T11:47:09.184-05:00 HTTP: #002: POST /travel-sample/_revs_diff > 2017-04-25T11:47:09.184-05:00 HTTP: #002: --> 404 no such database “travel-sample” (0.3 ms)
In case you haven’t figured this out already -
The “db” under “databases” in the sync_gateway_config.json file refers to the name of the database. So, you will have to replace “db” with “travel-sample” (the name of your new database) and restart the Sync Gateway.
Running into the same problem SG 1.5. Pointing to Couchbase-Server 5.0 with travel-sample bucket. Tried just the bucket as travel-sample, and then also the db as travel-sample.
Thanks Priya. I am using the out-of-box Docker-based sample, for which I added default admin credentials into the travel-sample db. Same results. Do I need to create a different user and grant access to the bucket?
I uninstalled the Docker instance of Couchbase-Server 5.0, and installed it just as an app. Noticed that each bucket now requires a user. The default admin account did not show up under Users, so I created one, and gave full bucket access to the travel-sample bucket.That is the only permission I gave the new user.
Then I restarted sync gateway with the new user’s credentials. The admin port started, but it hasn’t connected to Couchbase Server. The new error is:
go-couchbase: TAP connection lost; reconnecting to bucket “travel-sample” in 1s
This is an issue with accounts on your system. By default, the install script expects to set everything up to run as user “sync_gateway”, but it doesn’t create the actual user account for you.
You can either create an account to run under, or just run it as yourself. Specify the account with the --runas option.