docker icon indicating copy to clipboard operation
docker copied to clipboard

Unable to start Sync Gateway using docker-compose up command line tool

Open Visput opened this issue 7 years ago • 2 comments

I am using docker-compose to run couchbase server and sync gateway. I am following instructions as described in README.md.

Couchbase is running fine. I was able to start and configure it. However Sync Gateway throwing an error:

WARNING: Error from Incr in sequence allocator (0) - attempt (3/3): EOF -- db.(*sequenceAllocator).incrWithRetry() at sequence_allocator.go:88

And then

FATAL: Error opening database: Unable to increment sequence: EOF -- rest.RunServer() at config.go:758

Full logs:

docker-compose up Starting couchbaseserversyncgateway_sync-gateway_1 ... couchbaseserversyncgateway_couchbase-server_1 is up-to-date Starting couchbaseserversyncgateway_sync-gateway_1 ... done Attaching to couchbaseserversyncgateway_couchbase-server_1, couchbaseserversyncgateway_sync-gateway_1 sync-gateway_1 | 2017-12-21T22:16:32.095Z Enabling logging: [HTTP+] sync-gateway_1 | 2017-12-21T22:16:32.096Z ==== Couchbase Sync Gateway/1.4.0(2;9e18d3e) ==== sync-gateway_1 | 2017-12-21T22:16:32.096Z requestedSoftFDLimit < currentSoftFdLimit (5000 < 1048576) no action needed sync-gateway_1 | 2017-12-21T22:16:32.096Z Opening db /db as bucket "default", pool "default", server http://couchbase-server:8091 sync-gateway_1 | 2017-12-21T22:16:32.097Z Opening Couchbase database default on http://couchbase-server:8091 as user "default" sync-gateway_1 | _time=2017-12-21T22:16:32.118+00:00 _level=INFO _msg= Trying with selected node 0 sync-gateway_1 | _time=2017-12-21T22:16:32.120+00:00 _level=INFO _msg= Trying with http://172.19.0.3:8091/pools/default/bucketsStreaming/default couchbase-server_1 | Starting Couchbase Server -- Web UI available at http://:8091 and logs available in /opt/couchbase/var/lib/couchbase/logs couchbase-server_1 | Starting Couchbase Server -- Web UI available at http://:8091 and logs available in /opt/couchbase/var/lib/couchbase/logs couchbase-server_1 | Starting Couchbase Server -- Web UI available at http://:8091 and logs available in /opt/couchbase/var/lib/couchbase/logs couchbase-server_1 | Starting Couchbase Server -- Web UI available at http://:8091 and logs available in /opt/couchbase/var/lib/couchbase/logs sync-gateway_1 | _time=2017-12-21T22:16:32.130+00:00 _level=INFO _msg=Got new configuration for bucket default sync-gateway_1 | _time=2017-12-21T22:16:32.293+00:00 _level=INFO _msg= Trying with selected node 0 sync-gateway_1 | 2017-12-21T22:16:32.440Z WARNING: Error from Incr in sequence allocator (0) - attempt (1/3): EOF -- db.(*sequenceAllocator).incrWithRetry() at sequence_allocator.go:88 sync-gateway_1 | 2017-12-21T22:16:32.453Z WARNING: Error from Incr in sequence allocator (0) - attempt (2/3): EOF -- db.(*sequenceAllocator).incrWithRetry() at sequence_allocator.go:88 sync-gateway_1 | 2017-12-21T22:16:32.466Z WARNING: Error from Incr in sequence allocator (0) - attempt (3/3): EOF -- db.(*sequenceAllocator).incrWithRetry() at sequence_allocator.go:88 sync-gateway_1 | 2017-12-21T22:16:32.476Z WARNING: Too many unsuccessful Incr attempts in sequence allocator - giving up (0): EOF -- db.(*sequenceAllocator).incrWithRetry() at sequence_allocator.go:94 sync-gateway_1 | 2017-12-21T22:16:32.476Z WARNING: Error from Incr in _reserveSequences(0): Unable to increment sequence: EOF -- db.(*sequenceAllocator)._reserveSequences() at sequence_allocator.go:65 sync-gateway_1 | 2017-12-21T22:16:32.476Z FATAL: Error opening database: Unable to increment sequence: EOF -- rest.RunServer() at config.go:758 couchbaseserversyncgateway_sync-gateway_1 exited with code 1

Visput avatar Dec 21 '17 22:12 Visput

I think it might be related to the order in which the containers are started. Note this SG issues which mentions that same error when the underlying couchbase server bucket is deleted:

https://github.com/couchbase/sync_gateway/issues/1655

So that error might have happened when you were configuring couchbase server.

The docker compose script looks flawed in the sense that SG will try to connect to an un-configured Sync Gateway.

Is it possible to restart one container in the docker compose?

If not, I'd recommend just ignoring the docker compose and starting the containers individually, and make sure they are in the same network.

@rajagp do you have that blog post about Couchbase + Sync Gateway in docker handy?

tleyden avatar Dec 21 '17 23:12 tleyden

Tried to restart just sync-gateway with command docker-compose restart sync-gateway. Sync Gateway restarts and fail again with the same error.

Visput avatar Dec 22 '17 03:12 Visput