0

I am having issue in connection with server. I had downloaded the project from https://developer.couchbase.com/documentation/mobile/current/training/develop/adding-synchronization/index.html

Here I had done everything correctly like cd c:\program files (x86)\Couchbase\sync_gateway.exe sync-gateway-config.json here error is coming like:

FATAL: Failed to start HTTP server on 127.0.0.1:4985: listen tcp 
127.0.0.1:4985: bind: Only one usage of each socket address (protocol/network address/port)
is normally permitted. -- rest.(*ServerConfig).Serve() at config.go:705

And on my android studio:

http://localhost:4984/sync_gateway/_local/d7b1dc31d5dc922ea4253245dcf077660540331d

by clicking on this link I am getting {"error":"not_found","reason":"missing"}

And by this http://localhost:4984/sync_gateway I am getting

{"committed_update_seq":3,"compact_running":false,"db_name":"sync_gateway","disk_format_version":0,"instance_start_time":1492768709992675,"purge_seq":0,"state":"Online","update_seq":3}

I want to add sync between mobile and couchdatabase.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189

1 Answers1

0

I think you have two problems here.

The first error starting Sync Gateway indicates an application is already using port 4985. You'd want to make sure you don't already have an instance of Sync Gateway running. If there's a different application already using the port, you can either stop it or change the ports used by Sync Gateway. (You can do that easily in the config file.)

I'm not quite sure what you're trying to do via the links you talk about with Android Studio. However, it's important to know that to access an application running on the same machine as your emulator, you need to use a different IP address. If you're using the standard Android emulator, you need to use 10.0.2.2 in place of localhost. See this SO post for details: How to connect to my http://localhost web server from Android Emulator in Eclipse

Community
  • 1
  • 1
Hod
  • 2,236
  • 1
  • 14
  • 22