Giter Site home page Giter Site logo

Comments (7)

andrewazores avatar andrewazores commented on May 12, 2024

Thanks for the report. I haven't seen this before so I'm looking to reproduce it now.

from cryostat.

andrewazores avatar andrewazores commented on May 12, 2024

Hmm. I tried to reproduce this using both the kube-setup.sh script as well as using the Minishift setup in https://github.com/rh-jmc-team/jmc-robots-demo, and in both cases the report is rendered as HTML as expected, and checking the response headers with cURL shows text/html as well. What kind of Openshift deployment are you using? Proxy rewriting of the response sounds maybe plausible?

from cryostat.

tabjy avatar tabjy commented on May 12, 2024

I'm using OpenShift Origin (or, OKD). The cluster is setup with oc cluster up, where the oc command is provided by the origin-clients-3.11.1-1.fc30.x86_64 package on Fedora.

$ oc version 
oc v3.11.0+8de5c34
kubernetes v1.10.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

I'll try to docker exec into the actual container and see what the response is before any kind of proxy.

from cryostat.

tabjy avatar tabjy commented on May 12, 2024

The following is executed directly inside the container:

$ busybox wget -S -O - localhost:8181/reports/test
Connecting to localhost:8181 (127.0.0.1:8181)
  HTTP/1.1 200 OK 
  Content-Type: text/plain; charset=UTF-8
  Date: Thu, 3 Oct 2019 16:23:39 GMT
  Access-Control-Allow-Origin: *
  Connection: close
  Content-Length: 122357
  
<!--
   Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
   Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
-->
...

It's still text/plain. I have no idea what's happening...

from cryostat.

andrewazores avatar andrewazores commented on May 12, 2024

Can you double check the image hash? The latest should be sha256:0afea49f6cd34f09e753a2a1f4014576aa4ee3c6a92135bd5a7d8b7b6675c8fc, which you can see via docker inspect and probably somehow with oc as well.

from cryostat.

tabjy avatar tabjy commented on May 12, 2024

I managed to pull the class files out from the container.

$ javap -v -private WebServer.ServerImpl | grep -A30 "Response newReportResponse"
Warning: File ./WebServer$ServerImpl.class does not contain class WebServer.ServerImpl
  private fi.iki.elonen.NanoHTTPD$Response newReportResponse(java.lang.String, java.io.InputStream) throws java.io.IOException, org.openjdk.jmc.flightrecorder.CouldNotLoadRecordingException;
    descriptor: (Ljava/lang/String;Ljava/io/InputStream;)Lfi/iki/elonen/NanoHTTPD$Response;
    flags: (0x0002) ACC_PRIVATE
    Code:
      stack=3, locals=7, args_size=3
         0: aload_2
         1: astore_3
         2: aload_2
         3: invokestatic  #103                // Method org/openjdk/jmc/flightrecorder/rules/report/html/JfrHtmlRulesReport.createReport:(Ljava/io/InputStream;)Ljava/lang/String;
         6: astore        4
         8: aload_0
         9: aload         4
        11: invokevirtual #50                 // Method serveTextResponse:(Ljava/lang/String;)Lfi/iki/elonen/NanoHTTPD$Response;
        14: astore        5
        16: aload         5
        18: ldc           #80                 // String Access-Control-Allow-Origin
        20: ldc           #81                 // String *
        22: invokevirtual #82                 // Method fi/iki/elonen/NanoHTTPD$Response.addHeader:(Ljava/lang/String;Ljava/lang/String;)V
        25: aload_0
        26: getfield      #6                  // Field TRIM_WORKER:Ljava/util/concurrent/ExecutorService;
        29: aload_0
        30: aload_1
        31: invokedynamic #104,  0            // InvokeDynamic #2:run:(Lcom/redhat/rhjmc/containerjfr/net/WebServer$ServerImpl;Ljava/lang/String;)Ljava/lang/Runnable;
        36: invokeinterface #105,  2          // InterfaceMethod java/util/concurrent/ExecutorService.submit:(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
        41: pop
        42: aload         5
        44: astore        6
        46: aload_3
        47: ifnull        54
        50: aload_3
        51: invokevirtual #106                // Method java/io/InputStream.close:()V

The response.setMimeType() call is missing. I guess I somehow pulled an outdated image.

It seems to be most likely an issue on my side. I'll close the issue once confirmed.

from cryostat.

tabjy avatar tabjy commented on May 12, 2024

The kube-setup.sh on my fork is outdated and is still pulling from quay.io/andrewazores. Sorry...

I'm closing this issue. I'm really sorry for the confusion.

from cryostat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.