Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined blank page with firefox #117

Closed
kforner opened this issue Jan 25, 2019 · 11 comments
Closed

undefined blank page with firefox #117

kforner opened this issue Jan 25, 2019 · 11 comments
Milestone

Comments

@kforner
Copy link

kforner commented Jan 25, 2019

I have a shinyproxy with a unique shiny app.
This app takes a while to start.

When I open it in firefox, I got in the logs:

2019-01-25 16:27:23.873  INFO 1 --- [ XNIO-2 task-36] c.s.docker.client.DefaultDockerClient    : Starting container with Id: 9d4a4b1211b62acf0333f984d7888b0eff9defa36b3d9178e9e6d63c3adb8946
2019-01-25 16:27:26.542  WARN 1 --- [ XNIO-2 task-36] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (2/100): http://9d4a4b1211b6:3838
2019-01-25 16:27:28.543  WARN 1 --- [ XNIO-2 task-36] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (3/100): http://9d4a4b1211b6:3838
2019-01-25 16:27:30.544  WARN 1 --- [ XNIO-2 task-36] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (4/100): http://9d4a4b1211b6:3838
2019-01-25 16:27:36.249  INFO 1 --- [ XNIO-2 task-36] e.o.containerproxy.service.ProxyService  : Proxy activated [user: 8C4dkNEk5huAMEBjJPOdPdt2IZGHqQxIiaH2qG9w] [spec: rifmapp] [id: ba1ba5e3-71cb-4a6b-bfa3-22198a114900]

The problem is that firefox displays a blank page with "undefined" as unique message before the log message "Proxy activated"
If hit ENTER in the URL bar, it displays the page properly.

If I do the same thing in Chromium, it works just fine:

My understanding is that Firefox does not wait properly for the activation.

@kforner kforner changed the title undefined with firefox undefined blank page with firefox Jan 28, 2019
@kforner
Copy link
Author

kforner commented Jan 29, 2019

Just an additional info:
I do not get the blank page when deployed on a server, i.e. the bug happens when using localhost URLs.

@kforner
Copy link
Author

kforner commented Jan 29, 2019

Some context:

  • no authentication
  • shinyproxy 2.1.0 in a docker
  • ubuntu 16.04
  • docker CE 18.09.1

application.yml

proxy:
  port: 8080
  authentication: none
  hide-navbar: true
  container-wait-time: 200000
  docker:
      internal-networking: true
  specs:
  - id: myapp
    display-name: myapp
    description: myapp
    container-volumes: ["/home/karl/shinyproxy/../:/home/docker/proj/"]
    container-image: myapp
    container-network: shinyproxy-net
logging:
  file:
    shinyproxy.log

Dockerfile:


RUN mkdir -p /opt/shinyproxy/
RUN wget https://www.shinyproxy.io/downloads/shinyproxy-2.1.0.jar -O /opt/shinyproxy/shinyproxy.jar
COPY application.yml /opt/shinyproxy/application.yml

WORKDIR /opt/shinyproxy/
CMD ["java", "-jar", "/opt/shinyproxy/shinyproxy.jar"]

The app is run using the entrypoint:

ENTRYPOINT ["R", "-e", "shiny::runApp('shiny', host = '0.0.0.0', port = 3838)"]

The dockers are run like this:

docker network create shinyproxy-net
docker run -d \
--name shinyproxy \
-v /var/run/docker.sock:/var/run/docker.sock \
--net shinyproxy-net \
-p 8080:8080 \
shinyproxy

Then:

<body>undefined</body>

@clbenoit
Copy link

Hi kforner,

Experimenting the same issue from two days, can't find a solution... Did you succeed to fix it ?

Thanks a lot,

Clément

@kforner
Copy link
Author

kforner commented Oct 24, 2019

Hmm in my case I have an apache proxy on top of it, so I think I just redirected on the app url.

@PauloJhonny
Copy link

@kforner @Cala3len Did you succeed to fix it? Thank you.

@nickmelis
Copy link
Contributor

Having the same error here with a similar situation. Did anyone manage to get a sense of what's going on?

@clbenoit
Copy link

clbenoit commented Nov 9, 2020

Was a long time ago and i do not remember the details. But for me it was a matching issue between shiny-server, docker and host ports...

@LEDfan
Copy link
Member

LEDfan commented Jan 21, 2021

Hi all

I encountered this issue today and tried to investigate it. As reported above the error does not happen when using Chromium/Chrome. It also only seems to happen when using a container that takes a bit longer to startup. With the following container I can easily reproduce it:

  - id: zeppelin
    display-name: Apache Zeppelin
    container-image: apache/zeppelin:0.8.1
    port: 8080

More interesting, this only happens when you access ShinyProxy from the server host. It doesn't happen when you access it from a different PC/VM. And finally it doesn't happen with the Kuberntes backend. Unfortunately I don't find any solution for this problem, I hope I'll eventually find a solution, but for now I can at least reproduce it.

@ivokwee
Copy link

ivokwee commented Jul 14, 2021

Same problem. But if you wait and reload it continues. Anyone has a fix?

@LEDfan
Copy link
Member

LEDfan commented Jul 16, 2021

Hi everyone

First of all: this issue should only be happening if you are using ShinyProxy with docker in combination with Firefox on the same host that ShinyProxy and docker are running on. This is an inconvenient problem, but it should not affect your production environments.

However, I again did some research on this issue and it seems to be a bug in Firefox. I found this bug report on bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1238377 , which seems quite related. A workaround in the report is to set network.notify.changed to false in about:config. With this option disabled, everything works properly for me. When enabling the option again, the problem happens again.

I did some more testing and I can reproduce the problem without ShinyProxy (using a simple Flaks application). Therefore I created a bug report in the Firefox bug tracker: https://bugzilla.mozilla.org/show_bug.cgi?id=1720833 let's see whether they can solve it.

@LEDfan LEDfan added this to the Next milestone Jul 13, 2023
@LEDfan
Copy link
Member

LEDfan commented Jul 25, 2023

The bug is still present in Firefox, but versions 3.0.2 of ShinyProxy includes a workaround for this. This also improves the startup when a request fails for any other reason.

@LEDfan LEDfan closed this as completed Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants