Skip to content

undefined blank page with firefox #117

Description

@kforner

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.

Activity

changed the title [-]undefined with firefox[/-] [+]undefined blank page with firefox[/+] on Jan 28, 2019

kforner commented on Jan 29, 2019

@kforner
Author

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 commented on Jan 29, 2019

@kforner
Author

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 commented on Oct 24, 2019

@clbenoit

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 commented on Oct 24, 2019

@kforner
Author

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

PauloJhonny commented on Mar 21, 2020

@PauloJhonny

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

nickmelis commented on Nov 6, 2020

@nickmelis
Contributor

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

clbenoit commented on Nov 9, 2020

@clbenoit

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 commented on Jan 21, 2021

@LEDfan
Member

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 commented on Jul 14, 2021

@ivokwee

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

LEDfan commented on Jul 16, 2021

@LEDfan
Member

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.

added this to the Next milestone on Jul 13, 2023

LEDfan commented on Jul 25, 2023

@LEDfan
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions