Running in to error trying to build from source


(Tian000) #1

I keep getting the following errors when trying to build from source:

=======================================
Elasticsearch Build Hamster says Hello!
=======================================
  Gradle Version        : 3.5
  OS Info               : Mac OS X 10.12.4 (x86_64)
  JDK Version           : Oracle Corporation 1.8.0_131 [Java HotSpot(TM) 64-Bit Server VM 25.131-b11]
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
The executable property on ForkOptions has been deprecated and is scheduled to be removed in Gradle 5.0. Please use javaHome instead.
:updateShas
:compileJava UP-TO-DATE
:processResources NO-SOURCE
:classes UP-TO-DATE
:copyCheckstyleConf UP-TO-DATE
:checkstyleMain UP-TO-DATE
:copyPluginPropertiesTemplate
:pluginProperties UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:checkstyleTest UP-TO-DATE
:forbiddenApisMain SKIPPED
:forbiddenApisTest SKIPPED
:forbiddenApis UP-TO-DATE
:jar UP-TO-DATE
:bundlePlugin UP-TO-DATE
:copyRestSpec UP-TO-DATE
:checkstyle UP-TO-DATE
:dependencyLicenses
:forbiddenPatterns UP-TO-DATE
:jarHell SKIPPED
:licenseHeaders SKIPPED
:loggerUsageCheck UP-TO-DATE
:namingConventions SKIPPED
:thirdPartyAudit SKIPPED
:precommit
:customJarHellCheck
checking for jar hell...
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'org.apache.logging.log4j.simplelog.StatusLogger.level' to TRACE to show Log4j2 internal initialization logging.
no jar hell found
:test
==> Test Info: seed=527D1B9E9586B02F; jvms=4; suites=32
Suite: org.elasticsearch.plugin.readonlyrest.settings.LdapSettingsTests
  1> [2017-05-16T15:31:39,260][INFO ][o.e.p.r.u.c.LdapContainer] Creating LDAP container ...
  1> [2017-05-16T15:31:45,645][INFO ][o.e.p.r.u.c.LdapContainer] Waiting for LDAP container ...
  2> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
  2> SLF4J: Defaulting to no-operation (NOP) logger implementation
  2> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
ERROR   0.00s J2 | LdapSettingsTests (suite) <<< FAILURES!
   > Throwable #1: org.testcontainers.containers.ContainerLaunchException: Container startup failed
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:179)
   >    at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:531)
   >    at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:28)
   > Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
   >    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:83)
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:172)
   >    ... 7 more
   > Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
   >    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:246)
   >    at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:174)
   >    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
   >    ... 8 more
   > Caused by: java.lang.IllegalStateException: LDAPException(resultCode=81 (server down), errorMessage='The connection is not established.')
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.waitUntilReady(LdapContainer.java:107)
   >    at org.testcontainers.containers.GenericContainer$AbstractWaitStrategy.waitUntilReady(GenericContainer.java:909)
   >    at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:453)
   >    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:225)
   >    ... 10 more
   > Caused by: LDAPException(resultCode=81 (server down), errorMessage='The connection is not established.')
   >    at com.unboundid.ldap.sdk.LDAPConnection.registerResponseAcceptor(LDAPConnection.java:4476)
   >    at com.unboundid.ldap.sdk.SimpleBindRequest.process(SimpleBindRequest.java:542)
   >    at com.unboundid.ldap.sdk.LDAPConnection.bind(LDAPConnection.java:2143)
   >    at com.unboundid.ldap.sdk.LDAPConnection.bind(LDAPConnection.java:2087)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.bind(LdapContainer.java:148)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.initLdap(LdapContainer.java:138)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.waitUntilReady(LdapContainer.java:105)
   >    ... 13 more
Completed [17/32] on J2 in 10.55s, 0 tests, 1 error <<< FAILURES!

Suite: org.elasticsearch.plugin.readonlyrest.acl.definitions.ldaps.UnboundidGroupsProviderLdapClientTests
  1> [2017-05-16T15:31:39,287][INFO ][o.e.p.r.u.c.LdapContainer] Creating LDAP container ...
  1> [2017-05-16T15:31:45,966][INFO ][o.e.p.r.u.c.LdapContainer] Waiting for LDAP container ...
  2> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
  2> SLF4J: Defaulting to no-operation (NOP) logger implementation
  2> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
ERROR   0.00s J3 | UnboundidGroupsProviderLdapClientTests (suite) <<< FAILURES!
   > Throwable #1: org.testcontainers.containers.ContainerLaunchException: Container startup failed
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:179)
   >    at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:531)
   >    at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:28)
   > Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
   >    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:83)
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:172)
   >    ... 7 more
   > Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
   >    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:246)
   >    at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:174)
   >    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
   >    ... 8 more
   > Caused by: java.lang.IllegalStateException: LDAPException(resultCode=81 (server down), errorMessage='The connection to server localhost:32805 was closed while waiting for a response to an add request AddRequest(dn='ou=People,dc=example,dc=com', attrs={Attribute(name=objectClass, values={'top', 'organizationalUnit'}), Attribute(name=ou, values={'People'})}).')
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.waitUntilReady(LdapContainer.java:107)
   >    at org.testcontainers.containers.GenericContainer$AbstractWaitStrategy.waitUntilReady(GenericContainer.java:909)
   >    at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:453)
   >    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:225)
   >    ... 10 more
   > Caused by: LDAPException(resultCode=81 (server down), errorMessage='The connection to server localhost:32805 was closed while waiting for a response to an add request AddRequest(dn='ou=People,dc=example,dc=com', attrs={Attribute(name=objectClass, values={'top', 'organizationalUnit'}), Attribute(name=ou, values={'People'})}).')
   >    at com.unboundid.ldap.sdk.AddRequest.handleResponse(AddRequest.java:1293)
   >    at com.unboundid.ldap.sdk.AddRequest.process(AddRequest.java:1035)
   >    at com.unboundid.ldap.sdk.LDAPConnection.add(LDAPConnection.java:1950)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.initLdap(LdapContainer.java:142)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.waitUntilReady(LdapContainer.java:105)
   >    ... 13 more
Completed [19/32] on J3 in 11.05s, 0 tests, 1 error <<< FAILURES!

HEARTBEAT J0 PID([email protected]): 2017-05-16T15:31:51, stalled for 10.2s at: LdapIntegrationSecondOptionTests (suite)
Suite: org.elasticsearch.plugin.readonlyrest.integration.LdapIntegrationSecondOptionTests
  1> [2017-05-16T15:31:40,695][INFO ][o.e.p.r.u.c.LdapContainer] Creating LDAP container ...
  1> [2017-05-16T15:31:44,965][INFO ][o.e.p.r.u.c.LdapContainer] Creating LDAP container ...
  1> [2017-05-16T15:31:47,379][INFO ][o.e.p.r.u.c.LdapContainer] Waiting for LDAP container ...
  2> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
  2> SLF4J: Defaulting to no-operation (NOP) logger implementation
  2> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
ERROR   0.00s J0 | LdapIntegrationSecondOptionTests (suite) <<< FAILURES!
   > Throwable #1: org.testcontainers.containers.ContainerLaunchException: Container startup failed
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:179)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.MultiContainer.lambda$starting$1(MultiContainer.java:46)
   >    at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:408)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.MultiContainer.starting(MultiContainer.java:46)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.MultiContainerDependent.starting(MultiContainerDependent.java:48)
   >    at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:28)
   > Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
   >    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:83)
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:172)
   >    ... 10 more
   > Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
   >    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:246)
   >    at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:174)
   >    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
   >    ... 11 more
   > Caused by: java.lang.IllegalStateException: LDAPException(resultCode=81 (server down), errorMessage='The connection is not established.')
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.waitUntilReady(LdapContainer.java:107)
   >    at org.testcontainers.containers.GenericContainer$AbstractWaitStrategy.waitUntilReady(GenericContainer.java:909)
   >    at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:453)
   >    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:225)
   >    ... 13 more
   > Caused by: LDAPException(resultCode=81 (server down), errorMessage='The connection is not established.')
   >    at com.unboundid.ldap.sdk.LDAPConnection.registerResponseAcceptor(LDAPConnection.java:4476)
   >    at com.unboundid.ldap.sdk.AddRequest.processAsync(AddRequest.java:1079)
   >    at com.unboundid.ldap.sdk.AddRequest.process(AddRequest.java:1010)
   >    at com.unboundid.ldap.sdk.LDAPConnection.add(LDAPConnection.java:1950)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.initLdap(LdapContainer.java:142)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.waitUntilReady(LdapContainer.java:105)
   >    ... 16 more
Completed [23/32] on J0 in 10.86s, 0 tests, 1 error <<< FAILURES!

HEARTBEAT J1 PID([email protected]): 2017-05-16T15:31:53, stalled for 10.3s at: ReverseProxyAuthenticationWithGroupsProviderAuthorizationTests (suite)
HEARTBEAT J1 PID([email protected]): 2017-05-16T15:32:03, stalled for 20.4s at: ReverseProxyAuthenticationWithGroupsProviderAuthorizationTests (suite)
HEARTBEAT J0 PID([email protected]): 2017-05-16T15:32:03, stalled for 10.9s at: IndicesReverseWildcardTests (suite)
Suite: org.elasticsearch.plugin.readonlyrest.es.IndicesRewriteTests
  1> [2017-05-16T15:31:58,621][INFO ][o.e.p.r.u.c.ESWithReadonlyRestContainer] Creating ES container ...
ERROR   0.00s J3 | IndicesRewriteTests (suite) <<< FAILURES!
   > Throwable #1: org.testcontainers.containers.ContainerFetchException: Can't get Docker image name from [email protected]
   >    at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:739)
   >    at org.testcontainers.containers.GenericContainer.logger(GenericContainer.java:278)
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:162)
   >    at org.testcontainers.containers.GenericContainer.starting(GenericContainer.java:531)
   >    at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:28)
   > Caused by: org.testcontainers.shaded.com.github.dockerjava.api.exception.DockerClientException: Could not build image: null
   >    at org.testcontainers.shaded.com.github.dockerjava.core.command.BuildImageResultCallback.getImageId(BuildImageResultCallback.java:71)
   >    at org.testcontainers.shaded.com.github.dockerjava.core.command.BuildImageResultCallback.awaitImageId(BuildImageResultCallback.java:48)
   >    at org.testcontainers.images.builder.ImageFromDockerfile.resolve(ImageFromDockerfile.java:146)
   >    at org.testcontainers.images.builder.ImageFromDockerfile.resolve(ImageFromDockerfile.java:31)
   >    at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:20)
   >    at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:27)
   >    at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:737)
   >    ... 9 more
Completed [28/32] on J3 in 7.94s, 0 tests, 1 error <<< FAILURES!

HEARTBEAT J2 PID([email protected]): 2017-05-16T15:32:09, stalled for 10.3s at: ExternalAuthenticationTests (suite)
Suite: org.elasticsearch.plugin.readonlyrest.integration.LdapIntegrationFirstOptionTests
  1> [2017-05-16T15:32:04,827][INFO ][o.e.p.r.u.c.LdapContainer] Creating LDAP container ...
  1> [2017-05-16T15:32:04,827][INFO ][o.e.p.r.u.c.LdapContainer] Creating LDAP container ...
  1> [2017-05-16T15:32:06,307][INFO ][o.e.p.r.u.c.LdapContainer] Waiting for LDAP container ...
ERROR   0.00s J3 | LdapIntegrationFirstOptionTests (suite) <<< FAILURES!
   > Throwable #1: org.testcontainers.containers.ContainerLaunchException: Container startup failed
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:179)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.MultiContainer.lambda$starting$1(MultiContainer.java:46)
   >    at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:408)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.MultiContainer.starting(MultiContainer.java:46)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.MultiContainerDependent.starting(MultiContainerDependent.java:48)
   >    at org.testcontainers.containers.FailureDetectingExternalResource$1.evaluate(FailureDetectingExternalResource.java:28)
   > Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
   >    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:83)
   >    at org.testcontainers.containers.GenericContainer.start(GenericContainer.java:172)
   >    ... 10 more
   > Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
   >    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:246)
   >    at org.testcontainers.containers.GenericContainer.lambda$start$0(GenericContainer.java:174)
   >    at org.rnorth.ducttape.unreliables.Unreliables.retryUntilSuccess(Unreliables.java:76)
   >    ... 11 more
   > Caused by: java.lang.IllegalStateException: LDAPException(resultCode=81 (server down), errorMessage='The connection to server localhost:32823 was closed while waiting for a response to an add request AddRequest(dn='ou=Groups,dc=example,dc=com', attrs={Attribute(name=objectClass, values={'top', 'organizationalUnit'}), Attribute(name=ou, values={'Groups'})}).')
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.waitUntilReady(LdapContainer.java:107)
   >    at org.testcontainers.containers.GenericContainer$AbstractWaitStrategy.waitUntilReady(GenericContainer.java:909)
   >    at org.testcontainers.containers.GenericContainer.waitUntilContainerStarted(GenericContainer.java:453)
   >    at org.testcontainers.containers.GenericContainer.tryStart(GenericContainer.java:225)
   >    ... 13 more
   > Caused by: LDAPException(resultCode=81 (server down), errorMessage='The connection to server localhost:32823 was closed while waiting for a response to an add request AddRequest(dn='ou=Groups,dc=example,dc=com', attrs={Attribute(name=objectClass, values={'top', 'organizationalUnit'}), Attribute(name=ou, values={'Groups'})}).')
   >    at com.unboundid.ldap.sdk.AddRequest.handleResponse(AddRequest.java:1293)
   >    at com.unboundid.ldap.sdk.AddRequest.process(AddRequest.java:1035)
   >    at com.unboundid.ldap.sdk.LDAPConnection.add(LDAPConnection.java:1950)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.initLdap(LdapContainer.java:142)
   >    at org.elasticsearch.plugin.readonlyrest.utils.containers.LdapContainer$1.waitUntilReady(LdapContainer.java:105)
   >    ... 16 more
Completed [29/32] on J3 in 5.87s, 0 tests, 1 error <<< FAILURES!

HEARTBEAT J1 PID([email protected]): 2017-05-16T15:32:13, stalled for 30.4s at: ReverseProxyAuthenticationWithGroupsProviderAuthorizationTests (suite)
HEARTBEAT J0 PID([email protected]): 2017-05-16T15:32:13, stalled for 20.9s at: IndicesReverseWildcardTests (suite)
HEARTBEAT J2 PID([email protected]): 2017-05-16T15:32:19, stalled for 20.3s at: ExternalAuthenticationTests (suite)
HEARTBEAT J1 PID([email protected]): 2017-05-16T15:32:23, stalled for 40.4s at: ReverseProxyAuthenticationWithGroupsProviderAuthorizationTests (suite)
HEARTBEAT J0 PID([email protected]): 2017-05-16T15:32:23, stalled for 30.9s at: IndicesReverseWildcardTests (suite)
HEARTBEAT J2 PID([email protected]): 2017-05-16T15:32:29, stalled for 30.4s at: ExternalAuthenticationTests (suite)
Tests with failures:
  - org.elasticsearch.plugin.readonlyrest.settings.LdapSettingsTests (suite)
  - org.elasticsearch.plugin.readonlyrest.acl.definitions.ldaps.UnboundidGroupsProviderLdapClientTests (suite)
  - org.elasticsearch.plugin.readonlyrest.integration.LdapIntegrationSecondOptionTests (suite)
  - org.elasticsearch.plugin.readonlyrest.es.IndicesRewriteTests (suite)
  - org.elasticsearch.plugin.readonlyrest.integration.LdapIntegrationFirstOptionTests (suite)

Slow Tests Summary:
 47.94s | org.elasticsearch.plugin.readonlyrest.integration.ReverseProxyAuthenticationWithGroupsProviderAuthorizationTests
 38.15s | org.elasticsearch.plugin.readonlyrest.integration.ExternalAuthenticationTests
 35.76s | org.elasticsearch.plugin.readonlyrest.es.IndicesReverseWildcardTests
 11.05s | org.elasticsearch.plugin.readonlyrest.acl.definitions.ldaps.UnboundidGroupsProviderLdapClientTests
 10.86s | org.elasticsearch.plugin.readonlyrest.integration.LdapIntegrationSecondOptionTests

JUnit4 test failed, ant output was:
   [junit4] <JUnit4> says olá! Master seed: 527D1B9E9586B02F
   [junit4] JVM J0:     0.63 ..    51.08 =    50.46s
   [junit4] JVM J1:     0.63 ..    53.96 =    53.34s
   [junit4] JVM J2:     0.63 ..    60.24 =    59.62s
   [junit4] JVM J3:     0.63 ..    34.30 =    33.67s
   [junit4] Execution time total: 1 minute 1 second
   [junit4] Tests summary: 32 suites, 92 tests, 5 suite-level errors

:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were test failures: 32 suites, 92 tests, 5 suite-level errors [seed: 527D1B9E9586B02F]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 8.244 secs

I have Docker version 17.03.1-ce, build c6d412e installed.
Any ideas as to what I might have set up incorrectly?


(Simone Scarduzio) #2

Docker integration tests don’t work in MacOS launching them from gradle. You need to run them in the IDE (IntelliJ). Must be some weird Docker issue.

Everything is fine in CI and Linux. So maybe try a VM or skip the integration tests.


(Tian000) #3

What would be the best way to disable integration tests?
I already have the following line in the build.gradle:
integTest.enabled = true


(Simone Scarduzio) #4

And that worked? Not really a gradle expert.


(Simone Scarduzio) #5

You might be interested in this

https://github.com/elastic/elasticsearch/blob/master/GRADLE.CHEATSHEET


(Krešimir Nesek) #6

Flag -x allow you to skip certain tasks. You can see the list of all tasks by invoking ./gradlew tasks.

You now probably think all you should do is ./gradlew build -x integTest. However that will still run some of RoR’s integration tests which will likely fail for you if you don’t have the right environment. You need to exclude all tests with -x test.

Some people recommend setting up their build.gradle to separate integration tests and unit tests in separate tasks and then have test task first call unit test task and then integration tests task. In that case you could skip integration tests only with -x.

Anyhow:

./gradlew build -x test

is what you need.


(Simone Scarduzio) #7

Cool, would be nice to have them separated in ROR too