Shiny server - "No file" error when downloading CSV on Chrome

920 views
Skip to first unread message

ronn...@breather.com

unread,
Mar 15, 2017, 6:06:47 PM3/15/17
to Shiny - Web Framework for R
Hello,

I have an app deployed to Shiny Server on docker cloud that allows users to download CSVs but this feature breaks on Chrome. Firefox on the other hand appears to be fine.

Since I don't have a reproducible example, at the moment I'm just curious if anyone has some educated guesses for why this might be happening?

Here's the code for the download button in case I've made a really obvious mistake:

# server.R (not a reproducible example, sorry)
  output$download <- downloadHandler(
    filename = "location_rev_projection.csv",
    content = function(file) {
      write.csv(finalForecastTable(), file)
    }
  )

#ui.R
        tabPanel("Predictions Table",
                 downloadButton("download", "Download CSV"),
                 tableOutput("table")),

Joe Cheng

unread,
Mar 16, 2017, 10:27:08 AM3/16/17
to ronn...@breather.com, Shiny - Web Framework for R
How exactly does it break when you try it in Chrome?
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/9bf7e7e1-5a6b-48ca-8701-8ee762efe5b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ronny Li

unread,
Mar 16, 2017, 11:05:14 AM3/16/17
to Joe Cheng, Shiny - Web Framework for R
Hi Joe, here's a screenshot of the error:
Inline image 1

The file is successfully downloaded when making the same request on Firefox.

Thanks for your time!

On Thu, Mar 16, 2017 at 10:26 AM, Joe Cheng <j...@rstudio.com> wrote:
How exactly does it break when you try it in Chrome?
On Wed, Mar 15, 2017 at 3:06 PM <ronn...@breather.com> wrote:
Hello,

I have an app deployed to Shiny Server on docker cloud that allows users to download CSVs but this feature breaks on Chrome. Firefox on the other hand appears to be fine.

Since I don't have a reproducible example, at the moment I'm just curious if anyone has some educated guesses for why this might be happening?

Here's the code for the download button in case I've made a really obvious mistake:

# server.R (not a reproducible example, sorry)
  output$download <- downloadHandler(
    filename = "location_rev_projection.csv",
    content = function(file) {
      write.csv(finalForecastTable(), file)
    }
  )

#ui.R
        tabPanel("Predictions Table",
                 downloadButton("download", "Download CSV"),
                 tableOutput("table")),

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discuss+unsubscribe@googlegroups.com.



--
Breather Inc.

Ronny Li

Data Scientist

ronn...@breather.com

5605 Avenue de Gaspé #701, Montréal, QC H2T 2A4

breather.com


Try Breather free    |    We’re hiring!

Joe Cheng

unread,
Mar 20, 2017, 9:37:45 PM3/20/17
to Ronny Li, Shiny - Web Framework for R
Very strange, are there any JavaScript errors in the Chrome JS console?

On Thu, Mar 16, 2017 at 8:05 AM Ronny Li <ronn...@breather.com> wrote:
Hi Joe, here's a screenshot of the error:
Inline image 1

The file is successfully downloaded when making the same request on Firefox.

Thanks for your time!
On Thu, Mar 16, 2017 at 10:26 AM, Joe Cheng <j...@rstudio.com> wrote:
How exactly does it break when you try it in Chrome?
On Wed, Mar 15, 2017 at 3:06 PM <ronn...@breather.com> wrote:
Hello,

I have an app deployed to Shiny Server on docker cloud that allows users to download CSVs but this feature breaks on Chrome. Firefox on the other hand appears to be fine.

Since I don't have a reproducible example, at the moment I'm just curious if anyone has some educated guesses for why this might be happening?

Here's the code for the download button in case I've made a really obvious mistake:

# server.R (not a reproducible example, sorry)
  output$download <- downloadHandler(
    filename = "location_rev_projection.csv",
    content = function(file) {
      write.csv(finalForecastTable(), file)
    }
  )

#ui.R
        tabPanel("Predictions Table",
                 downloadButton("download", "Download CSV"),
                 tableOutput("table")),

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
--
Breather Inc.

Ronny Li

Data Scientist

ronn...@breather.com

5605 Avenue de Gaspé #701, Montréal, QC H2T 2A4

breather.com


Try Breather free    |    We’re hiring!

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/CAFRHiuP07%2BO6_P%3Dsp%3DoGdVTXpA%3DkF16WHNWoodW%3DDA_1EU%2BA-A%40mail.gmail.com.

ronn...@breather.com

unread,
Mar 21, 2017, 11:12:15 AM3/21/17
to Shiny - Web Framework for R, ronn...@breather.com
Hi Joe, no errors in the console.

Screenshot attached and my Chrome version is Version 56.0.2924.87 (64-bit)
Screen Shot 2017-03-21 at 11.10.44 AM.png

Joe Cheng

unread,
Mar 21, 2017, 4:28:46 PM3/21/17
to ronn...@breather.com, Shiny - Web Framework for R
Is it possible you have multiple containers running multiple copies of Shiny Server, and your requests are getting routed to the wrong instance of Shiny Server?

ronn...@breather.com

unread,
Mar 21, 2017, 10:11:42 PM3/21/17
to Shiny - Web Framework for R, ronn...@breather.com
We are definitely running multiple containers with multiple copies of Shiny Server and scaling back down to 1 container fixes the download issue on Chrome. Very interesting, thanks for catching that! No wonder the download would occasionally work...

We are running this setup in order to temporarily bypass the limitation where each app shares the same R process (computation in the app is rather expensive and docker cloud provides some basic load balancing). Shiny Server Pro is currently not the right path since the app is still in prototype phase and we want to determine its business value before further investments are made. Suggestions to help us achieve this are appreciated but not required. Thanks for your help Joe!

Joe Cheng

unread,
Mar 22, 2017, 8:17:49 PM3/22/17
to ronn...@breather.com, Shiny - Web Framework for R
Can the load balancer do cookie-based sticky sessions? That might tide you over a little bit longer.

Ronny Li

unread,
Mar 23, 2017, 9:43:07 AM3/23/17
to Joe Cheng, Shiny - Web Framework for R
I can set up haproxy or nginx instead which should work. To obtain a session cookie should I follow the instructions in this Stack Overflow question (use the js.cookie.js package and Shiny.OnInputChange())?

Thanks as always,

To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discuss+unsubscribe@googlegroups.com.

Joe Cheng

unread,
Mar 23, 2017, 12:42:37 PM3/23/17
to Ronny Li, Shiny - Web Framework for R
No, it'd be a feature of your load balancer, not something you do to your app.




--

Ronny Li

unread,
Mar 23, 2017, 4:13:31 PM3/23/17
to Joe Cheng, Shiny - Web Framework for R
Got it working :) For others to reference, our setup is a docker cloud stack with haproxy load balancer and COOKIE=SRV insert indirect nocache as an environment variable for the shiny server container.

To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discuss+unsubscribe@googlegroups.com.



--
Breather Inc.

Ronny Li

Data Scientist

ronn...@breather.com

5605 Avenue de Gaspé #701, Montréal, QC H2T 2A4

breather.com


Try Breather free    |    We’re hiring!

Reply all
Reply to author
Forward
0 new messages