My application is spring boot based trying to connect to Couchbase using spring-data-couchbase, which opens a bucket on remote Couchbase 7.1.1 EE server and inserts a document.
Spring Boot Version: 2.3.1.RELEASE Couchbase Server Version: 7.1.1 EE spring-data-couchbase : 4.3.5 (This internally uses couchbase java-client: 3.2.7)
The connection works fine if my application is placed on same server as Couchbase server. If my application is located remotely then it doesn't work
In Couchbase web console I see IP address of server as 0.0.0.0.
I also have couchbase installed on localhost and when my application tried to save data in remote couchbase it instead saved in the localhost. I suspect 0.0.0.0 as the server IP address is causing this.
When the cluster is created at the first time, default IP is populated as 0.0.0.0 (manually changing it has no effect) but in all other installations I have seen default IP as 127.0.0.1
Related Query but couldnt find what was the resolution Couchbase client trying to connect to localhost while configured to remote server
----------Logs -------
C:\Program Files\Java\jdk1.8.0_202\bin\java.exe" -Dfile.encoding=windows-1252 -jar C:\TBAPI_Code\TBAPI_TFNURG_CB_POC\target\TBAPI_TFNURG_CB_POC.jar
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.6.6)
2023-03-15 00:34:40.705 [main] INFO main.DemoApplication - Starting DemoApplication using Java 1.8.0_202 on WS-15355 with PID 18276 (C:\TBAPI_Code\TBAPI_TFNURG_CB_POC\target\TBAPI_TFNURG_CB_POC.jar started by nesa0722 in C:\TBAPI_Code\TBAPI_TFNURG_CB_POC\src\main\java\main)
2023-03-15 00:34:40.708 [main] INFO main.DemoApplication - No active profile set, falling back to 1 default profile: "default"
2023-03-15 00:34:41.284 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data Couchbase repositories in DEFAULT mode.
2023-03-15 00:34:41.499 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 209 ms. Found 1 Couchbase repository interfaces.
2023-03-15 00:34:41.718 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data Couchbase repositories in DEFAULT mode.
2023-03-15 00:34:41.722 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 3 ms. Found 0 Couchbase repository interfaces.
2023-03-15 00:34:42.654 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 26901 (http)
2023-03-15 00:34:42.668 [main] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-26901"]
2023-03-15 00:34:42.669 [main] INFO o.a.catalina.core.StandardService - Starting service [Tomcat]
2023-03-15 00:34:42.669 [main] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.60]
2023-03-15 00:34:42.806 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
2023-03-15 00:34:42.806 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2035 ms
2023-03-15 00:34:44.129 [cb-events] INFO com.couchbase.core - [com.couchbase.core][CoreCreatedEvent] {"clientVersion":"3.2.6","clientGitHash":"${buildNumber}","coreVersion":"2.2.6","coreGitHash":"${buildNumber}","userAgent":"couchbase-java/3.2.6 (Windows 10 10.0 amd64; Java HotSpot(TM) 64-Bit Server VM 1.8.0_202-b08)","maxNumRequestsInRetry":32768,"ioEnvironment":{"nativeIoEnabled":true,"eventLoopThreadCount":4,"eventLoopGroups":["NioEventLoopGroup"]},"ioConfig":{"captureTraffic":[],"mutationTokensEnabled":true,"networkResolution":"auto","dnsSrvEnabled":true,"tcpKeepAlivesEnabled":true,"tcpKeepAliveTimeMs":60000,"configPollIntervalMs":2500,"kvCircuitBreakerConfig":"disabled","queryCircuitBreakerConfig":"disabled","viewCircuitBreakerConfig":"disabled","searchCircuitBreakerConfig":"disabled","analyticsCircuitBreakerConfig":"disabled","managerCircuitBreakerConfig":"disabled","eventingCircuitBreakerConfig":"disabled","backupCircuitBreakerConfig":"disabled","numKvConnections":1,"maxHttpConnections":12,"idleHttpConnectionTimeoutMs":4500,"configIdleRedialTimeoutMs":300000,"memcachedHashingStrategy":"StandardMemcachedHashingStrategy"},"compressionConfig":{"enabled":true,"minRatio":0.83,"minSize":32},"securityConfig":{"tlsEnabled":false,"nativeTlsEnabled":true,"hostnameVerificationEnabled":true,"hasTrustCertificates":false,"trustManagerFactory":null,"ciphers":[]},"timeoutConfig":{"kvMs":2500,"kvDurableMs":10000,"managementMs":75000,"queryMs":75000,"viewMs":75000,"searchMs":75000,"analyticsMs":75000,"connectMs":10000,"disconnectMs":10000,"eventingMs":75000,"backupMs":75000},"loggerConfig":{"customLogger":null,"fallbackToConsole":false,"consoleLogLevel":{"name":"INFO","resourceBundleName":"sun.util.logging.resources.logging","localizedName":"INFO"},"disableSlf4j":false,"loggerName":"CouchbaseLogger","diagnosticContextEnabled":false},"orphanReporterConfig":{"emitIntervalMs":10000,"sampleSize":10,"queueLength":1024,"enabled":true},"thresholdLoggingTracerConfig":{"enabled":true,"emitIntervalMs":10000,"sampleSize":10,"queueLength":1024,"kvThresholdMs":500,"queryThresholdMs":1000,"searchThresholdMs":1000,"analyticsThresholdMs":1000,"viewThresholdMs":1000},"loggingMeterConfig":{"enabled":true,"emitIntervalMs":600000},"retryStrategy":"BestEffortRetryStrategy","requestTracer":"ThresholdLoggingTracer","meter":"LoggingMeter","numRequestCallbacks":0} {"coreId":"0xa281c97d00000001","seedNodes":[{"address":"10.109.97.82"}]}
2023-03-15 00:34:44.137 [cb-events] INFO com.couchbase.node - [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0xa281c97d00000001","managerPort":"8091","remote":"10.109.97.82"}
2023-03-15 00:34:45.675 [main] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-26901"]
2023-03-15 00:34:45.696 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 26901 (http) with context path ''
2023-03-15 00:34:45.710 [main] INFO main.DemoApplication - Started DemoApplication in 5.488 seconds (JVM running for 6.126)
2023-03-15 00:34:47.298 [cb-events] INFO com.couchbase.node - [com.couchbase.node][NodeConnectedEvent] Node connected {"coreId":"0xa281c97d00000001","managerPort":"8091","remote":"0.0.0.0"}
2023-03-15 00:34:47.299 [cb-events] INFO com.couchbase.node - [com.couchbase.node][NodeDisconnectedEvent][938us] Node disconnected {"coreId":"0xa281c97d00000001","managerPort":"8091","remote":"10.109.97.82"}
2023-03-15 00:34:47.299 [cb-events] INFO com.couchbase.core - [com.couchbase.core][BucketOpenedEvent][2366ms] Opened bucket "cb-poc" {"coreId":"0xa281c97d00000001"}
2023-03-15 00:34:47.830 [cb-events] WARN com.couchbase.core - [com.couchbase.core][InitGlobalConfigFailedEvent][4158ms] Initializing the global config failed: UNKNOWN {"coreId":"0xa281c97d00000001"}
2023-03-15 00:34:49.316 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][2026ms] Connect attempt 1 failed because of : Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting. {"bucket":"cb-poc","circuitBreaker":"DISABLED","coreId":"0xa281c97d00000001","remote":"0.0.0.0:11210","type":"KV"}
com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting.
2023-03-15 00:34:51.332 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][2033ms] Connect attempt 2 failed because of : Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting. {"bucket":"cb-poc","circuitBreaker":"DISABLED","coreId":"0xa281c97d00000001","remote":"0.0.0.0:11210","type":"KV"}
com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting.
2023-03-15 00:34:53.497 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][2053ms] Connect attempt 3 failed because of : Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting. {"bucket":"cb-poc","circuitBreaker":"DISABLED","coreId":"0xa281c97d00000001","remote":"0.0.0.0:11210","type":"KV"}
com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting.
2023-03-15 00:34:55.637 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][2040ms] Connect attempt 4 failed because of : Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting. {"bucket":"cb-poc","circuitBreaker":"DISABLED","coreId":"0xa281c97d00000001","remote":"0.0.0.0:11210","type":"KV"}
com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting.
2023-03-15 00:34:58.008 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][2041ms] Connect attempt 5 failed because of : Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting. {"bucket":"cb-poc","circuitBreaker":"DISABLED","coreId":"0xa281c97d00000001","remote":"0.0.0.0:11210","type":"KV"}
com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting.
2023-03-15 00:35:00.558 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][2036ms] Connect attempt 6 failed because of : Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting. {"bucket":"cb-poc","circuitBreaker":"DISABLED","coreId":"0xa281c97d00000001","remote":"0.0.0.0:11210","type":"KV"}
com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting.
2023-03-15 00:35:03.646 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][2060ms] Connect attempt 7 failed because of : Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting. {"bucket":"cb-poc","circuitBreaker":"DISABLED","coreId":"0xa281c97d00000001","remote":"0.0.0.0:11210","type":"KV"}
com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting.
2023-03-15 00:35:07.700 [cb-events] WARN com.couchbase.endpoint - [com.couchbase.endpoint][EndpointConnectionFailedEvent][2028ms] Connect attempt 8 failed because of : Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting. {"bucket":"cb-poc","circuitBreaker":"DISABLED","coreId":"0xa281c97d00000001","remote":"0.0.0.0:11210","type":"KV"}
com.couchbase.client.core.endpoint.BaseEndpoint$2: Connection refused: no further information: /0.0.0.0:11210 - Check server ports and cluster encryption setting.