Bug 1475845

Summary: novnc doesn't work
Product: [oVirt] ovirt-engine Reporter: jniederm
Component: Frontend.CoreAssignee: jniederm
Status: CLOSED CURRENTRELEASE QA Contact: Liran Rotenberg <lrotenbe>
Severity: high Docs Contact:
Priority: unspecified    
Version: futureCC: bugs, jniederm, michal.skrivanek, sbonazzo, tjelinek
Target Milestone: ovirt-4.2.0Keywords: Regression
Target Release: ---Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-12 10:12:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1481293    
Attachments:
Description Flags
engine.log
none
browser-console.log
none
logs related none

Description jniederm 2017-07-27 13:09:14 UTC
Created attachment 1305360 [details]
engine.log

Description of problem:
Invoking noVNC console opens new tab with just a grey background.

It looks like the page tries to load resources that are no provided by current branding any more.

Version-Release number of selected component (if applicable):
4.2 master, commit 121657eb31

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with VNC graphic protocol
2. Run the VM
3. Select novnc in Console Options dialog
4. Invoke Console of the VM

Actual results:
New browser tab pops up with just a grey page

Expected results:
working console

Additional info:

Comment 1 jniederm 2017-07-27 13:10:36 UTC
Created attachment 1305362 [details]
browser-console.log

Comment 2 jniederm 2017-07-31 13:23:44 UTC
It is failing because jQuery and other resources form package patternfly1 can't be found. Regression introduced by path https://gerrit.ovirt.org/#/c/61716/13/Makefile. Moving to UX.

Comment 3 Oved Ourfali 2017-07-31 13:34:32 UTC
Greg, can you take a look?

Comment 4 Greg Sheremeta 2017-08-01 12:14:45 UTC
Hi,

Those resources are still around, but they've moved. The paths to them probably shouldn't be hardcoded in novnc.jsp (and other console jsps).

see stylesheets.tag and javascripts.tag. You may want to try to use those, like the sso or welcome apps do.

New paths (as seen in right click view source of webadmin):

<link rel="stylesheet" type="text/css" href="/ovirt-engine/webadmin/theme/00-ovirt.brand/web_admin.css">
<link rel="stylesheet" type="text/css" href="/ovirt-engine/webadmin/theme/00-ovirt.brand/common.css">
<link rel="stylesheet" type="text/css" href="/ovirt-engine/webadmin/theme/00-ovirt.brand/gwt_common.css">
<link rel="stylesheet" type="text/css" href="/ovirt-engine/webadmin/theme/00-ovirt.brand/ovirt-js-dependencies/patternfly/dist/css/patternfly.min.css">
<link rel="stylesheet" type="text/css" href="/ovirt-engine/webadmin/theme/00-ovirt.brand/ovirt-js-dependencies/patternfly/dist/css/patternfly-additions.min.css">
<link rel="stylesheet" type="text/css" href="/ovirt-engine/webadmin/theme/00-ovirt.brand/patternfly-ovirt.css">
<link rel="stylesheet" type="text/css" href="/ovirt-engine/webadmin/theme/00-ovirt.brand/ovirt-patternfly-compat.css">
<link rel="stylesheet" type="text/css" href="/ovirt-engine/webadmin/theme/00-ovirt.brand/ovirt.css">
<script type="text/javascript" src="/ovirt-engine/webadmin/theme/00-ovirt.brand/ovirt-js-dependencies/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="/ovirt-engine/webadmin/theme/00-ovirt.brand/ovirt-js-dependencies/jquery-ui-dist/jquery-ui.min.js"></script>
<script type="text/javascript" src="/ovirt-engine/webadmin/theme/00-ovirt.brand/ovirt-js-dependencies/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/ovirt-engine/webadmin/theme/00-ovirt.brand/patternfly-3.25.1-custom.min.js"></script>
<script type="text/javascript" src="/ovirt-engine/webadmin/theme/00-ovirt.brand/ovirt-js-dependencies/insertion-query/insQ.min.js"></script>

Comment 5 Red Hat Bugzilla Rules Engine 2017-08-01 14:07:13 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 6 Liran Rotenberg 2017-09-25 11:57:52 UTC
Created attachment 1330498 [details]
logs related

Comment 7 Liran Rotenberg 2017-09-25 12:04:52 UTC
Hi,
I tried to verify the bug on: 
4.2.0-0.0.master.20170924221426.git196b802.el7.centos

The websocket service is up and running, listening on 6100.
Currently i'm getting only "Internal Server Error" when I try to invoke the noVNC.

Comment 8 Red Hat Bugzilla Rules Engine 2017-09-25 12:04:57 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 9 jniederm 2017-09-25 12:15:26 UTC
Relevant engine log records:

2017-09-25 12:25:01,978+03 ERROR [org.ovirt.engine.core.utils.servlet.ServletUtils] (default task-9) [755de8ed] Can't read file '/etc/ovirt-engine/branding/00-ovirt.brand/patternfly-functions-vertical-nav-custom-3.26.1.js' for request '/ovirt-engine/sso/theme/00-ovirt.brand/patternfly-functions-vertical-nav-custom-3.26.1.js', will send a 404 error response.
2017-09-25 12:25:02,070+03 ERROR [org.ovirt.engine.core.utils.servlet.ServletUtils] (default task-31) [] Can't read file '/etc/ovirt-engine/branding/00-ovirt.brand/patternfly-functions-vertical-nav-custom-3.26.1.js' for request '/ovirt-engine/sso/theme/00-ovirt.brand/patternfly-functions-vertical-nav-custom-3.26.1.js', will send a 404 error response.

Relates to https://gerrit.ovirt.org/c/81589.

File 'patternfly-functions-vertical-nav-custom-3.26.1.js' is not copied to $TARGET directory on my dev setup.

Comment 10 Greg Sheremeta 2017-09-25 13:37:45 UTC
(In reply to jniederm from comment #9)
> File 'patternfly-functions-vertical-nav-custom-3.26.1.js' is not copied to
> $TARGET directory on my dev setup.

my bad, fixed in 82183

Comment 11 Liran Rotenberg 2017-09-28 07:16:16 UTC
I tried to verify the bug again on 
4.2.0-0.0.master.20170925172449.git9d850a9.el7.centos

Now the engine log and the vdsm log looks fine(no error or warning just info) But the result is the same - code 500, Internal Server Error.

Comment 12 Greg Sheremeta 2017-09-28 20:31:44 UTC
Interesting, a different problem now.

org.apache.jasper.JasperException: JBWEB004036: File "obrand" not found
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:57)

line 23:
https://gerrit.ovirt.org/#/c/80059/3/backend/manager/modules/services/src/main/webapp/novnc-main.jsp 

Seems like that JSP can't find "obrand" anymore. I'll look into.

Comment 13 Greg Sheremeta 2017-09-29 23:23:10 UTC
(In reply to Greg Sheremeta from comment #12)
> Seems like that JSP can't find "obrand" anymore. I'll look into.
A dependency issue. I don't want to add a dependency from services on branding (and testing it, it didn't work anyway), so I worked around it in https://gerrit.ovirt.org/#/c/82399/

Comment 14 Greg Sheremeta 2017-10-19 12:50:54 UTC
(In reply to Greg Sheremeta from comment #13)
> I don't want to add a dependency from services on branding

Correction -- I did add the dependency and got it working. Hopefully this works now.

Comment 15 Liran Rotenberg 2017-10-31 09:46:41 UTC
Tried to verify on:
4.2.0-0.0.master.20171025204923.git6f4cbc5.el7.centos

I get a blank page when trying to invoke the noVNC.
The error shown in the browser is:
Loading failed for the <script> with source “.../ovirt-engine/services/files/novnc/include/jsunzip.js”.

The jsunzip.js is 404.

From the engine log:

2017-10-31 11:36:21,415+02 ERROR [org.ovirt.engine.core.utils.servlet.ServletUtils] (default task-8) [] Can't read file '/usr/share/ovirt-engine/files/novnc/include/jsunzip.js' for request '/ovirt-engine/services/files/novnc/include/jsunzip.js', will send a 404 error response.
2017-10-31 11:36:38,519+02 ERROR [org.ovirt.engine.core.utils.servlet.ServletUtils] (default task-32) [] Can't read file '/usr/share/ovirt-engine/files/novnc/include/jsunzip.js' for request '/ovirt-engine/services/files/novnc/include/jsunzip.js', will send a 404 error response.

Comment 16 Oved Ourfali 2017-10-31 09:48:44 UTC
Tomas - this doesn't sound ux-related.
Can you take a look?

Comment 17 Tomas Jelinek 2017-11-03 14:32:55 UTC
Indeed, taking.
The reason is that we need to specify all the libs for novnc to work and it does not require (hence does not contain) the jsunzip anymore. And it breaks because of this line: https://github.com/oVirt/ovirt-engine/blob/master/backend/manager/modules/services/src/main/webapp/novnc-main.jsp#L100

Comment 18 Michal Skrivanek 2017-11-07 15:19:38 UTC
the remaining problem is due to novnc-0.6.1 which was recently added to centos virt sig repo. Update of ovirt-engine code is pending on bug 1502652. Unlikely to happen right now.
Sandro, I believe you nacked removal of that package and/or somehow separating it out so it's not available to oVirt users, right? 
A feasible option is to Require:novnc-0.5.0 in engine spec. Would that be ok?

Comment 19 Yaniv Kaul 2017-11-16 07:41:31 UTC
Since all attached patches are merged, can this be moved to MODIFIED state?

Comment 20 jniederm 2017-11-16 23:15:31 UTC
Done(In reply to Yaniv Kaul from comment #19)
> Since all attached patches are merged, can this be moved to MODIFIED state?

Done

Comment 21 Liran Rotenberg 2018-02-01 16:26:24 UTC
Verified on:
novnc-0.5.1-2.el7.noarch
ovirt-engine-4.2.1.3-0.1.el7.noarch

Steps of verification:
1. Create a VM with VNC graphic protocol
2. Run the VM
3. Select novnc in Console Options dialog
4. Invoke Console of the VM

Result:
The console opened and worked on a new web window.

Comment 22 Sandro Bonazzola 2018-02-12 10:12:41 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.