Tableau Server (Linux) - tabadmincontroller crashing due to value 'warn' - java

Recently I was tasked to perform the following actions on our (single node) Tableau Server:
Harden the installation as per: https://help.tableau.com/current/server/en-us/security_harden.htm
Increase the disk size of the attached volume (AWS EBS)
Change the instance type of the server.
Having no previous experience of Tableau, I:
Logged into the EC2 instance and ran:
tsm configuration set -k ssl.protocols -v "all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1"
tsm pending-changes apply
Waited for the changes to apply, and stopped the server
Increased the EBS volume size
Changed the EC2 instance type
Restarted the server.
Upon restart of the server, it took a while for everything to load. And everything appeared to be okay.... except for the admin panel and tsm command.
Running tsm status revealed:
$ tsm status
Could not connect to server. Make sure that Tableau Server is running and try again.
Okay. Checked the syslog (/var/log/syslog), which was pointed me towards tabadmincontroller as per:
systemd[1172]: Started Tableau Server Administration Controller.
tabadmincontroller_0[11354]: [11354] [INFO] 2021-11-24 13:13:47.106 +0000 : Loading configuration from /var/opt/tableau/tableau_server/data/tabsvc/services/tabadmincontroller_0.20204.20.1116.1810/bin/tabadmincontroller.runjavaservice.json
tabadmincontroller_0[11354]: [11354] [INFO] 2021-11-24 13:13:47.107 +0000 : Loading configuration from /var/opt/tableau/tableau_server/data/tabsvc/services/tabadmincontroller_0.20204.20.1116.1810/config/tabadmincontroller.runjavaservice.json
tabadmincontroller_0[11354]: [11354] [INFO] 2021-11-24 13:13:47.107 +0000 : Loading manifest from /var/opt/tableau/tableau_server/data/tabsvc/services
/tabadmincontroller_0.20204.20.1116.1810/bin/tabadmincontroller.jar
tabadmincontroller_0[11354]: [11354] [INFO] 2021-11-24 13:13:47.107 +0000 : Starting malloc_trim thread. Run every 60 sec. Heap pad MB: 1
tabadmincontroller_0[11354]: [11354] [INFO] 2021-11-24 13:13:47.109 +0000 : Loading JVM library /var/opt/tableau/tableau_server/data/tabsvc/services/tabadmincontroller_0.20204.20.1116.1810/repository/jre/lib/server/libjvm.so
tabadmincontroller_0[11354]: [11354] [INFO] 2021-11-24 13:13:47.192 +0000 : Java class name: com.tableausoftware.tabadmin.webapp.TabadminController; Method name: main; Arguments: run
nlp_0[10759]: time="2021-11-24T13:13:54.323621681Z" level=info msg="[core] grpc: Server.Serve failed to create ServerTransport: connection error: desc = \"transport: http2Server.HandleStreams failed to receive the preface from client: EOF\"" logger="pegasus/server:server" system=system
nlp_0[10759]: time="2021-11-24T13:14:05.775776702Z" level=info msg="get job counts" blockedJobCount=0 inProgressJobCount=0 logger="semanticmodel/metrics:Monitor" queuedJobCount=0 waitingJobCount=0
systemd[1172]: tabadmincontroller_0.service: Main process exited, code=exited, status=1/FAILURE
systemd[1172]: tabadmincontroller_0.service: Failed with result 'exit-code'.
systemd[1172]: tabadmincontroller_0.service: Service hold-off time over, scheduling restart.
systemd[1172]: tabadmincontroller_0.service: Scheduled restart job, restart counter is at 7.
systemd[1172]: Stopped Tableau Server Administration Controller.
systemd[1172]: Started Tableau Server Administration Controller.
With an ongoing crash/restart loop going on forever.
Checking the logs at /var/opt/tableau/tableau_server/data/tabsvc/logs/tabadmincontroller
shows the following:
2021-11-24 13:17:37.372 +0000 main : INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=ip-172-33-30-206:8591 sessionTimeout=120000 watcher=org.apache.curator.ConnectionState#3657201c
2021-11-24 13:17:37.381 +0000 main : INFO org.apache.zookeeper.common.X509Util - Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation
2021-11-24 13:17:37.387 +0000 main : INFO org.apache.zookeeper.ClientCnxnSocket - jute.maxbuffer value is 4194304 Bytes
2021-11-24 13:17:37.397 +0000 main : INFO org.apache.zookeeper.ClientCnxn - zookeeper.request.timeout value is 0. feature enabled=
2021-11-24 13:17:37.402 +0000 main : INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - Default schema
2021-11-24 13:17:37.408 +0000 main-SendThread(ip-172-33-30-206:8591) : INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server ip-address-redacted. Will not attempt to authenticate using SASL (unknown error)
20redacted:8591) : INFO org.apache.zookeeper.ClientCnxn - Socket connection established, initiating session, client: /ip-redacted:45082, server: ip/ip:8591
2021-11-24 13:17:37.423 +0000 main-SendThread(ip:8591) : INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server, sessionid = 0x10000005ed60050, negotiated timeout = 120000
2021-11-24 13:17:37.432 +0000 main-EventThread : INFO org.apache.curator.framework.state.ConnectionStateManager - State change: CONNECTED
2021-11-24 13:17:37.780 +0000 main : ERROR com.tableausoftware.telemetry.helper.Environment - [xdev-edpa-007] process_type is not present in the configuration
2021-11-24 13:17:38.298 +0000 ZKWorker-ScheduledTask-0 : INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - Starting
2021-11-24 13:17:38.298 +0000 ZKWorker-ScheduledTask-0 : INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=ip sessionTimeout=120000 watcher=org.apache.curator.ConnectionState#48dddf5a
2021-11-24 13:17:38.298 +0000 ZKWorker-ScheduledTask-0 : INFO org.apache.zookeeper.ClientCnxnSocket - jute.maxbuffer value is 4194304 Bytes
2021-11-24 13:17:38.299 +0000 ZKWorker-ScheduledTask-0 : INFO org.apache.zookeeper.ClientCnxn - zookeeper.request.timeout value is 0. feature enabled=
2021-11-24 13:17:38.300 +0000 ZKWorker-ScheduledTask-0 : INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - Default schema
2021-11-24 13:17:38.300 +0000 ZKWorker-ScheduledTask-0-SendThread(ip:8591) : INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server ip/ip:8591. Will not attempt to authenticate using SASL (unknown error)
2021-11-24 13:17:38.301 +0000 ZKWorker-ScheduledTask-0-SendThread(ip:8591) : INFO org.apache.zookeeper.ClientCnxn - Socket connection established, initiating session, client: ip:45088, server: ip/ip:8591
2021-11-24 13:17:38.303 +0000 ZKWorker-ScheduledTask-0-SendThread(ip-172-33-30-206:8591) : INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server ip-172-33-30-206/ip-address:8591, sessionid = 0x10000005ed60051, negotiated timeout = 120000
2021-11-24 13:17:38.303 +0000 ZKWorker-ScheduledTask-0-EventThread : INFO org.apache.curator.framework.state.ConnectionStateManager - State change: CONNECTED
2021-11-24 13:17:39.357 +0000 main : INFO org.eclipse.jetty.server.session - DefaultSessionIdManager workerName=node0
2021-11-24 13:17:39.357 +0000 main : INFO org.eclipse.jetty.server.session - No SessionScavenger set, using defaults
2021-11-24 13:17:39.358 +0000 main : INFO org.eclipse.jetty.server.session - node0 Scavenging every 660000ms
2021-11-24 13:17:39.364 +0000 main : INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.s.b.w.e.j.JettyEmbeddedWebAppContext#38e0ccf3{application,/,[file:///var/opt/tableau/tableau_server/data/tabsvc/temp/tabadmincontroller_0.20204.20.1116.1810/jetty-docbase.7353433006274726961.8850/],AVAILABLE}
2021-11-24 13:17:39.365 +0000 main : INFO org.eclipse.jetty.server.Server - Started #9503ms
2021-11-24 13:17:39.755 +0000 main : INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - Starting
2021-11-24 13:17:39.756 +0000 main : INFO org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=ip-172-33-30-206:8591 sessionTimeout=120000 watcher=org.apache.curator.ConnectionState#6376534c
2021-11-24 13:17:39.756 +0000 main : INFO org.apache.zookeeper.ClientCnxnSocket - jute.maxbuffer value is 4194304 Bytes
2021-11-24 13:17:39.757 +0000 main : INFO org.apache.zookeeper.ClientCnxn - zookeeper.request.timeout value is 0. feature enabled=
2021-11-24 13:17:39.757 +0000 main : INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - Default schema
2021-11-24 13:17:39.758 +0000 main-SendThread(ip-172-33-30-206:8591) : INFO org.apache.zookeeper.ClientCnxn - Opening socket connection to server ip-172-33-30-206/ip-address:8591. Will not attempt to authenticate using SASL (unknown error)
2021-11-24 13:17:39.758 +0000 main-SendThread(ip-172-33-30-206:8591) : INFO org.apache.zookeeper.ClientCnxn - Socket connection established, initiating session, client: /ip-address:45098, server: ip-172-33-30-206/ip-address:8591
2021-11-24 13:17:39.760 +0000 main-SendThread(ip-172-33-30-206:8591) : INFO org.apache.zookeeper.ClientCnxn - Session establishment complete on server ip-172-33-30-206/ip-address:8591, sessionid = 0x10000005ed60052, negotiated timeout = 120000
2021-11-24 13:17:39.760 +0000 main-EventThread : INFO org.apache.curator.framework.state.ConnectionStateManager - State change: CONNECTED
2021-11-24 13:17:50.803 +0000 main : WARN org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig' defined in URL [jar:file:/opt/tableau/tableau_server/packages/bin.20204.20.1116.1810/tabadmincontroller.jar!/com/tableausoftware/tabadmin/webapp/WebSecurityConfig.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cookieAuthenticationService' defined in URL [jar:file:/opt/tableau/tableau_server/packages/bin.20204.20.1116.1810/tabadmincontroller.jar!/com/tableausoftware/tabadmin/webapp/auth/CookieAuthenticationService.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.tableausoftware.tabadmin.webapp.auth.CookieAuthenticationService]: Constructor threw exception; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [int] for value 'warn'; nested exception is java.lang.NumberFormatException: For input string: "warn"
2021-11-24 13:17:50.806 +0000 Curator-Framework-0 : INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
2021-11-24 13:17:50.910 +0000 main : INFO org.apache.zookeeper.ZooKeeper - Session: 0x10000005ed60052 closed
2021-11-24 13:17:50.910 +0000 main-EventThread : INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x10000005ed60052
2021-11-24 13:17:50.917 +0000 Curator-Framework-0 : INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
2021-11-24 13:17:50.930 +0000 Thread-15 : ERROR com.tableausoftware.tabadmin.webapp.EmbeddedLicenseActivator - Caught exception in EmbeddedLicenseActivator.
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'nativeApiInitializer': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:208) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1290) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver$1.getTarget(ContextAnnotationAutowireCandidateResolver.java:90) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:192) ~[spring-aop-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at com.sun.proxy.$Proxy144.hasEnoughRoleLicenses(Unknown Source) ~[?:?]
at com.tableausoftware.tabadmin.webapp.impl.ProductKeyService.getLicensingState(ProductKeyService.java:373) ~[tab-tabadmin-controller-latest.jar:?]
at com.tableausoftware.tabadmin.webapp.EmbeddedLicenseActivator$1.run(EmbeddedLicenseActivator.java:43) [tabadmincontroller.jar:?]
2021-11-24 13:17:50.935 +0000 Thread-15 : ERROR com.tableausoftware.tabadmin.webapp.EmbeddedLicenseActivator - Failed to activate the OEM embedded license.
2021-11-24 13:17:51.020 +0000 main-EventThread : INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x10000005ed60050
2021-11-24 13:17:51.020 +0000 main : INFO org.apache.zookeeper.ZooKeeper - Session: 0x10000005ed60050 closed
2021-11-24 13:17:51.021 +0000 main : WARN com.tableausoftware.tabadmin.agent.zookeeper.ConnectionHolder - Object ZooKeeperWorker#74b99b0e. was not a consumer of this connection.
2021-11-24 13:17:51.022 +0000 Curator-Framework-0 : INFO org.apache.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
2021-11-24 13:17:51.124 +0000 ZKWorker-ScheduledTask-0-EventThread : INFO org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0x10000005ed60051
2021-11-24 13:17:51.124 +0000 main : INFO org.apache.zookeeper.ZooKeeper - Session: 0x10000005ed60051 closed
2021-11-24 13:17:51.142 +0000 main : INFO org.eclipse.jetty.server.session - node0 Stopped scavenging
2021-11-24 13:17:51.144 +0000 main : INFO org.eclipse.jetty.server.handler.ContextHandler - Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext#38e0ccf3{application,/,[file:///var/opt/tableau/tableau_server/data/tabsvc/temp/tabadmincontroller_0.20204.20.1116.1810/jetty-docbase.7353433006274726961.8850/],UNAVAILABLE}
2021-11-24 13:17:51.154 +0000 main : INFO org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener -
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-11-24 13:17:51.156 +0000 main : ERROR org.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig' defined in URL [jar:file:/opt/tableau/tableau_server/packages/bin.20204.20.1116.1810/tabadmincontroller.jar!/com/tableausoftware/tabadmin/webapp/WebSecurityConfig.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cookieAuthenticationService' defined in URL [jar:file:/opt/tableau/tableau_server/packages/bin.20204.20.1116.1810/tabadmincontroller.jar!/com/tableausoftware/tabadmin/webapp/auth/CookieAuthenticationService.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.tableausoftware.tabadmin.webapp.auth.CookieAuthenticationService]: Constructor threw exception; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [int] for value 'warn'; nested exception is java.lang.NumberFormatException: For input string: "warn"
Can anyone help point me in the right direction of the next steps here ?

Related

Kafka on the server failed the next day。(EndOfStreamException: Unable to read additional data from client,)

The Kafka service I deployed on the server passed the test a few days ago and was running normally. Later, no other operations were carried out.
Then the service call failed today. I went online and looked at it. It's normal these days. Just this afternoon, the service hung up. Looking at the log, it seems to say that the Kafka service is restarted automatically, and then conflicts with the ID of zookeeper.
Restart the service. Everything is normal. Google doesn't have a good solution. What's the reason?
The following is the relevant log, please help to see, thank you
[2021-11-06 14:43:29,139] WARN Unexpected exception (org.apache.zookeeper.server.NIOServerCnxn)
EndOfStreamException: Unable to read additional data from client, it probably closed the socket: address = /159.89.4.236:59168, session = 0x0
at org.apache.zookeeper.server.NIOServerCnxn.handleFailedRead(NIOServerCnxn.java:163)
at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:326)
at org.apache.zookeeper.server.NIOServerCnxnFactory$IOWorkRequest.doWork(NIOServerCnxnFactory.java:522)
at org.apache.zookeeper.server.WorkerService$ScheduledWorkRequest.run(WorkerService.java:154)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[2021-11-06 15:00:18,301] INFO Completed load of Log(dir=/tmp/kafka-logs/__consumer_offsets-46, topicId=dPs0Kq4ERHKDaR440Nt8qA, topic=__consumer_offsets, partition=46, highWatermark=0, lastStableOffset=0, logStartOffset=0, logEndOffset=0) with 1 segments in 20ms (53/53 loaded in /tmp/kafka-logs) (kafka.log.LogManager)
[2021-11-06 15:00:18,303] INFO Loaded 53 logs in 2350ms. (kafka.log.LogManager)
[2021-11-06 15:00:18,303] INFO Starting log cleanup with a period of 300000 ms. (kafka.log.LogManager)
[2021-11-06 15:00:18,304] INFO Starting log flusher with a default period of 9223372036854775807 ms. (kafka.log.LogManager)
[2021-11-06 15:00:18,838] INFO [BrokerToControllerChannelManager broker=0 name=forwarding]: Starting (kafka.server.BrokerToControllerRequestThread)
[2021-11-06 15:00:19,148] INFO Updated connection-accept-rate max connection creation rate to 2147483647 (kafka.network.ConnectionQuotas)
[2021-11-06 15:00:19,165] INFO Awaiting socket connections on 0.0.0.0:9092. (kafka.network.Acceptor)
[2021-11-06 15:00:19,237] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Created data-plane acceptor and processors for endpoint : ListenerName(PLAINTEXT) (kafka.network.SocketServer)
[2021-11-06 15:00:19,282] INFO [BrokerToControllerChannelManager broker=0 name=alterIsr]: Starting (kafka.server.BrokerToControllerRequestThread)
[2021-11-06 15:00:19,400] INFO [ExpirationReaper-0-DeleteRecords]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2021-11-06 15:00:19,400] INFO [ExpirationReaper-0-Fetch]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2021-11-06 15:00:19,400] INFO [ExpirationReaper-0-Produce]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2021-11-06 15:00:19,409] INFO [ExpirationReaper-0-ElectLeader]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
[2021-11-06 15:00:19,451] INFO [LogDirFailureHandler]: Starting (kafka.server.ReplicaManager$LogDirFailureHandler)
[2021-11-06 15:00:19,530] INFO Creating /brokers/ids/0 (is it secure? false) (kafka.zk.KafkaZkClient)
[2021-11-06 15:00:19,566] ERROR Error while creating ephemeral at /brokers/ids/0, node already exists and owner '72057654275276801' does not match current session '72057654275276802' (kafka.zk.KafkaZkClient$CheckedEphemeral)
[2021-11-06 15:00:19,572] ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists
at org.apache.zookeeper.KeeperException.create(KeeperException.java:126)
at kafka.zk.KafkaZkClient$CheckedEphemeral.getAfterNodeExists(KafkaZkClient.scala:1904)
at kafka.zk.KafkaZkClient$CheckedEphemeral.create(KafkaZkClient.scala:1842)
at kafka.zk.KafkaZkClient.checkedEphemeralCreate(KafkaZkClient.scala:1809)
at kafka.zk.KafkaZkClient.registerBroker(KafkaZkClient.scala:96)
at kafka.server.KafkaServer.startup(KafkaServer.scala:319)
at kafka.Kafka$.main(Kafka.scala:109)
at kafka.Kafka.main(Kafka.scala)
[2021-11-06 15:00:19,596] INFO [KafkaServer id=0] shutting down (kafka.server.KafkaServer)
[2021-11-06 15:00:19,597] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Stopping socket server request processors (kafka.network.SocketServer)```

Spring application shuts itself down at 200 DB connections

On an legacy production application we were having an issue where the application crashed because it ran out of connections (the default was 100 connections) as a temporal solution we decided to increase the available connections to 500 but when the application reached 200 connections it just stopped itself, with no errors on the logs, just like a simple shut down.
I added a couple of logs that are generated each 15 secs for clearly seeing the behavior of the connections, these logs prints the idle connection and active connection as well as the full object of the Datasource properties. Before the application shut down the following logs where added:
Datasource idle connections: 0, active connections: 200
Datasource properties: org.apache.tomcat.jdbc.pool.DataSource#20b2475a{ConnectionPool[defaultAutoCommit=null; defaultReadOnly=null; defaultTransactionIsolation=-1; defaultCatalog=null; driverClassName=com.mysql.jdbc.Driver; maxActive=500; maxIdle=500; minIdle=10; initialSize=10; maxWait=30000; testOnBorrow=true; testOnReturn=false; timeBetweenEvictionRunsMillis=5000; numTestsPerEvictionRun=0; minEvictableIdleTimeMillis=60000; testWhileIdle=false; testOnConnect=false; password=********; url=jdbc:mysql://127.0.0.1:3306/db_name?createDatabaseIfNotExist=true; username=username; validationQuery=SELECT 1; validationQueryTimeout=-1; validatorClassName=null; validationInterval=3000; accessToUnderlyingConnectionAllowed=true; removeAbandoned=false; removeAbandonedTimeout=60; logAbandoned=false; connectionProperties=null; initSQL=null; jdbcInterceptors=null; jmxEnabled=true; fairQueue=true; useEquals=true; abandonWhenPercentageFull=0; maxAge=0; useLock=false; dataSource=null; dataSourceJNDI=null; suspectTimeout=0; alternateUsernameAllowed=false; commitOnReturn=false; rollbackOnReturn=false; useDisposableConnectionFacade=true; logValidationErrors=false; propagateInterruptState=false; ignoreExceptionOnPreLoad=false; }
After that the application shut itself down and I found following logs with no errors before:
2021-02-03 20:23:02.618 INFO 1 --- [ Thread-4] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#8807e25: startup date [Wed Feb 03 19:49:09 GMT 2021]; root of context hierarchy
2021-02-03 20:23:02.623 INFO 1 --- [ Thread-4] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2021-02-03 20:23:02.643 INFO 1 --- [ Thread-4] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2021-02-03 20:23:02.647 INFO 1 --- [ Thread-4] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
A couple of relevant dependencies and their versions:
org.springframework:spring-webmvc:jar:4.3.6.RELEASE:compile
org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.1.RELEASE:compile
org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.1.RELEASE:compile
org.apache.tomcat:tomcat-jdbc:jar:8.5.11:compile
org.hibernate:hibernate-core:jar:5.0.11.Final:compile
org.springframework.data:spring-data-jpa:jar:1.11.0.RELEASE:compile
org.springframework.boot:spring-boot-starter-web:jar:1.5.1.RELEASE:compile
org.liquibase:liquibase-core:jar:3.5.1:compile
org.liquibase.ext:liquibase-hibernate5:jar:3.6:compile
Finally my ask is for help to understand why the application shuts itself down and how could I fix it so it is able to reach 500 connections?

Mongodb Atlas "Got Socket exception on Connection To Cluster"

I'm using Java & Springboot and MongoDB Atlas and created a database which response to many Object's CURD
When I do the post on uploadingImage, I got this error Got Socket exception on Connection [connectionId{localValue:4, serverValue:114406}] to cluster0-shard-00-02.1c6kg.mongodb.net:27017
However when I call other object's CRUD, it works totally fine. I don't why it raise this exception. BTW all my CRUD operation of all objects works well on localhost when not connecting to MongoDB Atlas, That means my ImageDAO should be fine, I just used mongoTemplate.insert(Image).
I search online, and they said might be IP whitelist of Atlas, So I setup my Cluster open to any IP Address.
Also I set my timeout and socket configure like this in my .properties file:
spring.data.mongodb.uri=mongodb+srv://username:password#cluster0.1c6kg.mongodb.net/database?retryWrites=true&w=majority&keepAlive=true&pooSize=30&autoReconnect=true&socketTimeoutMS=361000000&connectTimeoutMS=3600000
it still not work, I think the problem definitely related to the timeout of socket, But I don't know where else I can config
The Error log is here:
2020-11-01 12:25:34.275 WARN 20242 --- [nio-8088-exec-1] org.mongodb.driver.connection : Got socket exception on connection [connectionId{localValue:4, serverValue:114406}] to cluster0-shard-00-02.1c6kg.mongodb.net:27017. All connections to cluster0-shard-00-02.1c6kg.mongodb.net:27017 will be closed.
2020-11-01 12:25:34.283 INFO 20242 --- [nio-8088-exec-1] org.mongodb.driver.connection : Closed connection [connectionId{localValue:4, serverValue:114406}] to cluster0-shard-00-02.1c6kg.mongodb.net:27017 because there was a socket exception raised by this connection.
2020-11-01 12:25:34.295 INFO 20242 --- [nio-8088-exec-1] org.mongodb.driver.cluster : No server chosen by WritableServerSelector from cluster description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ServerDescription{address=cluster0-shard-00-00.1c6kg.mongodb.net:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=46076648, setName='atlas-d9ovwb-shard-0', canonicalAddress=cluster0-shard-00-00.1c6kg.mongodb.net:27017, hosts=[cluster0-shard-00-00.1c6kg.mongodb.net:27017, cluster0-shard-00-01.1c6kg.mongodb.net:27017, cluster0-shard-00-02.1c6kg.mongodb.net:27017], passives=[], arbiters=[], primary='cluster0-shard-00-02.1c6kg.mongodb.net:27017', tagSet=TagSet{[Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AWS'}, Tag{name='region', value='US_WEST_2'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=null, setVersion=1, lastWriteDate=Sun Nov 01 12:25:29 PST 2020, lastUpdateTimeNanos=104428017411386}, ServerDescription{address=cluster0-shard-00-02.1c6kg.mongodb.net:27017, type=UNKNOWN, state=CONNECTING}, ServerDescription{address=cluster0-shard-00-01.1c6kg.mongodb.net:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=41202444, setName='atlas-d9ovwb-shard-0', canonicalAddress=cluster0-shard-00-01.1c6kg.mongodb.net:27017, hosts=[cluster0-shard-00-00.1c6kg.mongodb.net:27017, cluster0-shard-00-01.1c6kg.mongodb.net:27017, cluster0-shard-00-02.1c6kg.mongodb.net:27017], passives=[], arbiters=[], primary='cluster0-shard-00-02.1c6kg.mongodb.net:27017', tagSet=TagSet{[Tag{name='nodeType', value='ELECTABLE'}, Tag{name='provider', value='AWS'}, Tag{name='region', value='US_WEST_2'}, Tag{name='workloadType', value='OPERATIONAL'}]}, electionId=null, setVersion=1, lastWriteDate=Sun Nov 01 12:25:29 PST 2020, lastUpdateTimeNanos=104428010234368}]}. Waiting for 30000 ms before timing out
2020-11-01 12:25:34.316 INFO 20242 --- [ngodb.net:27017] org.mongodb.driver.cluster : Discovered replica set primary cluster0-shard-00-02.1c6kg.mongodb.net:27017
2020-11-01 12:25:34.612 INFO 20242 --- [nio-8088-exec-1] org.mongodb.driver.connection : Opened connection [connectionId{localValue:5, serverValue:108547}] to cluster0-shard-00-02.1c6kg.mongodb.net:27017
2020-11-01 12:25:34.838 WARN 20242 --- [nio-8088-exec-1] org.mongodb.driver.connection : Got socket exception on connection [connectionId{localValue:5, serverValue:108547}] to cluster0-shard-00-02.1c6kg.mongodb.net:27017. All connections to cluster0-shard-00-02.1c6kg.mongodb.net:27017 will be closed.
2020-11-01 12:25:34.838 INFO 20242 --- [nio-8088-exec-1] org.mongodb.driver.connection : Closed connection [connectionId{localValue:5, serverValue:108547}] to cluster0-shard-00-02.1c6kg.mongodb.net:27017 because there was a socket exception raised by this connection.
2020-11-01 12:25:34.876 INFO 20242 --- [ngodb.net:27017] org.mongodb.driver.cluster : Discovered replica set primary cluster0-shard-00-02.1c6kg.mongodb.net:27017
2020-11-01 12:25:34.878 ERROR 20242 --- [nio-8088-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.data.mongodb.UncategorizedMongoDbException: Exception sending message; nested exception is com.mongodb.MongoSocketWriteException: Exception sending message] with root cause

RESTassured causing IOExceptions “existing connection was forcibly closed by the remote host” in undertow

I have set up RESTassured to run against undertow with my REST app in-memory using maven, which uses the pre-integration-test and post-integration-test phases to set it up as a daemon and tear it down.
My big niggle is that undertow is spitting out stacktraces at the end of the integration test phases, as if RESTassured is never releasing its HTTP connections.
So my question is:
What do I have to do to close the HTTP connections properly after each test, is it in Undertow or in RESTassured?
Here are the gory details.
Undertow Server
I launch Undertow with the standard Undertow code which is found all over SO:
HttpHandler contextHandler = Handlers.path()
.addPrefixPath("/", manager.start());
return Undertow.builder()
.addHttpListener(port, address,
new GracefulShutdownHandler(contextHandler))
.build();
Stacktraces
There's one for each REST call RESTassured makes. They look like this:
19:07:07.569 io : Error reading request : DEBUG : XNIO-1 I/O-1 :
io.undertow.server.protocol.http.HttpReadListener
java.io.IOException:
An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:158)
[snipped - see below for full stacktraces]
RESTassured
This is what each test code block looks like:
#Test
public void test() {
RequestSpecification requestSpecification =
new RequestSpecBuilder()
.setContentType(ContentType.JSON)
.addFilter(new ResponseLoggingFilter())
.addFilter(new RequestLoggingFilter())
.build();
given().spec(requestSpecification)
.queryParam("name", "honky")
.queryParam("description", "oh my")
.queryParam("actualizationDate", "1999-12-31T23:59:59Z")
.queryParam("active", "True")
.when()
.post("2/widget/save")
.then()
.statusCode(200);
The Logs
And here are the logs below.
Undertow logging level is set to TRACE - I wish they output a bit more. Still refreshing though compared to Bloatosaurus spring.io :)
If you find yourself distracted by the two calls logged by undertow.HttpServerExchange in the pre-integration-test block, they seem to be fine. They are:
a call to see if the server is up yet (not rest-assured)
a rest call to create a test user (also not rest-assured)
In case anyone thinks the problem is with them, I have tested the start-up and shut-down with no tests in-between, and there are no IOExceptions, so I don't think they are causing the issue.
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (pre-int-test) # gem-widget ---
13:49:55.951 request : UT015007: Stack trace on error enabled for deployment integration-testing, please do not enable for production use : WARN : Thread-2 : io.undertow.servlet.core.DeploymentManagerImpl
13:49:55.996 session : Setting default session timeout to 1800 : DEBUG : Thread-2 : org.jboss.logging.DelegatingBasicLogger
13:49:56.026 servlet : 1 Spring WebApplicationInitializers detected on classpath : INFO : Thread-2 : io.undertow.servlet.spec.ServletContextImpl
13:49:56.101 session : Registered session listener io.undertow.servlet.core.SessionListenerBridge#48b96dfa : DEBUG : Thread-2 : io.undertow.server.session.InMemorySessionManager
13:49:56.105 servlet : Initializing Spring root WebApplicationContext : INFO : Thread-2 : io.undertow.servlet.spec.ServletContextImpl
13:50:13.112 servlet : Initializing Spring FrameworkServlet 'dispatcher' : INFO : Thread-2 : io.undertow.servlet.spec.ServletContextImpl
13:50:13.226 undertow : starting undertow server io.undertow.Undertow#5eb8dc7d : DEBUG : Thread-2 : io.undertow.Undertow
13:50:14.378 undertow : Configuring listener with protocol HTTP for interface localhost and port 8080 : DEBUG : Thread-2 : io.undertow.Undertow
13:50:14.424 undertow : Configuring listener with protocol HTTP for interface 0.0.0.0 and port 8090 : DEBUG : Thread-2 : io.undertow.Undertow
13:50:14.877 request : Opened connection with /127.0.0.1:58156 : TRACE : XNIO-1 I/O-1 : io.undertow.server.protocol.http.HttpOpenListener
13:50:15.070 HttpServerExchange : Starting to write response for HttpServerExchange{ GET / request {Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2], Connection=[keep-alive], Content-Type=[application/json], User-Agent=[Java/1.8.0_131], Host=[localhost:8080]} response {Connection=[keep-alive], Content-Type=[application/json;charset=ISO-8859-1], Content-Length=[0], Date=[Wed, 07 Nov 2018 13:50:15 GMT]}} : TRACE : XNIO-1 task-1 : io.undertow.server.HttpServerExchange
13:50:15.387 HttpServerExchange : Starting to write response for HttpServerExchange{ POST /2/mgmt/create_user/TEST/true request {Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2], Connection=[keep-alive], Content-Type=[application/json], User-Agent=[Java/1.8.0_131], Host=[localhost:8080]} response {Connection=[keep-alive], Content-Length=[0], Date=[Wed, 07 Nov 2018 13:50:15 GMT]}} : TRACE : XNIO-1 task-2 : io.undertow.server.HttpServerExchange
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.1:integration-test (default) # gem-widget ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.megacorp.widget.rest.WidgetSaveTests
13:50:19.928 request : Opened connection with /127.0.0.1:58170 : TRACE : XNIO-1 I/O-3 : io.undertow.server.protocol.http.HttpOpenListener
13:50:19.935 HttpServerExchange : Starting to write response for HttpServerExchange{ GET / request {Accept=[text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2], Connection=[keep-alive], Content-Type=[application/json], User-Agent=[Java/1.8.0_131], Host=[localhost:8080]} response {Connection=[keep-alive], Content-Type=[application/json;charset=ISO-8859-1], Content-Length=[0], Date=[Wed, 07 Nov 2018 13:50:19 GMT]}} : TRACE : XNIO-1 task-3 : io.undertow.server.HttpServerExchange
Request method: POST
Request URI: http://localhost:8080/2/widget/save?name=THARG.YES.GOOD.IDEA.6.7.8.9&description=oh%20my&actualizationDate=1999-12-31T23%3A59%3A59Z&active=True
Proxy: <none>
Request params: <none>
Query params: name=THARG.YES.GOOD.IDEA.6.7.8.9
description=oh my
actualizationDate=1999-12-31T23:59:59Z
active=True
Form params: <none>
Path params: <none>
Headers: Accept=*/*
Content-Type=application/json; charset=UTF-8
Cookies: <none>
Multiparts: <none>
Body: <none>
13:50:22.996 request : Opened connection with /127.0.0.1:58171 : TRACE : XNIO-1 I/O-4 : io.undertow.server.protocol.http.HttpOpenListener
13:50:23.031 transfer-encoding : No content, starting next request : TRACE : XNIO-1 I/O-4 : io.undertow.server.protocol.http.HttpTransferEncoding
13:50:23.276 HttpServerExchange : Starting to write response for HttpServerExchange{ POST /2/widget/save request {Accept=[*/*], Connection=[Keep-Alive], Accept-Encoding=[gzip,deflate], Content-Type=[application/json; charset=UTF-8], Content-Length=[0], User-Agent=[Apache-HttpClient/4.5.3 (Java/1.8.0_131)], Host=[localhost:8080]} response {Connection=[keep-alive], Transfer-Encoding=[chunked], Content-Type=[application/json;charset=UTF-8], Date=[Wed, 07 Nov 2018 13:50:23 GMT]}} : TRACE : XNIO-1 task-4 : io.undertow.server.HttpServerExchange
13:50:23.334 RequestSpecificationImpl$RestAssuredHttpBuilder : Parsing response as: application/json;charset=UTF-8 : DEBUG : main : io.restassured.internal.http.HTTPBuilder
13:50:23.341 RequestSpecificationImpl$RestAssuredHttpBuilder : Parsed data to instance of: class org.apache.http.conn.EofSensorInputStream : DEBUG : main : io.restassured.internal.http.HTTPBuilder
HTTP/1.1 200 OK
Connection: keep-alive
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8
Date: Wed, 07 Nov 2018 13:50:23 GMT
[
]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.974 s - in com.megacorp.widget.rest.WidgetSaveTests
13:50:24.343 io : Error reading request : DEBUG : XNIO-1 I/O-4 : io.undertow.server.protocol.http.HttpReadListener
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.xnio.nio.NioSocketConduit.read(NioSocketConduit.java:319)
at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:158)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:561)
13:50:24.343 io : Error reading request : DEBUG : XNIO-1 I/O-3 : io.undertow.server.protocol.http.HttpReadListener
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.xnio.nio.NioSocketConduit.read(NioSocketConduit.java:319)
at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:158)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:561)
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (post-int-test) # gem-widget ---
13:50:24.749 request : Opened connection with /127.0.0.1:58182 : TRACE : XNIO-1 I/O-1 : io.undertow.server.protocol.http.HttpOpenListener
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.1:verify (default) # gem-widget ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 55.591 s
[INFO] Finished at: 2018-11-07T13:50:24+00:00
[INFO] Final Memory: 57M/616M
[INFO] ------------------------------------------------------------------------
Disconnected from the target VM, address: '127.0.0.1:58132', transport: 'socket'
FATAL ERROR in native method: JDWP Can't allocate jvmti memory, jvmtiError=JVMTI_ERROR_INVALID_ENVIRONMENT(116)
JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on getting class status [util.c:1285]
JDWP exit error JVMTI_ERROR_INVALID_ENVIRONMENT(116): Can't allocate jvmti memory [util.c:1799]
ERROR: JDWP unable to dispose of JVMTI environment: JVMTI_ERROR_INVALID_ENVIRONMENT(116)
Process finished with exit code 1

SolrJ hanging when connecting to zookeeper

I have a local two instance Solr Cloud setup with a single zookeeper instance. I am trying to connect via SolrJ to execute a query however my code hangs for 2mins or so when executing the query and then fails. I have followed the basic example on the Solr wiki. The logs/code is below
2016-07-24 13:29:01.932 INFO 83666 --- [qtp699221219-28] org.apache.zookeeper.ZooKeeper : Initiating client connection, connectString=localhost:2181 sessionTimeout=10000 watcher=org.apache.solr.common.cloud.SolrZkClient$3#496eab9
2016-07-24 13:29:01.948 INFO 83666 --- [qtp699221219-28] o.a.solr.common.cloud.ConnectionManager : Waiting for client to connect to ZooKeeper
2016-07-24 13:29:01.953 INFO 83666 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2016-07-24 13:29:01.955 INFO 83666 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Socket connection established to localhost/127.0.0.1:2181, initiating session
2016-07-24 13:29:01.967 INFO 83666 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x1561cdd875e0004, negotiated timeout = 10000
2016-07-24 13:29:01.972 INFO 83666 --- [back-3-thread-1] o.a.solr.common.cloud.ConnectionManager : Watcher org.apache.solr.common.cloud.ConnectionManager#4bb95d56 name:ZooKeeperConnection Watcher:localhost:2181 got event WatchedEvent state:SyncConnected type:None path:null path:null type:None
2016-07-24 13:29:01.972 INFO 83666 --- [qtp699221219-28] o.a.solr.common.cloud.ConnectionManager : Client is connected to ZooKeeper
2016-07-24 13:29:01.973 INFO 83666 --- [qtp699221219-28] o.apache.solr.common.cloud.SolrZkClient : Using default ZkACLProvider
2016-07-24 13:29:01.974 INFO 83666 --- [qtp699221219-28] o.a.solr.common.cloud.ZkStateReader : Updating cluster state from ZooKeeper...
2016-07-24 13:29:01.990 INFO 83666 --- [qtp699221219-28] o.a.solr.common.cloud.ZkStateReader : Loaded empty cluster properties
2016-07-24 13:29:01.995 INFO 83666 --- [qtp699221219-28] o.a.solr.common.cloud.ZkStateReader : Updated live nodes from ZooKeeper... (0) -> (2)
2016-07-24 13:31:24.653 ERROR 83666 --- [qtp699221219-28] o.a.s.client.solrj.impl.CloudSolrClient : Request to collection foo failed due to (0) java.net.ConnectException: Operation timed out, retry? 0
and my code is:
String zkHostString = "localhost:2181";
CloudSolrClient solr = new CloudSolrClient.Builder().withZkHost(zkHostString).build();
solr.setDefaultCollection("foo");
SolrQuery query = new SolrQuery();
query.set("q", "*:*");
QueryResponse response = null;
try {
response = solr.query(query);
} catch (SolrServerException e) {
return null;
}
//Do Something with the results...
Urgh, I'm an idiot, the zookeeper instance and solr instances are inside docker, the code posted above is not. So Zookeeper reported back the solr urls using the docker containers ip...The host needs to connect via localhost and not the docker container ip.
Eg: Zookeeper responds [http://172.17.0.5:8983/solr/foo_shard1_replica2, http://172.17.0.6:8984/solr/foo_shard1_replica1]
but my code needs to call [http://localhost:8983/solr/foo_shard1_replica2, http://localhost:8984/solr/foo_shard1_replica1]

Categories