Bug 1260948

Summary: In Safari web browser the java components info on Openshift console could not be shown correctly
Product: OKD Reporter: zhou ying <yinzhou>
Component: Management ConsoleAssignee: stlewis <stlewis>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, jforrest, mmccomas, spadgett, yinzhou
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Mac OS   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-23 21:17:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
by Safari
none
XHR in Safari
none
Hawtio Connect Options
none
localStorage
none
Debug logging
none
hawtio-jmx breakpoint
none
safari with wrong icon
none
Camel tab with icons in Safari none

Description zhou ying 2015-09-08 09:40:20 UTC
Created attachment 1071262 [details]
by Safari

Description of problem:
When create java pod ,wait untill the pod and container were running, on webconsole connect into the java pod by Safari web browser,could not show the JVM details. But by Firefox or Chrome can show JVM details correctly.

Version-Release number of selected component (if applicable):
Safari 8
openshift v1.0.5-268-g5802c03
kubernetes v1.1.0-alpha.0-1605-g44c91b1

How reproducible:
always

Steps to Reproduce:
1. Use command to create a template:
`oc create -f http://central.maven.org/maven2/io/fabric8/jube/images/fabric8/quickstart-java-camel-spring/2.2.19/quickstart-java-camel-spring-2.2.19-kubernetes.json`
2. By Safari web browser login the webconsole, use the template 'quickstart-java-camel-spring' to create a java pod;
3. Wait untill the pod and container were running status, connect into the java pod.


Actual results:
On the javascript console could not show the JVM details by Safari web browser, but use Firefox or Chrome or IE11 can show correctly.

Expected results:
Should show the JVM trees and java plugin details correctly by Safari web browser.

Additional info:

Comment 1 Jessica Forrester 2015-09-08 17:16:49 UTC
Can you attach a screenshot of what you are seeing, are there any errors in the javascript console?

Comment 2 Jessica Forrester 2015-09-08 17:25:54 UTC
Sorry just saw the attachment, ignore previous request.

Comment 3 Samuel Padgett 2015-09-08 17:35:43 UTC
Created attachment 1071434 [details]
XHR in Safari

The XHR has no authorization header.

Comment 4 Samuel Padgett 2015-09-08 17:46:39 UTC
Created attachment 1071437 [details]
Hawtio Connect Options

Comment 5 Samuel Padgett 2015-09-08 17:48:52 UTC
Created attachment 1071438 [details]
localStorage

Comment 6 Samuel Padgett 2015-09-08 17:56:21 UTC
localStorage.jvmConnect:

"{"quickstart-java-simple-mainclass":{"scheme":"https","host":"openshiftdev.local","port":8443,"path":"api/v1/namespaces/project3/pods/quickstart-java-simple-mainclass-6z43w:8778/proxy/jolokia/","useProxy":false,"jolokiaUrl":"https://openshiftdev.local:8443/api/v1/namespaces/project3/pods/quickstart-java-simple-mainclass-6z43w:8778/proxy/jolokia/","userName":null,"password":null,"view":null,"name":"quickstart-java-simple-mainclass","title":"quickstart-java-simple-mainclass","returnTo":"https://openshiftdev.local:8443/console/project/project3/browse/pods"}}"
https://openshiftdev.local:8443/api/v1/namespaces/project3/pods/quickstart-java-simple-mainclass-6z43w:8778/proxy/jolokia/?maxDepth=7&maxCollectionSize=500&ignoreErrors=true&canonicalNaming=false

Comment 7 Samuel Padgett 2015-09-08 18:06:02 UTC
Created attachment 1071440 [details]
Debug logging

Comment 8 Samuel Padgett 2015-09-08 19:49:02 UTC
Created attachment 1071456 [details]
hawtio-jmx breakpoint

new URI().hash() returns ""

Comment 9 Samuel Padgett 2015-09-08 19:53:57 UTC
The URL in the location bar doesn't have a hash value when the breakpoint is hit.

Comment 11 stlewis@redhat.com 2015-09-08 20:13:53 UTC
I wonder, the token is base64 encoded, right?  Wonder if there's a chance some odd character that should be URL encoded is causing this.

Comment 12 Samuel Padgett 2015-09-08 21:15:00 UTC
The good news: changing the link from /console/java/index.html -> /console/java/ allows the token to be read.

The bad news: This causes a later runtime error.

> TypeError: undefined is not an object (evaluating 'e.replace')

Comment 13 Samuel Padgett 2015-09-09 15:09:11 UTC
https://github.com/openshift/origin/pull/4594

Comment 14 zhou ying 2015-09-10 09:07:37 UTC
Have confirmed on devenv_2314.
openshift v1.0.5-322-g31315f4
kubernetes v1.1.0-alpha.0-1605-g44c91b1

The JVM trees can be showed, but when expand the Camel Route tree , some icon was not correct, when open the develope mode , still have 403 response. please see the new attachment.

Comment 15 zhou ying 2015-09-10 09:08:53 UTC
Created attachment 1072064 [details]
safari with wrong icon

Comment 16 Samuel Padgett 2015-09-10 12:33:30 UTC
Created attachment 1072160 [details]
Camel tab with icons in Safari

Comment 17 Samuel Padgett 2015-09-10 12:34:53 UTC
Comment on attachment 1072160 [details]
Camel tab with icons in Safari

Disregard, I see the problem when I expand the cbr-route tree node.

Comment 18 Samuel Padgett 2015-09-10 13:27:58 UTC
This second problem is unrelated to the first.

In Safari, I see

<img src="/img/icons/camel/endpoint24.png">

In Chrome, I see

<img src="/console/java/icons/camel/endpoint24.png">

The HTML <base> is correctly set in Safari, and the other icons show up. Stan, any ideas?

Comment 19 Samuel Padgett 2015-09-10 13:54:35 UTC
Looks like hawtio-integration has icons with absolute paths.

https://github.com/hawtio/hawtio-integration/blob/6a7aba40e75103d66e5ce2571274a1eb31d4ce28/plugins/camel/ts/endpointChooser.ts

Comment 20 stlewis@redhat.com 2015-09-10 19:05:39 UTC
Seems odd, the paths actually should get updated at runtime to the right one based on the document base.  Just to be on the safe side I tweaked those to be relative, also spotted one other place where the code wasn't adding the document base.  PR is here -> https://github.com/openshift/origin/pull/4621

Comment 21 zhou ying 2015-09-11 02:48:16 UTC
Confirmed on fedora_2323:
openshift v1.0.5-344-gd9fb965
kubernetes v1.1.0-alpha.0-1605-g44c91b1

It works now.