Bug 1257039 - GWT error msg when accessing webadmin portal with Chrome
GWT error msg when accessing webadmin portal with Chrome
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.6.0
Unspecified Unspecified
high Severity high
: ovirt-3.6.0-rc
: 3.6.0
Assigned To: Eyal Edri
Pavel Novotny
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-26 02:57 EDT by Gonza
Modified: 2016-03-11 02:32 EST (History)
13 users (show)

See Also:
Fixed In Version: 3.6.0-11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-11 02:32:13 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Integration
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
GWT error msg (23.82 KB, image/png)
2015-08-26 02:58 EDT, Gonza
no flags Details

  None (edit)
Description Gonza 2015-08-26 02:57:24 EDT
Description of problem:
After login in the webadmin portal the attached error msg is displayed.

Version-Release number of selected component (if applicable):
rhevm-3.6.0-0.12.master.el6.noarch
google-chrome-stable-41.0.2272.101-1.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Login to webadmin portal

Actual results:
GWT error msg is displayed

Expected results:
No error msgs are displayed

Additional info:
Screenshot with error msg attached
Comment 1 Gonza 2015-08-26 02:58:04 EDT
Created attachment 1067161 [details]
GWT error msg
Comment 2 Einav Cohen 2015-08-26 11:21:12 EDT
[CC'ing vszocs in case he has further insights]

this usually happens when the gwt build does not include all user-agents. 

@Eyal - any chance that we are performing the rhevm build without setting the BUILD_ALL_USER_AGENTS option to 1?

[see https://gerrit.ovirt.org/#/c/32164/]
Comment 3 Eyal Edri 2015-08-27 19:34:02 EDT
we have been using the same params ever since i can remember,
see https://gerrit.eng.lab.tlv.redhat.com/gitweb?p=ci-dev-tools.git;a=blob;f=build/rhev/ovirt-engine/build-engine.sh;h=235d22d8fa364ea43c39664a8024b09ae6333d18;hb=refs/heads/master

i.e
BUILD_FLAGS="-DskipTests=true -Dgwt.compiler.localWorkers=1 -Pgwt-user,gwt-admin,all-langs"

anything changed in 3.6 that should be reflected in the build params?
Comment 4 Einav Cohen 2015-08-27 19:47:21 EDT
(In reply to Eyal Edri from comment #3)
> we have been using the same params ever since i can remember,
> see
> https://gerrit.eng.lab.tlv.redhat.com/gitweb?p=ci-dev-tools.git;a=blob;
> f=build/rhev/ovirt-engine/build-engine.sh;
> h=235d22d8fa364ea43c39664a8024b09ae6333d18;hb=refs/heads/master
> 
> i.e
> BUILD_FLAGS="-DskipTests=true -Dgwt.compiler.localWorkers=1
> -Pgwt-user,gwt-admin,all-langs"
> 
> anything changed in 3.6 that should be reflected in the build params?

I know that things have changed [https://gerrit.ovirt.org/#/c/32164/] but I am not sure if these changes have made the above syntax obsolete. 
@Vojtech?
Comment 5 vszocs 2015-08-28 11:29:56 EDT
specfile change in patch [a] is consistent with latest upstream 3.6 specfile [b] as well as latest downstream master specfile [c].

[a] https://gerrit.ovirt.org/#/c/32164/4/ovirt-engine.spec.in
[b] https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=blob_plain;f=ovirt-engine.spec.in;hb=refs/heads/ovirt-engine-3.6
[c] https://gerrit.eng.lab.tlv.redhat.com/gitweb?p=ovirt-engine.git;a=blob_plain;f=ovirt-engine.spec.in;hb=refs/heads/master

Assuming Engine is built in a way that involves the specfile:
- ovirt_build_all_user_agents defaults to 1
  (unless ovirt_build_minimal is set, in which case it defaults to 0)
- BUILD_ALL_USER_AGENTS is set to ovirt_build_all_user_agents

Caveat:
- specifying DEV_EXTRA_BUILD_FLAGS_GWT_DEFAULTS="-Dgwt.userAgent=..." overrides BUILD_ALL_USER_AGENTS setting

In build-engine.sh posted by Eyal [d], I see no DEV_EXTRA_BUILD_FLAGS_GWT_DEFAULTS, which means the Engine build should use BUILD_ALL_USER_AGENTS=1, which should activate Maven profile to build all browsers (-P all-user-agents)

[d] https://gerrit.eng.lab.tlv.redhat.com/gitweb?p=ci-dev-tools.git;a=blob;f=build/rhev/ovirt-engine/build-engine.sh;h=235d22d8fa364ea43c39664a8024b09ae6333d18;hb=refs/heads/master

In other words, above build-engine.sh seems OK to me, it should build Engine for all browsers (IE8, IE9, IE10, Firefox, Chrome).

@Gonza, can you please try to remove browser's cache and try again? (You can check in browser's dev tools that HTTP requests for GWT resources like *.cache.html are actually made and not used from cache.)
Comment 6 vszocs 2015-08-28 11:43:34 EDT
Is it possible to check the build log?

Locally, I've triggered an Engine build via Makefile with BUILD_ALL_USER_AGENTS=1 and this is what I get during the build:

mvn \
  -P gwt-admin -P all-user-agents  -P gwtdraft  -Dgwt.logLevel=INFO -Dgwt.locale=en_US -Dgwt.compiler.localWorkers=1  \
  install

Notice the presence of "-P all-user-agents" in the "mvn" command.
Comment 7 Eyal Edri 2015-08-28 15:05:53 EDT
http://download.devel.redhat.com/brewroot/packages/org.ovirt.engine-root/3.6.0/12/data/logs/noarch/

+ make -j1 BUILD_GWT=1 BUILD_ALL_USER_AGENTS=1 BUILD_LOCALES=1 BUILD_UT=1 BUILD_VALIDATION=0 PACKAGE_NAME=rhevm RPM_VERSION=3.6.0 .....

it uses profiles:

 -P gwt-user -P gwt-admin -P all-user-agents -P all-langs  \
			install


so you can check in each profile which options are used.
Comment 8 vszocs 2015-08-31 13:30:21 EDT
(In reply to Eyal Edri from comment #7)
>  -P gwt-user -P gwt-admin -P all-user-agents -P all-langs  \
> 			install

This means that "all-user-agents" Maven profile has been indeed activated, which in turn sets "gwt.userAgent" Maven property to value:

  ie8,ie9,ie10,gecko1_8,safari

which translates to: IE8, IE9, IE10, Firefox, Chrome.

Note: IE11 doesn't have GWT permutation because IE11 doesn't identify itself as "MSIE" but "like Gecko" - we're working around that by using "X-UA-Compatible" <meta> tag to make IE11 render page as IE10 [1] (so theoretically, both IE10 and IE11 should render the page in the same way).

[1] https://gerrit.ovirt.org/#/c/23367/

Anyway, given that "-P all-user-agents" is indeed effective for the build (meaning that *all* supported browsers have their GWT permutation generated), the issue might be that:

a, you have configured your Chrome to identify itself as Firefox, which tricks GWT to load Firefox-specific permutation
   - try opening Chrome dev tools and inspecting "navigator.userAgent" expression

b, for some reason, you have corrupted browser cache which caused wrong copy of GWT permutation to be loaded
   - try cleaning Chrome browser cache

If the problem still persists, create VM with Chrome installed that reproduces the issue, and I will investigate further.
Comment 9 Gonza 2015-09-01 08:03:53 EDT
I got:
navigator.userAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
Comment 10 vszocs 2015-09-01 09:43:09 EDT
Gonza, is it possible to gain access to Engine instance in question to verify that WebAdmin includes GWT permutations for all browsers, including Chrome?
Comment 11 Gonza 2015-09-01 10:12:04 EDT
(In reply to vszocs from comment #10)
> Gonza, is it possible to gain access to Engine instance in question to
> verify that WebAdmin includes GWT permutations for all browsers, including
> Chrome?

Sure, details sent.
Comment 12 vszocs 2015-09-01 10:45:05 EDT
I have confirmed that Firefox ("gecko1_8") GWT permutation gets loaded in Chrome, so it's a GWT-specific build issue.

Inspected Engine instance only has 8 GWT permutations. Given that we support 5 browsers and 8 languages, it seems the given Engine instance was built for all (8) languages but a single (Firefox) browser.
Comment 13 vszocs 2015-09-01 10:48:46 EDT
Going to build Engine locally via make with BUILD_ALL_USER_AGENTS=1 and BUILD_LOCALES=1 (with DEV_BUILD_GWT_DRAFT=1 to speed-up the build).
Comment 14 vszocs 2015-09-01 11:01:53 EDT
Is it possible to see Maven output for http://download.devel.redhat.com/brewroot/packages/org.ovirt.engine-root/3.6.0/12/data/logs/noarch/build.log ? E.g. logs that look like "[INFO] Building <whatever> 3.6.0-SNAPSHOT" etc.
Comment 15 vszocs 2015-09-01 11:29:09 EDT
Results of performing local Engine (devel) build, using upstream branch "ovirt-engine-3.6":

$ make clean install-dev PREFIX="/home/vszocs/build/ovirt-engine" \
    BUILD_ALL_USER_AGENTS=1 BUILD_LOCALES=1 \
    BUILD_GWT_USERPORTAL=1 BUILD_GWT_WEBADMIN=1 BUILD_UT=1 \
    DEV_EXTRA_BUILD_FLAGS="-Dgwt.compiler.localWorkers=1"

...

mvn \
    -P gwt-user -P gwt-admin -P all-user-agents -P all-langs -Dgwt.compiler.localWorkers=1

...

[INFO] Compiling module org.ovirt.engine.ui.webadmin.WebAdmin

...

[INFO]    Compiling 40 permutations

Summary: building Engine via make with BUILD_ALL_USER_AGENTS=1 and BUILD_LOCALES=1 properly generates all 5 browsers x 8 languages = 40 permutations. The BUILD_ALL_USER_AGENTS (mapping to "all-user-agents" mvn profile) and BUILD_LOCALES (mapping to "all-langs" mvn profile) work as expected.

Since I can't reproduce this problem locally, we definitely need some (Maven output) logs to confirm the number of generated GWT permutations, along with exact build parameters and any tweaks, such as possible "ovirt_build_minimal" option defined in Engine spec file.
Comment 16 Einav Cohen 2015-09-01 11:35:51 EDT
Eyal, something doesn't add up. Vojtech used the same options and ended up with 40 permutations, as it should be. 

The formal builds are ending up with 8 permutations for some reason - Vojtech will need access to your builds environments / scripts / logs (specifically maven logs / etc. - maybe even see a build in action - can you please assist Vojtech / assign someone from your team to assist him in looking into these?

many thanks in advance.
Comment 17 Eyal Edri 2015-09-01 16:49:23 EDT
seems you might be right, looking at the maven log it looks like its only building 8:
http://download.devel.redhat.com/brewroot/packages/org.ovirt.engine-root/3.6.0/12/data/logs/maven/root.log

DEBUG util.py:257:  [INFO]    Compiling 8 permutations
DEBUG util.py:257:  [INFO]       Compiling permutation 0...
DEBUG util.py:257:  [INFO]       Compiling permutation 1...
DEBUG util.py:257:  [INFO]       Compiling permutation 2...
DEBUG util.py:257:  [INFO]       Compiling permutation 3...
DEBUG util.py:257:  [INFO]       Compiling permutation 4...
DEBUG util.py:257:  [INFO]       Compiling permutation 5...
DEBUG util.py:257:  [INFO]       Compiling permutation 6...
DEBUG util.py:257:  [INFO]       Compiling permutation 7...
DEBUG util.py:257:  [INFO]    Compile of permutations succeeded


so it looks like a regression in the maven profile.
if running: 

Executing command: ['/usr/bin/mvn', '-C', '-Pgwt-user,gwt-admin,all-langs', '-Dgwt.compiler.localWorkers=1', '-DskipTests=true', 'deploy']

so i'm not sure if we want to find why it stopped working or start using

make clean install-dev PREFIX="/home/vszocs/build/ovirt-engine" \
    BUILD_ALL_USER_AGENTS=1 BUILD_LOCALES=1 \
    BUILD_GWT_USERPORTAL=1 BUILD_GWT_WEBADMIN=1 BUILD_UT=1 \
    DEV_EXTRA_BUILD_FLAGS="-Dgwt.compiler.localWorkers=1"

which we'll need to pass as maven opts since mead doesn't use make to build.
Comment 18 vszocs 2015-09-03 11:58:44 EDT
(In reply to Eyal Edri from comment #17)
> seems you might be right, looking at the maven log it looks like its only
> building 8:
> http://download.devel.redhat.com/brewroot/packages/org.ovirt.engine-root/3.6.
> 0/12/data/logs/maven/root.log
> 
> DEBUG util.py:257:  [INFO]    Compiling 8 permutations
> DEBUG util.py:257:  [INFO]       Compiling permutation 0...
> DEBUG util.py:257:  [INFO]       Compiling permutation 1...
> DEBUG util.py:257:  [INFO]       Compiling permutation 2...
> DEBUG util.py:257:  [INFO]       Compiling permutation 3...
> DEBUG util.py:257:  [INFO]       Compiling permutation 4...
> DEBUG util.py:257:  [INFO]       Compiling permutation 5...
> DEBUG util.py:257:  [INFO]       Compiling permutation 6...
> DEBUG util.py:257:  [INFO]       Compiling permutation 7...
> DEBUG util.py:257:  [INFO]    Compile of permutations succeeded
> 
> 
> so it looks like a regression in the maven profile.
> if running: 
> 
> Executing command: ['/usr/bin/mvn', '-C', '-Pgwt-user,gwt-admin,all-langs',
> '-Dgwt.compiler.localWorkers=1', '-DskipTests=true', 'deploy']

Aha! The problem is that "all-user-agents" Maven profile is not specified.

Can you please change above to:

  ... -Pgwt-user,gwt-admin,all-langs,all-user-agents' ...

and re-trigger the build?

> 
> so i'm not sure if we want to find why it stopped working or start using
> 
> make clean install-dev PREFIX="/home/vszocs/build/ovirt-engine" \
>     BUILD_ALL_USER_AGENTS=1 BUILD_LOCALES=1 \
>     BUILD_GWT_USERPORTAL=1 BUILD_GWT_WEBADMIN=1 BUILD_UT=1 \
>     DEV_EXTRA_BUILD_FLAGS="-Dgwt.compiler.localWorkers=1"
> 
> which we'll need to pass as maven opts since mead doesn't use make to build.

Oh, so you're calling "mvn" directly because of Mead constraints. If so, just adapt the "mvn" command to include "all-user-agents" as part of "-P..." (Maven profile) definition.
Comment 19 Eyal Edri 2015-09-04 04:28:19 EDT
verified with the new -Pall-user-agents.
http://download.devel.redhat.com/brewroot/work/tasks/4369/9794369/root.log
Comment 20 Eyal Edri 2015-09-04 04:29:22 EDT
david, please rebuild engine before releasing 3.6.0-11 so it will have all user agents.

the script has been updated.
once we release, this bug can move to ON_QA.
Comment 21 David Caro 2015-09-14 07:13:23 EDT
The build was done
Comment 22 Pavel Novotny 2015-09-15 12:36:56 EDT
Verified in rhevm-webadmin-portal-3.6.0-0.15.master.el6.noarch (build 3.6.0-12).

Client machines:
chromium-browser-44.0.2403.89-0ubuntu0.1
Google Chrome 45.0.2454.85 @ Windows 10


Login to Web Administration and User Portal works without problems. No errors in GUI encountered.

Note You need to log in before you can comment on or make changes to this bug.