rstudio/shiny-server

Quarto Shiny for Python interactive is not recognized when .qmd source is deployed in `app_dir`

Opened this issue · 0 comments

This is from

Take this example https://github.com/AlekseiBogachev/penguins-dashboard-docker using Quarto Shiny for Python interactive Dashboard.

# building 
docker build -t penguins-dashboard .
# Running the container
docker run --rm -it -p 3838:3838 penguins-dashboard bash

Running shiny-server command and then going to http://localhost:3838/#plots I am seeing

An error has occurred
The application failed to start.

The application exited during initialization.

Looking at apps log inside the container we see

$ cat logs/penguins-dashboard-dockeruser-20240729-093421-46701.log
Error: lexical error: invalid char in json text.
                                       NA
                     (right here) ------^
Execution halted

Activating SHINY_LOG_LEVEL=TRACE, I see now that R Markdown is used with this app

[2024-07-29T09:40:18.936] [TRACE] shiny-server - Worker process spawned with pid 783
[2024-07-29T09:40:18.936] [TRACE] shiny-server - r version: 4.2.2
[2024-07-29T09:40:18.936] [TRACE] shiny-server - shiny version: 1.8.1.1
[2024-07-29T09:40:18.936] [TRACE] shiny-server - rmarkdown version: 2.27
[2024-07-29T09:40:18.936] [TRACE] shiny-server - knitr version: 1.48
[2024-07-29T09:40:18.944] [TRACE] shiny-server - Closing backchannel
[2024-07-29T09:40:18.979] [TRACE] shiny-server - Attempting to connect to port 44947
[2024-07-29T09:40:18.980] [TRACE] shiny-server - Failed to connect to port 44947
[2024-07-29T09:40:19.080] [TRACE] shiny-server - Attempting to connect to port 44947
[2024-07-29T09:40:19.081] [TRACE] shiny-server - Failed to connect to port 44947
[2024-07-29T09:40:19.096] [TRACE] shiny-server - Port 44947 returned
[2024-07-29T09:40:19.097] [INFO] shiny-server - Error getting worker: Error: The application exited during initialization.

and I believe this is following

where a folder with a .qmd will be considered a Shiny prerendered Quarto document.

Removing penguins.qmd inside the docker container solves this, and I can see python is used

[2024-07-29T09:44:46.495] [TRACE] shiny-server - Worker process spawned with pid 810
[2024-07-29T09:44:46.496] [TRACE] shiny-server - python version: 3.11.9 (/dockeruser/.cache/pypoetry/virtualenvs/src-aT8E3Hct-py3.11/bin/python)
[2024-07-29T09:44:46.496] [TRACE] shiny-server - shiny version: 1.0.0

Probably this opened PR from @jcheng5 will fix this