You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by John Logan <Jo...@texture.com> on 2016/10/27 13:11:38 UTC

Sling Launchpad Builder maven build failing - how to diagnose?

Hi,


Until just recently, I've been able to build the Sling Launchpad Builder project in isolation by cloning the Sling GitHub repo, and running 'mvn build' from the builder/launchpad directory.


I'm now seeing the integration test failure shown at the bottom of this message.  I've looked at the logs for the integration test and the only errors that I see are:


27.10.2016 06:00:51.782 *ERROR* [qtp1620216741-76] org.apache.sling.engine.impl.SlingHttpContext handleSecurity: AuthenticationSupport service missing. Cannot authenticate request.
27.10.2016 06:00:51.782 *ERROR* [qtp1620216741-76] org.apache.sling.engine.impl.SlingHttpContext handleSecurity: Possible reason is missing Repository service. Check AuthenticationSupport dependencies.


and:


27.10.2016 06:00:53.231 *ERROR* [OsgiInstallerImpl] org.apache.sling.discovery.oak.pinger.OakViewChecker issueHeartbeat: discoveryService is null


I'm using Oracle Java 8 for the build:


$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)


Should it be possible, in general, to build the stock launchpad in isolation?  If so, does anyone have suggestions on where I should start looking for problems?


Thanks!  John


-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.sling.launchpad.SmokeIT
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/john/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/john/.m2/repository/org/slf4j/slf4j-simple/1.5.2/slf4j-simple-1.5.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Attempting to load ESAPI.properties via file I/O.
Attempting to load ESAPI.properties as resource file via file I/O.
Not found in 'org.owasp.esapi.resources' directory or file not readable: /home/john/git/apache/sling/launchpad/builder/target/_-46739/ESAPI.properties
Not found in SystemResource Directory/resourceDirectory: .esapi/ESAPI.properties
Not found in 'user.home' (/home/john) directory: /home/john/esapi/ESAPI.properties
Loading ESAPI.properties via file I/O failed. Exception was: java.io.FileNotFoundException
Attempting to load ESAPI.properties via the classpath.
SUCCESSFULLY LOADED ESAPI.properties via the CLASSPATH from '/ (root)' using class loader for DefaultSecurityConfiguration class!
Attempting to load validation.properties via file I/O.
Attempting to load validation.properties as resource file via file I/O.
Not found in 'org.owasp.esapi.resources' directory or file not readable: /home/john/git/apache/sling/launchpad/builder/target/_-46739/validation.properties
Not found in SystemResource Directory/resourceDirectory: .esapi/validation.properties
Not found in 'user.home' (/home/john) directory: /home/john/esapi/validation.properties
Loading validation.properties via file I/O failed.
Attempting to load validation.properties via the classpath.
SUCCESSFULLY LOADED validation.properties via the CLASSPATH from '/ (root)' using class loader for DefaultSecurityConfiguration class!
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 61.927 sec <<< FAILURE! - in org.apache.sling.launchpad.SmokeIT
org.apache.sling.launchpad.SmokeIT  Time elapsed: 61.926 sec  <<< ERROR!
java.lang.RuntimeException: Launchpad not ready. Failed check for URL http://localhost:46739/server/default/jcr:root with message 'Status code is HTTP/1.1 404 Not Found'
    at org.apache.sling.launchpad.LaunchpadReadyRule.runCheck(LaunchpadReadyRule.java:96)
    at org.apache.sling.launchpad.LaunchpadReadyRule.before(LaunchpadReadyRule.java:66)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)


Re: Sling Launchpad Builder maven build failing - how to diagnose?

Posted by John Logan <Jo...@texture.com>.
OK, I didn't expect this.  I tried building the svn trunk and see no problems.


Both git://git.apache.org/sling.git (which is what I was building from that didn't work) and its github mirror are current only to the commit below from six days ago.


John


commit 282724642496e582eca31819e9d18d7c607b79f9
Author: Radu Cotescu <ra...@apache.org>
Date:   Fri Oct 21 16:52:36 2016 +0000

    SLING-6165 - Expose a service for Sling Scripting that provides request-scoped Resource Resolvers for scripting dependencies

    * defined ScriptingResourceResolverFactory + implementation

    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1766070 13f79535-47bb-0310-9956-ffa450edef68





________________________________
From: John Logan
Sent: Thursday, October 27, 2016 10:01 AM
To: users@sling.apache.org
Subject: Re: Sling Launchpad Builder maven build failing - how to diagnose?

Hi Robert, thanks for the pointers!

On Thursday, October 27, 2016 7:22 AM, Robert Munteanu wrote:
> Hi John,
>
> On Thu, 2016-10-27 at 13:11 +0000, John Logan wrote:
> > Hi,
> >
> >
> > Until just recently, I've been able to build the Sling Launchpad
> > Builder project in isolation by cloning the Sling GitHub repo, and
> > running 'mvn build' from the builder/launchpad directory.
>
> ( I assume you mean mvn install )

Yes, exactly.  It was very early in the morning when it wrote this :)

[snip]

> >
> > Should it be possible, in general, to build the stock launchpad in
> > isolation?  If so, does anyone have suggestions on where I should
> > start looking for problems?
>
> Yes, it should be possible. We actually do this on our CI instance and
> right now it succeeds.
>
>   https://builds.apache.org/job/sling-launchpad-builder-1.8/
>
> I would try a couple of things.
>
> 1. Build using '-U' to pull in the latest snapshots, e.g.
>
>   mvn -U clean install
>

I've tried this as well as simply deleting .m2/repository.  Neither
results in a change.

> 2. Manually start the launchpad which was build by Maven, using
>
>   java -jar target/org.apache.sling.launchpad-9-SNAPSHOT.jar
>

I get a 404 when I try to load the base URL after starting the
launchpad in this manner.  The server log seems to indicate pretty
severe breakage; there are about 150 errors during startup, of the form:

27.10.2016 09:41:28.682 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService)] org.apache.sling.event.impl.jobs Unable to create new resource resolver: Cannot derive user name for bundle org.apache.sling.event [104] and sub service null
27.10.2016 09:41:28.683 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService)] org.apache.sling.event [org.apache.sling.event.impl.jobs.jcr.PersistenceHandler(105)] The activate method has thrown an exception (java.lang.RuntimeException: org.apache.sling.api.resource.LoginException: Cannot derive user name for bundle org.apache.sling.event [104] and sub service null)
27.10.2016 09:41:28.689 *ERROR* [FelixDispatchQueue] org.apache.sling.event FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.event.impl.jobs.jcr.PersistenceHandler (105)))
27.10.2016 09:41:28.704 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService)] org.apache.sling.event.impl.jobs Unable to create new resource resolver: Cannot derive user name for bundle org.apache.sling.event [104] and sub service null
27.10.2016 09:41:28.705 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService)] org.apache.sling.event [org.apache.sling.event.impl.jobs.jcr.PersistenceHandler(105)] The activate method has thrown an exception (java.lang.RuntimeException: org.apache.sling.api.resource.LoginException: Cannot derive user name for bundle org.apache.sling.event [104] and sub service null)
27.10.2016 09:41:28.711 *ERROR* [FelixDispatchQueue] org.apache.sling.event FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.event.impl.jobs.jcr.PersistenceHandler (105)))
27.10.2016 09:41:28.718 *ERROR* [FelixDispatchQueue] org.apache.sling.event FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.event.impl.jobs.JobManagerImpl (96)))
27.10.2016 09:41:28.724 *ERROR* [FelixDispatchQueue] org.apache.aries.jmx.whiteboard FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.event.impl.jobs.jmx.AllJobStatisticsMBean (103)))

> and see if that works for you . If
>
> 3. As a last resort, run the build without testing
>
>   mvn clean install -DskipTests
>
> This will build and install the launchpad without running the
> integration tests. But I'd still like to know why the build fails for
> you :-)
>

I've searched through the commits to see where I first see this
problem.  It looks like I'm seeing the same failure logged in
SLING-6130, and the failure occurs at the later of these two
commits to the repo.

commit 95d765aa221d34510ef6690e527a927ccd73734c
Author: Bertrand Delacretaz <bd...@apache.org>
Date:   Wed Oct 12 13:31:55 2016 +0000

    SLING-5135 - update launchpad to use latest bundles with login admin whitelist enabled

    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1764464 13f79535-47bb-0310-9956-ffa450edef68

commit 6cc9bc4d885261ae820c071d91768c741ad41276
Author: Bertrand Delacretaz <bd...@apache.org>
Date:   Wed Oct 12 13:27:39 2016 +0000

    SLING-6130 - revert revision 1764259 which breaks the launchpad with 'unknown node type sling:Folder' (I'll explain in jira)

    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1764462 13f79535-47bb-0310-9956-ffa450edef68


> Hope this helps,
>
> Robert


Re: Sling Launchpad Builder maven build failing - how to diagnose?

Posted by Robert Munteanu <ro...@apache.org>.
Mistery solved then :-)

I've asked infra to look into why the git mirror is lagging

https://issues.apache.org/jira/browse/INFRA-12835

Thanks,

Robert

On Thu, 2016-10-27 at 17:35 +0000, John Logan wrote:
> Looks like we came to the same findings regarding the state of the
> git repo relative to the svn trunk.��I did notice that setting had
> been added in the provisioning files in the commits since Oct 21.
> 
> ________________________________
> From: Robert Munteanu <ro...@apache.org>
> Sent: Thursday, October 27, 2016 10:13:16 AM
> To: users@sling.apache.org
> Subject: Re: Sling Launchpad Builder maven build failing - how to
> diagnose?
> 
> On Thu, 2016-10-27 at 17:01 +0000, John Logan wrote:
> > 27.10.2016 09:41:28.704 *ERROR* [CM Event Dispatcher (Fire
> > ConfigurationEvent:
> > pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreServi
> > ce
> > )] org.apache.sling.event.impl.jobs Unable to create new resource
> > resolver: Cannot derive user name for bundle org.apache.sling.event
> > [104] and sub service null
> 
> That's interesting. Can you try adding the following configuration to
> the launchpad?
> 
> � org.apache.sling.jcr.base.internal.LoginAdminWhitelistImpl
> ����whitelist.bypass=B"true"
> 
> Also, can you confirm the SVN revision you're on ( latest local
> commit
> message is fine, I think you're using git-svn ) and whether you have
> any local changes?
> 
> Thanks,
> 
> Robert


Re: Sling Launchpad Builder maven build failing - how to diagnose?

Posted by John Logan <Jo...@texture.com>.
Looks like we came to the same findings regarding the state of the git repo relative to the svn trunk.  I did notice that setting had been added in the provisioning files in the commits since Oct 21.

________________________________
From: Robert Munteanu <ro...@apache.org>
Sent: Thursday, October 27, 2016 10:13:16 AM
To: users@sling.apache.org
Subject: Re: Sling Launchpad Builder maven build failing - how to diagnose?

On Thu, 2016-10-27 at 17:01 +0000, John Logan wrote:
> 27.10.2016 09:41:28.704 *ERROR* [CM Event Dispatcher (Fire
> ConfigurationEvent:
> pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
> )] org.apache.sling.event.impl.jobs Unable to create new resource
> resolver: Cannot derive user name for bundle org.apache.sling.event
> [104] and sub service null

That's interesting. Can you try adding the following configuration to
the launchpad?

  org.apache.sling.jcr.base.internal.LoginAdminWhitelistImpl
    whitelist.bypass=B"true"

Also, can you confirm the SVN revision you're on ( latest local commit
message is fine, I think you're using git-svn ) and whether you have
any local changes?

Thanks,

Robert

Re: Sling Launchpad Builder maven build failing - how to diagnose?

Posted by Robert Munteanu <ro...@apache.org>.
On Thu, 2016-10-27 at 17:01 +0000, John Logan wrote:
> 27.10.2016 09:41:28.704 *ERROR* [CM Event Dispatcher (Fire
> ConfigurationEvent:
> pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
> )] org.apache.sling.event.impl.jobs Unable to create new resource
> resolver: Cannot derive user name for bundle org.apache.sling.event
> [104] and sub service null

That's interesting. Can you try adding the following configuration to
the launchpad?

� org.apache.sling.jcr.base.internal.LoginAdminWhitelistImpl
����whitelist.bypass=B"true"

Also, can you confirm the SVN revision you're on ( latest local commit
message is fine, I think you're using git-svn ) and whether you have
any local changes?

Thanks,

Robert

Re: Sling Launchpad Builder maven build failing - how to diagnose?

Posted by John Logan <Jo...@texture.com>.
Hi Robert, thanks for the pointers!

On Thursday, October 27, 2016 7:22 AM, Robert Munteanu wrote:    
> Hi John,
> 
> On Thu, 2016-10-27 at 13:11 +0000, John Logan wrote:
> > Hi,
> > 
> > 
> > Until just recently, I've been able to build the Sling Launchpad
> > Builder project in isolation by cloning the Sling GitHub repo, and
> > running 'mvn build' from the builder/launchpad directory.
> 
> ( I assume you mean mvn install )

Yes, exactly.  It was very early in the morning when it wrote this :)

[snip]

> > 
> > Should it be possible, in general, to build the stock launchpad in
> > isolation?  If so, does anyone have suggestions on where I should
> > start looking for problems?
> 
> Yes, it should be possible. We actually do this on our CI instance and
> right now it succeeds.
> 
>   https://builds.apache.org/job/sling-launchpad-builder-1.8/
> 
> I would try a couple of things.
> 
> 1. Build using '-U' to pull in the latest snapshots, e.g.
> 
>   mvn -U clean install
> 

I've tried this as well as simply deleting .m2/repository.  Neither
results in a change.

> 2. Manually start the launchpad which was build by Maven, using
> 
>   java -jar target/org.apache.sling.launchpad-9-SNAPSHOT.jar
> 

I get a 404 when I try to load the base URL after starting the
launchpad in this manner.  The server log seems to indicate pretty
severe breakage; there are about 150 errors during startup, of the form:

27.10.2016 09:41:28.682 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService)] org.apache.sling.event.impl.jobs Unable to create new resource resolver: Cannot derive user name for bundle org.apache.sling.event [104] and sub service null
27.10.2016 09:41:28.683 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService)] org.apache.sling.event [org.apache.sling.event.impl.jobs.jcr.PersistenceHandler(105)] The activate method has thrown an exception (java.lang.RuntimeException: org.apache.sling.api.resource.LoginException: Cannot derive user name for bundle org.apache.sling.event [104] and sub service null)
27.10.2016 09:41:28.689 *ERROR* [FelixDispatchQueue] org.apache.sling.event FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.event.impl.jobs.jcr.PersistenceHandler (105)))
27.10.2016 09:41:28.704 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService)] org.apache.sling.event.impl.jobs Unable to create new resource resolver: Cannot derive user name for bundle org.apache.sling.event [104] and sub service null
27.10.2016 09:41:28.705 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService)] org.apache.sling.event [org.apache.sling.event.impl.jobs.jcr.PersistenceHandler(105)] The activate method has thrown an exception (java.lang.RuntimeException: org.apache.sling.api.resource.LoginException: Cannot derive user name for bundle org.apache.sling.event [104] and sub service null)
27.10.2016 09:41:28.711 *ERROR* [FelixDispatchQueue] org.apache.sling.event FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.event.impl.jobs.jcr.PersistenceHandler (105)))
27.10.2016 09:41:28.718 *ERROR* [FelixDispatchQueue] org.apache.sling.event FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.event.impl.jobs.JobManagerImpl (96)))
27.10.2016 09:41:28.724 *ERROR* [FelixDispatchQueue] org.apache.aries.jmx.whiteboard FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.event.impl.jobs.jmx.AllJobStatisticsMBean (103)))

> and see if that works for you . If 
> 
> 3. As a last resort, run the build without testing
> 
>   mvn clean install -DskipTests
> 
> This will build and install the launchpad without running the
> integration tests. But I'd still like to know why the build fails for
> you :-)
> 

I've searched through the commits to see where I first see this
problem.  It looks like I'm seeing the same failure logged in
SLING-6130, and the failure occurs at the later of these two
commits to the repo.

commit 95d765aa221d34510ef6690e527a927ccd73734c
Author: Bertrand Delacretaz <bd...@apache.org>
Date:   Wed Oct 12 13:31:55 2016 +0000

    SLING-5135 - update launchpad to use latest bundles with login admin whitelist enabled
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1764464 13f79535-47bb-0310-9956-ffa450edef68

commit 6cc9bc4d885261ae820c071d91768c741ad41276
Author: Bertrand Delacretaz <bd...@apache.org>
Date:   Wed Oct 12 13:27:39 2016 +0000

    SLING-6130 - revert revision 1764259 which breaks the launchpad with 'unknown node type sling:Folder' (I'll explain in jira)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1764462 13f79535-47bb-0310-9956-ffa450edef68


> Hope this helps,
> 
> Robert


Re: Sling Launchpad Builder maven build failing - how to diagnose?

Posted by Robert Munteanu <ro...@apache.org>.
Hi John,

On Thu, 2016-10-27 at 13:11 +0000, John Logan wrote:
> Hi,
> 
> 
> Until just recently, I've been able to build the Sling Launchpad
> Builder project in isolation by cloning the Sling GitHub repo, and
> running 'mvn build' from the builder/launchpad directory.

( I assume you mean mvn install )
> 
> 
> I'm now seeing the integration test failure shown at the bottom of
> this message.��I've looked at the logs for the integration test and
> the only errors that I see are:
> 
> 
> 27.10.2016 06:00:51.782 *ERROR* [qtp1620216741-76]
> org.apache.sling.engine.impl.SlingHttpContext handleSecurity:
> AuthenticationSupport service missing. Cannot authenticate request.
> 27.10.2016 06:00:51.782 *ERROR* [qtp1620216741-76]
> org.apache.sling.engine.impl.SlingHttpContext handleSecurity:
> Possible reason is missing Repository service. Check
> AuthenticationSupport dependencies.
> 
> 
> and:
> 
> 
> 27.10.2016 06:00:53.231 *ERROR* [OsgiInstallerImpl]
> org.apache.sling.discovery.oak.pinger.OakViewChecker issueHeartbeat:
> discoveryService is null
> 
> 
> I'm using Oracle Java 8 for the build:
> 
> 
> $ java -version
> java version "1.8.0_101"
> Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
> 
> 
> Should it be possible, in general, to build the stock launchpad in
> isolation?��If so, does anyone have suggestions on where I should
> start looking for problems?

Yes, it should be possible. We actually do this on our CI instance and
right now it succeeds.

  https://builds.apache.org/job/sling-launchpad-builder-1.8/

I would try a couple of things.

1. Build using '-U' to pull in the latest snapshots, e.g.

  mvn -U clean install

2. Manually start the launchpad which was build by Maven, using

  java -jar target/org.apache.sling.launchpad-9-SNAPSHOT.jar

and see if that works for you . If 

3. As a last resort, run the build without testing

  mvn clean install -DskipTests

This will build and install the launchpad without running the
integration tests. But I'd still like to know why the build fails for
you :-)

Hope this helps,

Robert