Sync Gateway config file "is a directory"

log error with Sync Gateway,
I am following this article https://blog.couchbase.com/using-docker-with-couchbase-mobile/
And have corrected error i found in the article with the config but still get this error.

2021-01-08T20:35:10.207Z [ERR] Error reading config file /etc/sync_gateway/: read /etc/sync_gateway/: is a directory – rest.ServerMain() at config.go:1091

Any help is greatly appreciated

did you verify the sync gateway config.json at the specified location?

Share the exact docker run command that you issued (not copied from the blog post). The command indicates that a folder was inadvertently created and naturally sync gateway cannot launch with a folder path. Typically means that there was an extraneous “/” at the end of the path

Check that the sync-gateway.config file is the PATH that the docker command is issued from. Double check that it’s not a folder.

I want to verify the location of config. How do i do that?

Thank you

the commend is:
docker run -p 4984-4985:4984-4985 --network cbnetwork --name sync-gateway -d -v sync-gateway-config.json:/etc/sync_gateway/sync_gateway.json couchbase/sync-gateway -adminInterface :4985 /etc/sync_gateway/

It looks like you didn’t copy the command from the blog in its entirety (you are missing the name of the config file at the end which is why it creates a folder)

docker run -p 4984-4985:4984-4985 --network cbnetwork --name sync-gateway -d -v `pwd`/sync-gateway-config.json:/etc/sync_gateway/sync_gateway.json couchbase/sync-gateway -adminInterface :4985 /etc/sync_gateway/sync_gateway.json

Thank you, I think we are making progress, now I have a different error.

2021-01-13T21:26:08.121Z [ERR] Error reading config file /etc/sync_gateway.json: open /etc/sync_gateway.json: no such file or directory – rest.ServerMain() at config.go:1091

I used a json validator and can out as good.
my config is:
{
“interface”:“:4984”,
“logging”: {
“log_file_path”: “/var/tmp/sglogs”,
“console”: {
“log_level”: “debug”,
“log_keys”: [““]
},
“error”: {
“enabled”: true,
“rotation”: {
“max_size”: 20,
“max_age”: 180
}
},
“warn”: { “enabled”: true, “rotation”: { “max_size”: 20, “max_age”: 90 } },
“info”: { “enabled”: false },
“debug”: { “enabled”: false }
},
“databases”: {
“testing”: {
“import_docs”: “continuous”,
“enable_shared_bucket_access”:true,
“bucket”:“testing”,
“server”: “http://cb-server:8091”,
“username”: “admin”,
“password”:“password”,
“num_index_replicas”:0,
“users”:{
“GUEST”: {“disabled”:true},
“admin”: {“password”: “password”, “admin_channels”: [”
”]}
},
“revs_limit”:20
}
}
}

I found one mistake and made a change to teh cmd, here

docker run -p 4984-4985:4984-4985 --network cbnetwork --name sync-gateway -d -v sync-gateway-config.json:/etc/sync_gateway/sync_gateway.json couchbase/sync-gateway -adminInterface :4985 /etc/sync_gateway/sync_gateway.json

now this error,
2021-01-13T21:36:30.028Z [ERR] Error reading config file /etc/sync_gateway/sync_gateway.json: read /etc/sync_gateway/sync_gateway.json: is a directory – rest.ServerMain() at config.go:1091

Well… that was exactly what I pointed out in my earlier post!

Anyways,
Your command does not match what is in the post. You are missing “pwd” in your path to the config file.

docker run -p 4984-4985:4984-4985 --network cbnetwork --name sync-gateway -d -v `pwd`/sync-gateway-config.json:/etc/sync_gateway/sync_gateway.json couchbase/sync-gateway -adminInterface :4985 /etc/sync_gateway/sync_gateway.json

Then
go to the folder from where you are running command.
Check that sync_gateway.json exists in that folder
Make sure you run the command from the folder which has the config file

yes, you did point that out then I realized that I just added the “.json” instead of the entire file name.

What “psd” is this? I have tried the admin password of “password” and i get this:

docker run -p 4984-4985:4984-4985 --network cbnetwork --name sync-gateway -d -v password/sync-gateway-config.json:/etc/sync_gateway/sync_gateway.json couchbase/sync-gateway -adminInterface :4985 /etc/sync_gateway/sync_gateway.json
docker: Error response from daemon: create password/sync-gateway-config.json: “password/sync-gateway-config.json” includes invalid characters for a local volume name, only “[a-zA-Z0-9][a-zA-Z0-9_.-]” are allowed. If you intended to pass a host directory, use absolute path.
See ‘docker run --help’.

Thank you for your help

It’s not password. “pwd” is print working directory and the path to current folder. `pwd `works on on unix/ linux / mac machines

On Windows, it would be %cd% in place of pwd

Thank you that helps a lot, I am on windows therefore I used %cd%.
It is running now!
Thanks you