Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SolrTest failure when using CloundContainer #2967

Closed
ffang opened this issue Jul 30, 2021 · 1 comment · Fixed by #3046
Closed

SolrTest failure when using CloundContainer #2967

ffang opened this issue Jul 30, 2021 · 1 comment · Fixed by #3046
Assignees
Labels
Milestone

Comments

@ffang
Copy link
Contributor

ffang commented Jul 30, 2021

This probably only is the problem on non-linux machines.
I got test failures on my Mac when using CloundContainer(SSLContainer and StandaloneContainer are good though)
the error is like

Caused by: org.apache.solr.client.solrj.SolrServerException: IOException occurred when talking to server at: http://172.30.0.4:8983/solr/collection1
	at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:695)
	at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:266)
	at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:248)
	at org.apache.solr.client.solrj.impl.LBSolrClient.doRequest(LBSolrClient.java:369)
	at org.apache.solr.client.solrj.impl.LBSolrClient.request(LBSolrClient.java:297)
	at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.sendRequest(BaseCloudSolrClient.java:1171)
	at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.requestWithRetryOnStaleState(BaseCloudSolrClient.java:934)
	at org.apache.solr.client.solrj.impl.BaseCloudSolrClient.request(BaseCloudSolrClient.java:866)
	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:214)
	at org.apache.camel.component.solr.SolrProducer.insert(SolrProducer.java:257)
	at org.apache.camel.component.solr.SolrProducer.process(SolrProducer.java:85)
	at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
	at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:217)
	at org.apache.camel.impl.engine.SharedCamelInternalProcessor$1.process(SharedCamelInternalProcessor.java:111)
	at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)
	at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:108)
	at org.apache.camel.support.cache.DefaultProducerCache.send(DefaultProducerCache.java:190)
	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176)
	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172)
	at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:153)
	at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:219)
	... 34 more
Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to 172.30.0.4:8983 [/172.30.0.4] failed: connect timed out
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:571)
	... 54 more
Caused by: java.net.SocketTimeoutException: connect timed out
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.base/java.net.Socket.connect(Socket.java:609)
	at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
	... 64 more

Notice that 172.30.0.4 is the virtual docker node ip, but on non-linux machines with Docker Desktop, we can't access the virtual docker node ip.

This 172.30.0.4 was passed in org.apache.solr.client.solrj.impl.BaseCloudSolrClient by

sortedReplicas.forEach( replica -> {
        if (seenNodes.add(replica.getNodeName())) {
          theUrlList.add(ZkCoreNodeProps.getCoreUrl(replica.getBaseUrl(), joinedInputCollections));
        }
      });

So if we can find a way(like in cloud-docker-compose.yml configuration) to pass in the well-known hostname "host.docker.internal" on Docker Desktop as the replica nodename, we should be able to make it work.

@ffang ffang added the test label Jul 30, 2021
@ffang ffang self-assigned this Jul 30, 2021
@ffang
Copy link
Contributor Author

ffang commented Aug 20, 2021

Eventually I find a way to fix this. And this discussion docker-solr/docker-solr-examples#5 inspired

ffang added a commit to ffang/camel-quarkus that referenced this issue Aug 20, 2021
ffang added a commit to ffang/camel-quarkus that referenced this issue Aug 24, 2021
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue Aug 26, 2021
…- do not assume the class path resource is accessible via filesystem
ppalaga added a commit that referenced this issue Aug 27, 2021
…not assume the class path resource is accessible via filesystem
@ppalaga ppalaga added this to the 2.2.0 milestone Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants