[DLUX-31] [RC0] index.html not loading. cannot access dlux gui Created: 05/Jun/15  Updated: 15/Jun/15  Resolved: 15/Jun/15

Status: Resolved
Project: dlux
Component/s: General
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Jamo Luhrsen Assignee: Harman Singh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 3602

 Description   

Using RC0

loading odl-openflowplugin-flow-services-ui feature (which will bring in dlux features)

I have a newer distribution from RC0 and do not see this, FWIW:
distribution-karaf-0.3.0-20150605.143033-2324.zip

when I point my browser to http://${CONTROLLER_IP}:8181/index.html I get the following
traceback in my browser.

Problem accessing /index.html. Reason:

Server Error
Caused by:

java.lang.NullPointerException: Error while generating the page. Could not read the index.html file.
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226)
at org.opendaylight.dlux.loader.implementation.DluxLoaderIndexServlet.doGet(DluxLoaderIndexServlet.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:744)



 Comments   
Comment by Harman Singh [ 08/Jun/15 ]

(In reply to Jamo Luhrsen from comment #0)
> Using RC0
>
> loading odl-openflowplugin-flow-services-ui feature (which will bring in
> dlux features)
>
> I have a newer distribution from RC0 and do not see this, FWIW:
> distribution-karaf-0.3.0-20150605.143033-2324.zip
>
> when I point my browser to http://${CONTROLLER_IP}:8181/index.html I get the
> following
> traceback in my browser.
>
>
> Problem accessing /index.html. Reason:
>
> Server Error
> Caused by:
>
> java.lang.NullPointerException: Error while generating the page. Could not
> read the index.html file.
> at
> com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226)
> at
> org.opendaylight.dlux.loader.implementation.DluxLoaderIndexServlet.
> doGet(DluxLoaderIndexServlet.java:69)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.
> doHandle(HttpServiceServletHandler.java:69)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:
> 231)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:
> 1086)
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.
> doHandle(HttpServiceContext.java:240)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:
> 193)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:
> 1020)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> at
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.
> handle(JettyServerHandlerCollection.java:75)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:
> 116)
> at org.eclipse.jetty.server.Server.handle(Server.java:370)
> at
> org.eclipse.jetty.server.AbstractHttpConnection.
> handleRequest(AbstractHttpConnection.java:494)
> at
> org.eclipse.jetty.server.AbstractHttpConnection.
> headerComplete(AbstractHttpConnection.java:971)
> at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.
> headerComplete(AbstractHttpConnection.java:1033)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:
> 82)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.
> java:696)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.
> java:53)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:
> 608)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:
> 543)
> at java.lang.Thread.run(Thread.java:744)

Can you let me know from where you got RC0 distribution and What OS were you using to try out this distribution?

Comment by Jamo Luhrsen [ 08/Jun/15 ]

here is the RC0 bits I used:
https://nexus.opendaylight.org/content/repositories/automatedweeklyreleases-1057/org/opendaylight/integration/distribution-karaf/0.3.0-Lithium-RC0/

this setup:
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise

also, via IRC, hideyuki saw this on a CentOS7 system.

Comment by Harman Singh [ 08/Jun/15 ]

So, i see this issue on my machine also, when i use RC0 build that you pointed it. After little investigation, i figured the loader implementation jar https://nexus.opendaylight.org/content/repositories/automatedweeklyreleases-1057/org/opendaylight/dlux/loader.implementation/0.2.0-Lithium-RC0/ , does not have index.html at all. This works fine in stable lithium integration distribution https://jenkins.opendaylight.org/releng/view/Distribution-Jobs/job/integration-distribution-merge-stable-lithium/lastBuild/org.opendaylight.integration$distribution-karaf/ and dlux distribution, because those jars have correct files.

Now, question is, how RC0 is being cut and from where?

Comment by Thanh Ha (zxiiro) [ 10/Jun/15 ]

(In reply to Harman Singh from comment #3)
> So, i see this issue on my machine also, when i use RC0 build that you
> pointed it. After little investigation, i figured the loader implementation
> jar
> https://nexus.opendaylight.org/content/repositories/automatedweeklyreleases-
> 1057/org/opendaylight/dlux/loader.implementation/0.2.0-Lithium-RC0/ , does
> not have index.html at all. This works fine in stable lithium integration
> distribution
> https://jenkins.opendaylight.org/releng/view/Distribution-Jobs/job/
> integration-distribution-merge-stable-lithium/lastBuild/org.opendaylight.
> integration$distribution-karaf/ and dlux distribution, because those jars
> have correct files.
>
> Now, question is, how RC0 is being cut and from where?

RC0 was cut last Wednesday night. The disparity could be because of timing. When was this bug last fixed?

Depending on the integration job could be the disparity if it's being built nightly and the issue was resolved recently. In this case we will see if it's solved in RC1.

Comment by Thanh Ha (zxiiro) [ 10/Jun/15 ]

I will produce a RC0.1 build today and we can verify if this bug is still an issue with that build. I will also work on getting the autorelease Daily build to publish artifacts to Nexus so that we don't have to wait for RCs to build in the future.

Comment by Thanh Ha (zxiiro) [ 13/Jun/15 ]

I noticed in the autorelease runs there's 2 dlux test failures listed at these 2 links due to NullPointer.

https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-release-lithium/23/org.opendaylight.dlux$loader.implementation/testReport/org.opendaylight.dlux.loader/DluxLoaderIndexServletTest/testLoadIndexHTML/

https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-release-lithium/23/org.opendaylight.dlux$loader.implementation/testReport/org.opendaylight.dlux.loader/DluxLoaderIndexServletTest/testLoadModulePropertyFile/

Are these related to this bug?

Comment by Harman Singh [ 13/Jun/15 ]

looks like it, i added these tests recently, to make sure loading happens fine.

So here is how it works in dlux -

1. All the common resources files are under loader.resources jar and this jar's content gets copied to dlux-web directory for massaging and dlux-web puts them into build directory present under dlux-web.

2. Then, loader implementation copies those files to make a jar out of it along with karaf blueprint, so karaf can load those file.

This is the snippet inside loader implementation pom.xml, which does this job -

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-src-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/target/generated-resources/dlux</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/../../dlux-web/build/</directory>
<includes>
<include>src/main.js</include>
<include>src/app/app.controller.js</include>
<include>src/app/app.module.js</include>
<include>src/app/routingConfig.js</include>
<include>src/common/config/env.module.js</include>
<include>vendor/**</include>
<include>assets/**</include>
</includes>
<excludes>
</excludes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-index</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.basedir}/target/generated-resources/index</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/../../dlux-web/build/</directory>
<includes>
<include>index.html</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>

After looking at logs of build failure https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-release-lithium/23/org.opendaylight.dlux$loader.implementation/console , i see this line -

skip non existing resourceDirectory /opt/jenkins/workspace/autorelease-release-lithium/dlux/loader/impl/../../dlux-web/build

Why would this happen? I am assuming this build is running like any other clone of dlux project.

Comment by Thanh Ha (zxiiro) [ 13/Jun/15 ]

FWIW this is the commandline autorelease uses to kick off a build.

clean install source:jar javadoc:jar -Pintegrationtests,docs,repoBuild -Dcheckstyle.skip=true -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r

Which looks fairly similar to what DLUX uses to build although DLUX builds with less options.

In past experience I've found the maven-resources-plugin to be sometimes finicky with the settings and doesn't always do what you expect. I know where to look now so I will try to reproduce it on my laptop.

Let me know if there's anything I can get you to help you troubleshoot too.

Comment by Thanh Ha (zxiiro) [ 13/Jun/15 ]

I think I just figured it out. The fact that DLUX even is successful in DLUX's own official build seems to be pure luck of the draw.

The gist of it is that loader.implementation depends on dlux-web being built first but does not declare dlux-web as a dependency.

In the DLUX official build Maven just happens to decide that dlux-web should be built before loader.implementation is built. So this missing dependency issue does not get picked up as build order by chance just happens to be correct.

In the autorelease build because there is numerous more build modules Maven's dependency calculation gets calculated in a different order and DLUX is not lucky here as dlux-web is ordered to be built after loader.implementation is built.

The solution is to add dlux-web as a dependency to loader.implementation as it is dependent on that module being first built in order for the resources plugin to be successful in finding the site pages.

Below is a snippet of the reactor orders from autorelease (you can compare this to the Reactor order found in the dlux-merge jobs):

[INFO] dlux
[INFO] loader
[INFO] dlux.loader.resources
[INFO] loader.implementation
[INFO] dlux.core.resources
[INFO] DLUX - Bundles
[INFO] dlux.core
[INFO] dlux.common.layout.resources
[INFO] dlux.common.layout
[INFO] dlux.common.login.resources
[INFO] dlux.common.login
[INFO] dlux.common.authentication.resources
[INFO] dlux.common.authentication
[INFO] dlux.common.navigation.resources
[INFO] dlux.common.navigation
[INFO] dlux.common.topbar.resources
[INFO] dlux.common.topbar
[INFO] dlux.common.general.resources
[INFO] dlux.common.general
[INFO] dlux.node.resources
[INFO] dlux.node
[INFO] dlux.graph.resources
[INFO] dlux.topology.resources
[INFO] dlux.topology
[INFO] dlux.yangui.resources
[INFO] dlux.yangui
[INFO] dlux.common.yangutils.resources
[INFO] dlux.common.yangutils
[INFO] dlux.common.sigmatopology.resources
[INFO] dlux.common.sigmatopology
[INFO] dlux.yangvisualizer.resources
[INFO] dlux.yangvisualizer
[INFO] DLUX - Features

... # Truncated uninteresting parts

[INFO] dlux.network.resources ............................. SUCCESS [ 0.004 s]
[INFO] dlux.flow.resources ................................ SUCCESS [ 0.003 s]
[INFO] dlux.container.resources ........................... SUCCESS [ 0.004 s]
[INFO] dlux.connection_manager.resources .................. SUCCESS [ 0.004 s]
[INFO] dlux.resources ..................................... SUCCESS [ 0.004 s]
[INFO] DLUX - DLUX Static Web
[INFO] distribution-dlux

Comment by Thanh Ha (zxiiro) [ 13/Jun/15 ]

Proposed patch: https://git.opendaylight.org/gerrit/22533

Comment by Thanh Ha (zxiiro) [ 13/Jun/15 ]

(In reply to Thanh Ha from comment #10)
> Proposed patch: https://git.opendaylight.org/gerrit/22533

I messed up and submitted 2 patches:

master: https://git.opendaylight.org/gerrit/#/c/22533/
lithium: https://git.opendaylight.org/gerrit/#/c/22534/

Comment by Thanh Ha (zxiiro) [ 15/Jun/15 ]

This should be fixed now with the latest RC1 build. Can someone verify that it's fixed?

https://nexus.opendaylight.org/content/repositories/automatedweeklyreleases-1062/org/opendaylight/integration/distribution-karaf/0.3.0-Lithium-RC1-v201506140556/

Comment by Harman Singh [ 15/Jun/15 ]

It is still not fixed, i just tried it. Can you check if maven maintained the build order? Also, tests did not fail?

Comment by Thanh Ha (zxiiro) [ 15/Jun/15 ]

(In reply to Harman Singh from comment #13)
> It is still not fixed, i just tried it. Can you check if maven maintained
> the build order? Also, tests did not fail?

This is the build https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-release-lithium/25/

I can comfirm that dlux-web is built before loader.implementation.

[INFO] dlux ............................................... SUCCESS [ 0.004 s]
[INFO] loader ............................................. SUCCESS [ 0.004 s]
[INFO] dlux.node.resources ................................ SUCCESS [ 0.004 s]
[INFO] dlux.common.yangutils.resources .................... SUCCESS [ 0.004 s]
[INFO] dlux.common.sigmatopology.resources ................ SUCCESS [ 0.004 s]
[INFO] dlux.common.navigation.resources ................... SUCCESS [ 0.004 s]
[INFO] dlux.common.layout.resources ....................... SUCCESS [ 0.004 s]
[INFO] dlux.common.authentication.resources ............... SUCCESS [ 0.003 s]
[INFO] dlux.common.login.resources ........................ SUCCESS [ 0.004 s]
[INFO] dlux.common.general.resources ...................... SUCCESS [ 0.004 s]
[INFO] dlux.yangui.resources .............................. SUCCESS [ 0.004 s]
[INFO] dlux.yangvisualizer.resources ...................... SUCCESS [ 0.003 s]
[INFO] dlux.graph.resources ............................... SUCCESS [ 0.004 s]
[INFO] dlux.topology.resources ............................ SUCCESS [ 0.246 s]
[INFO] dlux.loader.resources .............................. SUCCESS [ 0.004 s]
[INFO] dlux.core.resources ................................ SUCCESS [ 0.004 s]
[INFO] dlux.common.topbar.resources ....................... SUCCESS [ 0.003 s]
[INFO] DLUX - DLUX Static Web ............................. SUCCESS [ 3.667 s]
[INFO] loader.implementation .............................. SUCCESS [ 0.492 s]
[INFO] DLUX - Bundles ..................................... SUCCESS [ 0.004 s]
[INFO] dlux.core .......................................... SUCCESS [ 0.653 s]
[INFO] dlux.common.layout ................................. SUCCESS [ 0.007 s]
[INFO] dlux.common.login .................................. SUCCESS [ 0.006 s]
[INFO] dlux.common.authentication ......................... SUCCESS [ 0.006 s]
[INFO] dlux.common.navigation ............................. SUCCESS [ 0.006 s]
[INFO] dlux.common.topbar ................................. SUCCESS [ 0.006 s]
[INFO] dlux.common.general ................................ SUCCESS [ 0.005 s]
[INFO] dlux.node .......................................... SUCCESS [ 0.006 s]
[INFO] dlux.topology ...................................... SUCCESS [ 0.006 s]
[INFO] dlux.yangui ........................................ SUCCESS [ 0.006 s]
[INFO] dlux.common.yangutils .............................. SUCCESS [ 0.006 s]
[INFO] dlux.common.sigmatopology .......................... SUCCESS [ 0.006 s]
[INFO] dlux.yangvisualizer ................................ SUCCESS [ 0.005 s]
[INFO] DLUX - Features .................................... SUCCESS [ 3.392 s]

Comment by Thanh Ha (zxiiro) [ 15/Jun/15 ]

I see a bunch of errors in dlux-web part of the build:

https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-release-lithium/25/org.opendaylight.dlux$dlux-web/consoleFull

Is this expected?

Comment by Thanh Ha (zxiiro) [ 15/Jun/15 ]

(In reply to Thanh Ha from comment #15)
> I see a bunch of errors in dlux-web part of the build:
>
> https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-
> release-lithium/25/org.opendaylight.dlux$dlux-web/consoleFull
>
> Is this expected?

Here's the log for loader.implementation:

https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-release-lithium/25/org.opendaylight.dlux$loader.implementation/console

and the unit tests appear to be passing:

https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-release-lithium/25/testReport/

Comment by Harman Singh [ 15/Jun/15 ]

i just checked, this jar looks good -
https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-release-lithium/25/org.opendaylight.dlux$loader.implementation/

but the link you posted before for RC1, i think that link version is different from this one. I think i tested wrong version of RC1

Comment by Thanh Ha (zxiiro) [ 15/Jun/15 ]

(In reply to Harman Singh from comment #17)
> i just checked, this jar looks good -
> https://jenkins.opendaylight.org/releng/view/autorelease/job/autorelease-
> release-lithium/25/org.opendaylight.dlux$loader.implementation/
>
> but the link you posted before for RC1, i think that link version is
> different from this one. I think i tested wrong version of RC1

Oops, sorry you're right. I did copy the wrong URL. Here's the correct one.

https://nexus.opendaylight.org/content/repositories/automatedweeklyreleases-1063/org/opendaylight/integration/distribution-karaf/0.3.0-Lithium-RC1-v201506150016/

Comment by Harman Singh [ 15/Jun/15 ]

And it works finally. Thanks Thanh! Marking this defect resolved.

Generated at Wed Feb 07 19:57:45 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.